New issue
Advanced search Search tips
Starred by 6 users

Issue metadata

Status: IceBox
Closed: Aug 2012
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

  • Only users with Commit permission may comment.

Sign in to add a comment

Issue 50360: Web Worker: postMessage() fails for big arguments (not always)

Reported by, Jul 27 2010

Issue description

Chrome Version       : 
Google Chrome	5.0.375.125 (Official Build 53311) beta
WebKit	533.4
User Agent	Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.125 Safari/533.4
Command Line	 /opt/google/chrome/google-chrome

URLs (if applicable) : see attachments
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
     Safari 4: -
  Firefox 3.x: OK
         IE 7: -
         IE 8: -
Chromium 6.0.475.0 (Developer Build 53429): FAIL

What steps will reproduce the problem?
1. Open the attached file 'index.html'.
2. Click the button "Start".
3. A web worker will be started, which loads the file 'points-5000.json' in a XMLHttpRequest and sends the content back to the main script. Then a new web worker is started which does the same, and so on.

What is the expected result?
No error message message should appear and the script should run as long as the user does not cancel it.

What happens instead?
After 12 or 13 started web workers, the following error message is thrown, when the file content is sent to the main script using postMessage():

Uncaught SyntaxError: Not enough arguments

Please provide any additional information below. Attach a screenshot if
The file 'points-5000.json' has the size 682,8 KB. If I use a file that is approx. twice as big, the error is thrown after 6 or 7 started web workers, exactly the half.
682 KB View Download
971 bytes View Download
314 bytes View Download

Comment 1 by, Jul 28 2010

I made further tests. The problem is not the parameter size, it seems to be related to using XMLHttpRequest in a web worker.

Take a look at 'index_reverse.html' and 'webworker_reverse.html'. In 'index_reverse.html' I am now loading the file using a XMLHttpRequest. Then I pass the response text to the web worker and from there pass it back to the main script. And that works! And not only 13 times.
1.6 KB View Download
74 bytes View Download

Comment 2 by, Nov 1 2010

I had the same problem, XMLHttpRequest, many web workers. I tried several things.  Pretty sure the one that worked was to call worker.terminate() in the onmessage.  I already had close() calls in the workers.  I created pseudo-guids and put passed them to the workers to id them so I would know which was done so I could terminate it in onmessage.

Comment 3 by, Mar 27 2011

This also hobbles kthoom to a single-threaded web app:

Comment 4 by, Jun 14 2011

Labels: -Area-Undefined Area-WebKit Feature-Workers

Comment 5 by, Jun 30 2011

Same error when using worker for reading files. The only funny thing is this:


when using this, everything goes ok, but when i drop console.log(), exception is thrown after 5 or more calls.

Comment 6 by, Jun 30 2011

Btw, sometimes the app crashes after these exceptions.

Comment 7 by, Aug 10 2012

Project Member
Status: IceBox
Closing old bug as obsolete. Please file a new bug (with details) if this problem is still occurring for you.

Comment 8 by, Oct 13 2012

Project Member
Labels: Restrict-AddIssueComment-Commit
This issue has been closed for some time. No one will pay attention to new comments.
If you are seeing this bug or have new data, please click New Issue to start a new bug.

Comment 9 by, Mar 11 2013

Project Member
Labels: -Area-WebKit Cr-Content

Comment 10 by, Apr 6 2013

Project Member
Labels: -Cr-Content Cr-Blink

Sign in to add a comment