OffscreenCanvas Codepen demo sometimes completely freezes the tab for 10-15 seconds
Categories
(Core :: Graphics: Canvas2D, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox124 | --- | unaffected |
firefox125 | --- | wontfix |
firefox126 | --- | fixed |
firefox127 | --- | fixed |
People
(Reporter: mayankleoboy1, Assigned: aosmond)
References
(Regressed 1 open bug, Regression, )
Details
(Keywords: regression)
Attachments
(3 files)
5.86 KB,
text/html
|
Details | |
42.39 KB,
text/plain
|
Details | |
48 bytes,
text/x-phabricator-request
|
dmeehan
:
approval-mozilla-beta+
|
Details | Review |
This may be easier to repro with gpu-canvas enabled.
- Download the attached demo and save it to your local machine (original demo at https://codepen.io/rroyerrivard/pen/jOwBLbB may not work)
1.5 Open the testcase on your machine. . - Allow the page access to your camera permanently
- Click on the first button "Start Worker"
- Switch to another tab for 10-15 seconds
- Switch back to the demo tab and wait for 3-4 seconds
- Rapidly click on the second button "Add Canvas to page" 10-15 times
If it doesnt repro, close the browser and open the testcase again.
AR: The page freezez
ER: Not so
Profile with all threads, IPC and File IO: https://share.firefox.dev/3VIWuxH
Profile with gfx preset logging: https://share.firefox.dev/4cBrBAX
Profile with webrtc preset logging: https://share.firefox.dev/3x8VxUU
Can only repro about 50% of the time so cannot find a regression range. Not even sure if this is a canvas or webrtc bug or something else.
Reporter | ||
Comment 1•7 months ago
|
||
Reporter | ||
Comment 2•7 months ago
|
||
Reporter | ||
Comment 3•7 months ago
•
|
||
FWIW, I also got drive crash/reset on two occasions while testing this.
Here is a crash report generated on force crashing : https://crash-stats.mozilla.org/report/index/1c14fcbe-ef0a-432a-9966-423d50240329
gfx-log:
(#0) Error Killing GPU process due to IPC reply timeout
(#1) Error Failed as lost WebRenderBridgeChild.
(#2) Error Fallback WR to SW-WR + D3D11
(#3) Error Fallback SW-WR + D3D11 to SW-WR
(#4) Error CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#5) Error CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#6) Error CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#7) CP+[GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#8) CP+[GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#9) CP+[GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#10) CP+[GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#11) CP+[GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#12) CP+[GFX1-]: Failed as lost WebRenderBridgeChild.
(#13) CP+[GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
Reporter | ||
Comment 4•7 months ago
•
|
||
Alternate STR2:
Download the attached demo and save it to your local machine
Open the testcase on your machine. Allow the page access to your camera permanently
Press-and-hold the "f5" key on your keyboard so that the the page reloads rextremely rapidly. Let this continue for 4-5 seconds.
Click on the first button "Start Worker"
Rapidly click on the second button "Add Canvas to page" 10-15 times
Alternate STR3:
Open the testcase from your local machine
Click on start the worker and click on add a canvas
Start rapidly resizing the browser window diagonally. Keep on resizing till you notice that the video has frozen.
Assignee | ||
Comment 5•7 months ago
|
||
Does this still happen now that bug 1887729 landed?
Assignee | ||
Comment 6•7 months ago
|
||
Note that the codepen doesn't need to use oncontextlost/restored to benefit from the improvement where we avoid the freezing after a GPU process crash.
Reporter | ||
Comment 7•7 months ago
|
||
(In reply to Andrew Osmond [:aosmond] (he/him) from comment #5)
Does this still happen now that bug 1887729 landed?
I have the latest Nightly from this: https://hg.mozilla.org/mozilla-central/rev/4120fb3d12f57159ca2e6809f555312e00adda5d and I can still repro, I just tried the STR3 and the tab froze.
(bug 1887729 appears to have landed about 2 nightlies prior)
Comment 8•7 months ago
|
||
I can reproduce on macOS using STR in comment 0, and I get the hang the very first time I click "Add canvas to page". In fact, the highlight on the button is never cleared. I will attempt a mozregression.
Comment 9•7 months ago
|
||
Weirdly, mozregression points to Bug 1806400. I'll do another mozregression to double-check.
Comment 10•7 months ago
|
||
A more careful mozregression indicates Bug 1855742, which makes a lot more sense.
Comment 11•7 months ago
|
||
Set release status flags based on info from the regressing bug 1855742
Assignee | ||
Comment 12•7 months ago
|
||
I am speculating that this is caused by us clearing out the tab cache (i.e. the ClearCachedResources path), we end up using a stale remote texture ID somehow, and block in the RemoteTextureMap code:
https://searchfox.org/mozilla-central/rev/c09764753ea40725eb50decad2c51edecbd33308/gfx/layers/RemoteTextureMap.cpp#988
Assignee | ||
Comment 13•7 months ago
|
||
Actually this is related to capture stream. The test case is a bit contrived in that it feeds the capture stream back into the canvas.
Assignee | ||
Comment 14•7 months ago
|
||
This behaviour has yet to be defined by the spec and/or WPT, see:
https://github.com/w3c/mediacapture-fromelement/issues/65
https://github.com/w3c/mediacapture-extensions/pull/26
https://github.com/web-platform-tests/wpt/issues/21102
Updated•7 months ago
|
Comment 15•7 months ago
|
||
Set release status flags based on info from the regressing bug 1855742
Comment 16•7 months ago
|
||
Comment 17•7 months ago
|
||
Was the demo in comment 0 reduced from a live site or...? Would be nice to better understand how the testcase was found/created to assess the real-world impact of this bug.
Reporter | ||
Comment 18•7 months ago
|
||
(In reply to Ryan VanderMeulen [:RyanVM] from comment #17)
Was the demo in comment 0 reduced from a live site or...? Would be nice to better understand how the testcase was found/created to assess the real-world impact of this bug.
I just search for "offscreen-canvas" on Codepen, and test all the results that come up.
I am not the author of the demo in comment 0, and I dont know if this is related to any real site or not.
Updated•7 months ago
|
Assignee | ||
Comment 19•7 months ago
|
||
My understanding is that use of captureStream is fairly niche.
Assignee | ||
Comment 20•7 months ago
|
||
Comment on attachment 9396923 [details]
Bug 1888634 - Disallow captureStream with canvas transferred to DOM worker.
Beta/Release Uplift Approval Request
- User impact if declined: Sites using captureStream with canvases transferred to a DOM worker will encounter bugs. Should be uncommon. Behaviour not defined by spec, although there is meeting notes indicating this will change in the future.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Just disables captureStream from working in conjunction with a DOM worker transferred canvas. This configuration should be rare as its behaviour is not specified by the spec yet.
- String changes made/needed:
- Is Android affected?: Yes
Comment 21•7 months ago
|
||
bugherder |
Comment 22•7 months ago
|
||
Comment on attachment 9396923 [details]
Bug 1888634 - Disallow captureStream with canvas transferred to DOM worker.
Approved for 126.0b3
Updated•7 months ago
|
Description
•