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

Issue 823260 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Calling drawImage & toBlob repeatedly in an extension causes the extension to crash

Reported by peterwil...@gmail.com, Mar 19 2018

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36

Steps to reproduce the problem:
1. Load 'extensionCrashPoC' as a extension
2. Navigate to 'http://example.com'
3. When prompted select 'Your Entire Screen' and then 'Share'
4. Wait between 20 minutes and an hour

What is the expected behavior?
When starting the extension's background script should capture the user's screen as a media stream and write it to a video element. It should then loop forever doing the following:

1. Create a canvas
2. Draw the current frame from the video element to the canvas
3. Convert the image currently drawn on the canvas to a blob
4. Repeat

What went wrong?
After between 20 minutes and an hour the extension will crash with the message 'extensionCrashPoC has crashed'.

Did this work before? Yes 64

Chrome version: 65  Channel: stable
OS Version: 10 (1709)
Flash Version: 

If Developer Tools for the background page are open they will also crash, and if a remote debugger is connected it will disconnect from the background page. No error message is visible.

Running the Javascript Profiler does not reveal any memory leaks and resources appear to be successfully released and cleared up after their loop has been completed.

The extension does not crash when running under Chrome 64, only under Chrome 65.

The issue happens when running under Windows (10 - 1709) and Linux (Fedora 27), it may also happen on Mac OS but I have not observed this.

There does not appear to be any issue running the same code on the page directly, only as part of an extension.
 
extensionCrashPoC.zip
1.5 KB Download
1521468737535285461425.jpg
65.9 KB View Download
Labels: Needs-Bisect Needs-Triage-M65

Comment 3 Deleted

I've looked a bit more of this and made a simpler PoC.

In the Javascript Profiler and 'JavaScript memory' column of Chrome's Task Manager it appears that resources are being cleared. However the 'Memory footprint' column of Chrome's Task Manager grows until the extension crashes.

I've also added 'inPageNoCrash.html' which demonstrates that the issue only happens in a background script. When this page is loaded the 'Memory footprint' column of Chrome's Task Manager grows and then gets cleared periodically.

extensionCrashPoC.zip
1.7 KB Download
Cc: sindhu.chelamcherla@chromium.org
Labels: Triaged-ET Needs-Feedback
Unable to reproduce this issue on latest stable 65.0.3325.162 using Windows 10, Ubuntu 14.04 and Mac 10.13.3 with steps mentioned below.

1. Added attached extensions(tried with both extensions in #0 and #4) to chrome.
2. Navigated to 'http://example.com' and didn't observe any prompt to select 'Your Entire Screen' and then 'Share' and didn't observe any crash even after waiting for more than one hour.

@Reporter: Could you please let us know if we miss anything? Also please provide crash id from chrome://crashes if you see any crash. Any further info on reproducing this issue would help in further triaging.

Thanks!
Hi Sindhu,

Thanks for looking into this.

The second attachment with the simpler PoC wont capture your screen, just draw to a canvas and call toBlob over and over - sorry, should have explained that and given updated steps to reproduce:

1. Load 'extensionCrashPoC' as a extension
2. Navigate to 'http://example.com'
3. Open Chrome's Task Manager
4. Observe the 'Memory footprint' value for 'Extension: extensionCrashPoC'
5. Wait between 20 minutes and an hour

The value for 'Memory footprint' will continue growing until the system is out of memory and the extension crashes. For a Windows 10 system with 2GB of RAM this is about 20 minutes.

Unfortunately nothing appears to be written to chrome://crashes

I've also attached to screenshots showing the value of 'Memory footprint' in after 10 minutes of execution Chrome 64 (64.0.3282.140) and Chrome 65 (65.0.3325.162). You can see memory usage on 64 is ~250,000K while memory usage on 65 is ~2,000,000K.
C65.png
16.2 KB View Download
C64.png
16.6 KB View Download
Project Member

Comment 8 by sheriffbot@chromium.org, Mar 20 2018

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
Labels: -Pri-2 -Needs-Bisect hasbisect-per-revision FoundIn-66 RegressedIn-65 M-65 Target-67 Target-66 Target-65 FoundIn-65 ReleaseBlock-Stable FoundIn-67 OS-Linux OS-Mac Pri-1
Owner: zakerinasab@chromium.org
Status: Assigned (was: Unconfirmed)
Able to reproduce this issue on latest stable 65.0.3325.167, on latest beta 66.0.3359.33 and on latest canary 67.0.3377.0 using Windows 10, Ubuntu 14.04 and Mac 10.13.3. High Increase of memory footprint is seen on adding that extension.

Good Build: 65.0.3285.0
Bad Build: 65.0.3286.0

You are probably looking for a change made after 521714 (known good), but no later than 521715 (first known bad).
CHANGELOG URL:
 https://chromium.googlesource.com/chromium/src/+log/510c597b5876820f33c678b5d04a5f71e42e26f6..6e0ab6ae54cc837abd96024dae5595a8d299e7b8

Reviewed-on: https://chromium-review.googlesource.com/780279

Suspecting same from Changelog.

@zakerinasab: Please confirm the bug and help in re-assigning if it is not related to your change. Adding RB-Stable for M-65. Please change if not the case.

Thanks!
Components: -Blink Blink>Canvas
This is interesting. I'll look into that.
Cc: junov@chromium.org
Labels: -ReleaseBlock-Stable
The fix is ready for this bug. This won't block M65 further roll out as crashing happens after running the extension 20 minutes on a 2GB memory machine for one user.

Cc: abdulsyed@chromium.org manoranj...@chromium.org
Labels: -M-65 -Target-65 M-66
Thank you  zakerinasab@. Pls request a merge to M66 once fix is ready to be merged.
Project Member

Comment 15 by bugdroid1@chromium.org, Mar 21 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8fe039154b1c022e97ea9a7bbb1169b23ca483f7

commit 8fe039154b1c022e97ea9a7bbb1169b23ca483f7
Author: Reza.Zakerinasab <zakerinasab@chromium.org>
Date: Wed Mar 21 19:48:32 2018

Enforce early release of storage image in CanvasAsyncBlobCreator dtor

TBR=junov@chromium.org

Bug:  823260 
Change-Id: I9851d6ff38c36c16edbdfa1cb715957e8e6e3eed
Reviewed-on: https://chromium-review.googlesource.com/973554
Reviewed-by: Mohammad Reza Zakerinasab <zakerinasab@chromium.org>
Commit-Queue: Mohammad Reza Zakerinasab <zakerinasab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544807}
[modify] https://crrev.com/8fe039154b1c022e97ea9a7bbb1169b23ca483f7/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp

Labels: Merge-Request-66
Labels: TE-Verified-M67 TE-Verified-67.0.3378.0
Able to reproduce the issue on reported version hence verifying the fix on latest canary 67.0.3378.0 using Ubuntu 14.04, Mac 10.13.3 and Windows 10.

Now there is no increase in memory footprint value after 10 minutes. Hence adding verified labels. Attaching screenshot for reference.

Thanks!
823260_67.0.3378.0.png
148 KB View Download
Status: Fixed (was: Assigned)
Project Member

Comment 19 by sheriffbot@chromium.org, Mar 22 2018

Labels: -Merge-Request-66 Merge-Review-66 Hotlist-Merge-Review
This bug requires manual review: M66 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), josafat@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Merge-Review-66 Merge-Approved-66
Approving merge to M66. Branch:3359
Project Member

Comment 22 by bugdroid1@chromium.org, Mar 23 2018

Labels: -merge-approved-66 merge-merged-3359
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e98da69c6777ddfcb9306bf28445f443a98563e7

commit e98da69c6777ddfcb9306bf28445f443a98563e7
Author: Reza.Zakerinasab <zakerinasab@chromium.org>
Date: Fri Mar 23 14:06:11 2018

Enforce early release of storage image in CanvasAsyncBlobCreator dtor

TBR=junov@chromium.org, zakerinasab@chromium.org

(cherry picked from commit 8fe039154b1c022e97ea9a7bbb1169b23ca483f7)

Bug:  823260 
Change-Id: I9851d6ff38c36c16edbdfa1cb715957e8e6e3eed
Reviewed-on: https://chromium-review.googlesource.com/973554
Reviewed-by: Mohammad Reza Zakerinasab <zakerinasab@chromium.org>
Commit-Queue: Mohammad Reza Zakerinasab <zakerinasab@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#544807}
Reviewed-on: https://chromium-review.googlesource.com/977889
Cr-Commit-Position: refs/branch-heads/3359@{#395}
Cr-Branched-From: 66afc5e5d10127546cc4b98b9117aff588b5e66b-refs/heads/master@{#540276}
[modify] https://crrev.com/e98da69c6777ddfcb9306bf28445f443a98563e7/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp

Labels: TE-Verified-66.0.3359.66 TE-Verified-M66
Able to reproduce the issue on reported version hence verifying the fix on latest beta 66.0.3359.66 using Ubuntu 14.04, Mac 10.13.3 and Windows 10.

Now there is no increase in memory footprint value after 10 minutes. Hence adding verified labels. Attaching screenshot for reference.

Thanks!
823260_66.0.3359.66.png
97.6 KB View Download

Sign in to add a comment