Closed Bug 1870872 Opened 2 years ago Closed 2 years ago

Hang on offscreen canvas demo with ublock origin installed

Categories

(Core :: Graphics: Canvas2D, defect, P3)

defect

Tracking

()

RESOLVED FIXED
123 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox121 --- unaffected
firefox122 --- unaffected
firefox123 --- fixed

People

(Reporter: mayankleoboy1, Assigned: aosmond)

References

(Regression)

Details

(Keywords: crash, regression)

Crash Data

Attachments

(2 files, 1 external file)

This is a weird bug, so bear with me.
Create new profile
Install ublock origin from here : https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/
Let it download lists etc for 30 seconds or so
Go to : https://web.dev/articles/offscreen-canvas
Click on the ublock icon on the toolbar and disable ublock for the demo tab (i.e. click on the big "powr off" button"). Click on the reload button . The page will reload
Now click on the icon again ->enable ublock for the demo tab->Click to reload the page. The page will start to reload.
Sometimes during this reload, the browser will hang (some IPC timeout).

AR: Browser will hang, gfx-log says there is some IPC timeout.
ERL Not so

Edit: My STR seem to be a roundabout way of adding some IPC traffic that causes timeouts in Offcreencanvas. I guess easier steps/testcase can be created without using uBO.

GP+[GFX1-]: GFX: D3D11 lock failed 0x887a0001
(#14) CP+[GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#15) CP+[GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#16) CP+[GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#17) CP+[GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#18) CP+[GFX1]: Attempt to render into a Canvas2d after shutdown.
(#19) CP+[GFX1]: Attempt to render into a Canvas2d after shutdown.
(#20) CP+[GFX1]: Attempt to render into a Canvas2d after shutdown.
(#21) CP+[GFX1-]: IPC Channel is already torn down unexpectedly
(#22) CP+[GFX1-]: IPC Channel is already torn down unexpectedly
(#23) CP+[GFX1-]: IPC Channel is already torn down unexpectedly
(#24) CP+[GFX1]: Attempt to render into a Canvas2d after shutdown.
(#25) CP+[GFX1]: Attempt to render into a Canvas2d after shutdown.
(#26) CP+[GFX1]: Attempt to render into a Canvas2d after shutdown.
(#27) CP+[GFX1]: Attempt to render into a Canvas2d after shutdown.
(#28) CP+[GFX1]: Attempt to render into a Canvas2d after shutdown.

And while I was trying to create this video, the browser crashed while the page was reloading with ublock disabled.
If this doesnt crash for you, do try to enable ublock and reload the page.

Attached file about:support —

:aosmond, since you are the author of the regressor, bug 1795296, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(aosmond)

GP+[GFX1-]: GFX: D3D11 lock failed 0x887a0001
(#35) CP+[GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#36) CP+[GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#37) Error GPU process is being launched whilst app is in background
(#38) Error CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#39) Error CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#40) Error CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#41) Error CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#42) Error CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#43) CP+[GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#44) CP+[GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#45) CP+[GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#46) CP+[GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#47) CP+[GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#48) CP+[GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown
(#49) CP+[GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown

From https://learn.microsoft.com/en-us/windows/win32/direct3ddxgi/dxgi-error:
0x887a0001 maps to DXGI_ERROR_INVALID_CALL

The application provided invalid parameter data; this must be debugged and fixed before the application is released.

I think this has produced some crash reports.

Crash Signature: [@ mozilla::layers::CanvasTranslator::CreateDrawTarget ]
Keywords: crash

So we hit this assert which assumes we cannot call CanvasTranslator::CreateDrawTarget without having called CanvasTranslator::SetNextTextureId:
https://searchfox.org/mozilla-central/rev/008ce958417fd724e02748740d669aafd49debb3/gfx/layers/ipc/CanvasTranslator.cpp#747

We should get a draw target via RecordedTextureData::Lock:
https://searchfox.org/mozilla-central/rev/008ce958417fd724e02748740d669aafd49debb3/gfx/layers/client/TextureRecorded.cpp#146

and hence the events should come in together but in this case they seem not to.

Actually this is probably unrelated to the crash.

Severity: -- → S2
Priority: -- → P2

I think I overclassified this one. S3 for being a tricky-to-reproduce hang and not a crash.

Severity: S2 → S3
Priority: P2 → P3

This patch merges RecordedNextTextureId and RecordedDrawTargetCreation
into a single event RecordedCanvasDrawTargetCreation for recording
canvases. This should ensure that we do not somehow miss providing the
relevant remote texture IDs. It also now diagnostic asserts that canvas
recording/playback do not use the original RecordedDrawTargetCreation
event.

Assignee: nobody → aosmond
Status: NEW → ASSIGNED
Pushed by aosmond@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7801925e6b44 Create dedicated recording event for canvas DrawTarget creation. r=gfx-reviewers,lsalzman
Flags: needinfo?(aosmond)

Backed out as requested by aosmond

Backout link

Flags: needinfo?(aosmond)
Pushed by aosmond@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/74cd2a02db33 Create dedicated recording event for canvas DrawTarget creation. r=gfx-reviewers,lsalzman
Flags: needinfo?(aosmond)
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch
See Also: → 1874449
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: