Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum call stack size exceed in core.js #5

Open
max-lt opened this issue May 4, 2016 · 2 comments
Open

Maximum call stack size exceed in core.js #5

max-lt opened this issue May 4, 2016 · 2 comments

Comments

@max-lt
Copy link

max-lt commented May 4, 2016

Line 226 of core.js : crash sometime for obscur reasons
(with chromium 50.0.2661.75 (64-bit))
(not with FireFox 46.0)
solved by changing

219             } else if (thatWords.length > 0xffff) {
220                 // Copy one word at a time
221                 for (var i = 0; i < thatSigBytes; i += 4) {
222                     thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
223                 }
224             } else {
225                 // Copy all words at once
226                 thisWords.push.apply(thisWords, thatWords);
227             }

by

219             } else {
220                 // Copy one word at a time
221                 for (var i = 0; i < thatSigBytes; i += 4) {
222                     thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
223                 }
224             }
Error : Uncaught RangeError: Maximum call stack size exceeded  
  C_lib.WordArray.Base.extend.concat  
  C_lib.BufferedBlockAlgorithm.Base.extend._append  
  C_lib.Hasher.BufferedBlockAlgorithm.extend.finalize  
  (anonymous function)  
  hashChunk  
  (anonymous function)

EDIT : fix can be done by lowering the word limit : passed from Oxffff to 0xfff

219             } else if (thatWords.length > 0xfff) {
220                 // Copy one word at a time
221                 for (var i = 0; i < thatSigBytes; i += 4) {
222                     thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
223                 }
224             } else {
225                 // Copy all words at once
226                 thisWords.push.apply(thisWords, thatWords);
227             }
@caseychoiniere
Copy link

caseychoiniere commented Oct 28, 2016

I also get this error when using md5.js in a web worker on Chrome. Happens with files between 127kb - 262kb. Is there possibly a similar fix for md5.js that might be able to solve this problem? Any help would be greatly appreciated! Duke-Translational-Bioinformatics/duke-data-service-portal#506

@max-lt
Copy link
Author

max-lt commented Nov 23, 2016

You can find a maintained version of cryptojs at https://github.com/brix/crypto-js/.
This bug is no longer present. brix/crypto-js@f50b051

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants