Crash in [@ mozilla::gl::GLContextEGL::Cast]
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr153 | --- | fixed |
| firefox157 | --- | wontfix |
| firefox158 | --- | wontfix |
| firefox159 | --- | fixed |
People
(Reporter: clouseau-bot, Assigned: lsalzman)
References
(Blocks 1 open bug)
Details
(Keywords: crash)
Crash Data
Attachments
(2 external files)
Crash report: https://crash-stats.mozilla.org/report/index/1de29596-c757-4a20-af2f-7163e0261005
Crash Reason:
EXCEPTION_ACCESS_VIOLATION_READ at 0x0000000000000000
Top 10 frames:
0 xul.dll mozilla::gl::SharedSurface_ANGLEShareHandle::LockProdImpl() gfx/gl/SharedSurfaceANGLE.cpp:188
1 xul.dll mozilla::layers::CanvasTranslator::ResolveExternalSnapshot(unsigned long long, m... gfx/layers/ipc/CanvasTranslator.cpp:1883
2 xul.dll mozilla::layers::RecordedResolveExternalSnapshot::PlayCanvasEvent(mozilla::layer... gfx/layers/RecordedCanvasEventImpl.h:659
3 xul.dll mozilla::layers::CanvasTranslator::HandleExtensionEvent(int) gfx/layers/ipc/CanvasTranslator.cpp:973
4 xul.dll mozilla::layers::CanvasTranslator::TranslateRecording() gfx/layers/ipc/CanvasTranslator.cpp:804
5 xul.dll mozilla::layers::CanvasTranslator::HandleCanvasTranslatorEvents() gfx/layers/ipc/CanvasTranslator.cpp:893
6 xul.dll mozilla::detail::RunnableMethodImpl<mozilla::net::BackgroundFileSaverStreamListe... xpcom/threads/nsThreadUtils.h:1124
7 xul.dll NS_ProcessNextEvent(nsIThread*, bool) xpcom/threads/nsThreadUtils.cpp:471
8 xul.dll mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) ipc/glue/MessagePump.cpp:297
9 xul.dll MessageLoop::RunHandler() ipc/chromium/src/base/message_loop.cc:364
There are 2 crashes (from 1 installation) in nightly 159 with buildid 20261005080154.
In the last 30 days, Firefox has 13 crashes (from 6 installations) on nightly and 6 crashes (from 6 installations) on release with this signature.
This signature has been reported since build 20260315085700 (2026-03-15), 204 days before the build above.
This bug looks actionable because:
-
GLContextEGL::Castdereferences a nullGLContextinSharedSurface_ANGLEShareHandle::LockProdImplwhenCanvasTranslator::ResolveExternalSnapshotbegins reading a WebGL snapshot after its GL context is gone.CanvasTranslator::RecvSnapshotExternalCanvasstores a WebGL back-bufferSharedSurfaceinmExternalSnapshotsfor later resolution.- That surface's
mDesc.glis aWeakPtr<GLContext>, so it becomes null if the WebGL context's GL context is destroyed before the snapshot is resolved. - When the recorded
RecordedResolveExternalSnapshotevent plays,ResolveExternalSnapshotcallssnapshot.mSharedSurface->BeginRead()with no check that the producing context is still alive. BeginReadcallsLockProd, which callsLockProdImpl, which passesmDesc.gltoGLContextEGL::Cast; itsgl->GetContextType()virtual call reads the vtable through the null pointer.
The fault address 0x0 and the faulting instruction
mov rax, qword [rdi](a vtable load) fit a nullgl, and frames 0-1 show this exact inlined path on theCanvasRendererthread of the GPU process. The report does not record why the GL context was gone; context loss between snapshot and resolve is the likely trigger. Look first atResolveExternalSnapshot(CanvasTranslator.cpp:1882-1883): check thatmSharedSurface->mDesc.gl(orsnapshot.mWebgl's GL context) is still alive before callingBeginRead()/EndRead(), or makeLockProdImpltolerate a nullgl. -
The failing code comes from c11e7594c36d (gh) (bug 1972649) by :lsalzman.
Code references:
:lsalzman, can you have a look please?
Filed automatically by Clouseau, which analyses nightly crashes with an LLM. Nothing above was written or checked by a human. Please close it as INVALID if it is wrong — that is useful feedback, not a nuisance.
This is not an independent Mozilla discovery: the crash is known here only because somebody submitted the crash report linked at the top. If this duplicates an existing report, please resolve THIS bug as the duplicate and leave the credit with the earlier reporter.
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 1•1 month ago
|
||
The owning GL context of a SharedSurface is held in a WeakPtr, so it may
go away while the SharedSurface is still referenced. Make the IsValid()
check detect this.
Updated•1 month ago
|
Comment 3•1 month ago
|
||
| bugherder | ||
Comment 4•1 month ago
|
||
The patch landed in nightly and beta is affected.
:lsalzman, please make an uplift decision for beta:
- For beta, nominate the patch for beta uplift approval if the fix should be included in this release, or set
status-firefox158towontfixif the fix can wait for the next release.
See Requesting an Uplift for documentation on how to request an uplift.
For more information, please visit BugBot documentation.
Comment 5•1 month ago
|
||
ESR153 might be nice, but I don't think the volume is high enough to worry about a late uplift to 158.
| Assignee | ||
Updated•1 month ago
|
Comment 6•1 month ago
|
||
firefox-esr153 Uplift Approval Request
- User impact if declined/Reason for urgency: Potential crashing in WebGL
- Code covered by automated testing?: yes
- Fix verified in Nightly?: yes
- Needs manual QE testing?: no
- Steps to reproduce for manual QE testing:
- Risk associated with taking this patch: low
- Explanation of risk level: Adds a check to see if GL context is valid before using one of its shared surfaces
- String changes made/needed?: None
- Is Android affected?: yes
| Assignee | ||
Comment 7•1 month ago
|
||
The owning GL context of a SharedSurface is held in a WeakPtr, so it may
go away while the SharedSurface is still referenced. Make the IsValid()
check detect this.
Original Revision: https://phabricator.services.mozilla.com/D331421
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Description
•