New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 921473 link

Starred by 3 users

Issue metadata

Status: Duplicate
Merged: issue 877055
Owner:
Closed: Today
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

SharedArrayBuffers sent to webworkers exhausts memory and crashes tab.

Reported by jacob.sm...@gmail.com, Jan 14

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18312

Steps to reproduce the problem:
See the attached file for implementation.
1. Create a webworker which posts an acknowledge string on every message received
2. Initialize and send a large SharedArrayBuffer to the webworker
3. Keep sending new SharedArrayBuffers on each acknowledge from the webworker
4. Observe that the tab process reaches 4GB of memory usage and crashes with "Aw, Snap!"
5. Reload the page and click the "Collect Garbage" button in the DevTools memory tab before the tab process reaches 4GB of memory usage.
6. observe that the page works fine as long as you manually garbage collect.

What is the expected behavior?
Chrome should garbage collect SharedArrayBuffers which are no longer used by the page or the webworkers automatically, instead of relying on the user clicking the "Collect Garbage" button in DevTools. 

What went wrong?
SharedArrayBuffers sent to the webworker are not garbage collected. 

Did this work before? N/A 

Chrome version: 73.0.3670.0  Channel: canary
OS Version: 10.0
Flash Version:
 
script.js
620 bytes View Download
Components: -Blink Blink>Workers Blink>JavaScript>GC
Are SAB not being taken into account in GC memory pressure heuristics on workers?
Labels: Needs-Triage-M73
Cc: phanindra.mandapaka@chromium.org
Labels: Triaged-ET Needs-Feedback
Thanks for filing the issue...

@Reporter: It would be really helpful if a sample test file/URL is provided, so that we can investigate the issue further.

Thanks.!

Comment 4 by jacob.sm...@gmail.com, Jan 16 (6 days ago)

A minimal example reproducing the issue was attached to the original report. Please let me know if this is not enough. 
Project Member

Comment 5 by sheriffbot@chromium.org, Jan 16 (6 days ago)

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 6 by susan.boorgula@chromium.org, Jan 17 (5 days ago)

Cc: susan.boorgula@chromium.org
Labels: Needs-Feedback
jacob.smedegaard@ Thanks for the update.

We cannot triage this issue with a .js file.
Request you to provide a HTML file or a sample extension where this issue can be reproduced, which will help in further triaging.

Thanks..

Comment 7 by jacob.sm...@gmail.com, Jan 17 (5 days ago)

Hi Susan,

Thank you for the quick reply :)
I have attached a .html version of the test case.
As an alternative, I have created a codepen which also reproduces the issue.
https://codepen.io/anon/pen/PXvmdP


index.html
1.2 KB View Download
Project Member

Comment 8 by sheriffbot@chromium.org, Jan 17 (5 days ago)

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 9 by viswa.karala@chromium.org, Jan 18 (4 days ago)

Cc: viswa.karala@chromium.org
Labels: Target-73 M-73 FoundIn-71 FoundIn-73 FoundIn-72
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on chrome reported version# 73.0.3670.0, stable# 71.0.3578.98 and on latest chrome# 73.0.3674.0 with '.html' file provided in comment# 7 using Windows-10. As this issue is seen from M-60(60.0.3112.0), hence considering this issue as Non-Regression and marking it as Untriaged.
Note: Issue is not seen on Mac 10.14.0 and Ubuntu 17.10.

Thanks!

Comment 10 by jacob.sm...@gmail.com, Jan 18 (4 days ago)

I was able to somewhat reproduce the issue running the index.html file on Ubuntu 18.04 with chrome version 70.0.3538.77 (Official Build) (64-bit).

At first it will throw a rangeError when trying to allocate a new buffer after it reaches 4GB memory usage. 

Uncaught RangeError: Array buffer allocation failed
    at new SharedArrayBuffer (<anonymous>)
    at post (index.html:16)
    at Worker.worker.addEventListener (index.html:24)

After about a minute Ubuntu will report that a chrome process has crashed. See Crash Report ID 88ee9a528c4f4ffb (Local Crash ID: Chrome).
Opening the Chrome DevTools at any point after the RangeError has occurred will cause the tab to crash with an "Aw,snap".

Comment 11 by jacob.sm...@gmail.com, Jan 18 (4 days ago)

A co-worker has confirmed that eventually it will also crash on Mac using the stable release of Chrome.

Comment 12 by kinuko@chromium.org, Jan 21 (2 days ago)

Cc: herhut@chromium.org yangguo@chromium.org
Components: -Blink>Workers
Guessed that this is dup of issue 877055

Comment 13 by hablich@chromium.org, Today (21 hours ago)

Owner: herhut@chromium.org
Status: Assigned (was: Untriaged)
herhut, can you please confirm #12?

Comment 14 by herhut@chromium.org, Today (20 hours ago)

Mergedinto: 877055
Status: Duplicate (was: Assigned)
It indeed is. Thanks for the minimal example!

Sign in to add a comment