yashprit / crypto-js

Automatically exported from code.google.com/p/crypto-js
0 stars 0 forks source link

rangeerror when using web workers #109

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
On some versions of chrome [1] and when using web workers there is a very small 
limit to the argment length supported by the Function.apply method. Too many 
arguments raise a "RangeError: Maximum call stack size exceeded" exception. 
CryptoJS guards against this passing too many arguments [2] but we found that 
in one chrome build (Fedora Linux 64bit) the limit in web workers was smaller, 
at 31774, and not 65536 as is currently checked by CryptoJS. 

At present we are forced to patch CryptoJS to use a smaller limit (31774) 
because we need to support Linux users. I am not sure what the cause of the 
limit is, I've mentioned the issue to the chromium team (see below) but in the 
meantime it would be nice if we could get a fix in CryptoJS somehow.

1. https://code.google.com/p/chromium/issues/detail?id=252492#c5
2. http://code.google.com/p/crypto-js/issues/detail?id=37, 
http://code.google.com/p/crypto-js/source/browse/branches/3.x/src/core.js?spec=s
vn499&r=499#203

Original issue reported on code.google.com by koukopoulos on 2 Dec 2013 at 11:12

GoogleCodeExporter commented 9 years ago
here's a fiddle that shows different limits in web workers for some versions of 
chrome: http://jsfiddle.net/3wrju/17/

Original comment by koukopoulos on 11 Dec 2013 at 9:12