What steps will reproduce the problem? 1. Use CryptoJS to compute an MD5 inside a web worker with particular file sizes
What is the expected output? What do you see instead? I expected to get an MD5, but instead got a maximum call stack exceeded error.
What version of the product are you using? On what operating system? 3.1.2 on chrome linux.
Please provide any additional information below.
Here is a patch which fixes it. For some reason this only happens in a web worker, perhaps the limits to fn.apply are less in the web worker environment?..
Index: core.js
--- core.js (revision 664) +++ core.js (working copy) @@ -217,7 +217,9 @@ } } else { // Copy all words at once - thisWords.push.apply(thisWords, thatWords); + for (var i = 0; i < thatWords.length) { + thisWords.push(thatWords[i]); + } } this.sigBytes += thatSigBytes;
Comment #1
Posted on Jul 9, 2013 by Happy HorseTo make my job easier, could you attach code that reproduces the issue?
Comment #2
Posted on Jul 9, 2013 by Quick KangarooSorry it took a while. It was a lot of work to extract a minimal example from our application. Attached is everything you need to provoke the issue.
A few things you will need to do to use this example 1) Either serve this directory from a web server or using file:/// with web security disabled in chrome 2) Update the path in index.html to the core.js and md5.js accordingly
After you see the error, replace core.js in the importScript with core2.js to see the fix in action.
Let me know if you have any questions, Evan
Comment #3
Posted on Jul 9, 2013 by Quick KangarooAlso, use the SRR file as the test. It needs to be a file size that is not % 4.
Status: New
Labels:
Type-Defect
Priority-Medium