WebGL crash: [mozilla::WebGLContext::AssertCachedGlobalState()]

RESOLVED FIXED in Firefox 55

Status

()

Core
Canvas: WebGL
--
critical
RESOLVED FIXED
a year ago
11 months ago

People

(Reporter: posidron, Assigned: Lenzak)

Tracking

(Blocks: 1 bug, {crash, testcase})

Trunk
mozilla56
crash, testcase
Points:
---

Firefox Tracking Flags

(firefox-esr52 wontfix, firefox54 wontfix, firefox55 fixed, firefox56 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(2 attachments)

(Reporter)

Description

a year ago
Created attachment 8876413 [details]
testcase-webgl-1.html

Similar to bug https://bugzilla.mozilla.org/show_bug.cgi?id=1349055 but with different stack.

Assertion failure: gl->fIsEnabled(0x0B90) == mStencilTestEnabled, at /Users/posidron/.dev/repos/mozilla/mozilla-inbound/dom/canvas/WebGLContextUtils.cpp:820
#01: mozilla::WebGLContext::SetDimensions(int, int)[/Users/posidron/.dev/repos/mozilla/mozilla-inbound/obj/ff-asan-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x5d03398]
#02: mozilla::WebGLContext::UpdateContextLossStatus()[/Users/posidron/.dev/repos/mozilla/mozilla-inbound/obj/ff-asan-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x5d0ad8f]
#03: mozilla::UpdateContextLossStatusTask::Run()[/Users/posidron/.dev/repos/mozilla/mozilla-inbound/obj/ff-asan-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x5d1b51e]
#04: nsThread::ProcessNextEvent(bool, bool*)[/Users/posidron/.dev/repos/mozilla/mozilla-inbound/obj/ff-asan-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x319954]
#05: NS_ProcessPendingEvents(nsIThread*, unsigned int)[/Users/posidron/.dev/repos/mozilla/mozilla-inbound/obj/ff-asan-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x311555]
#06: nsBaseAppShell::NativeEventCallback()[/Users/posidron/.dev/repos/mozilla/mozilla-inbound/obj/ff-asan-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x7f26563]
#07: nsAppShell::ProcessGeckoEvents(void*)[/Users/posidron/.dev/repos/mozilla/mozilla-inbound/obj/ff-asan-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x8039840]
#08: __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__[/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0xa7321]
#09: __CFRunLoopDoSources0[/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x8821d]
#10: __CFRunLoopRun[/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x87716]
#11: CFRunLoopRunSpecific[/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x87114]
#12: RunCurrentEventLoopInMode[/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox +0x30ebc]
#13: ReceiveNextEventCommon[/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox +0x30cf1]
#14: _BlockUntilNextEventMatchingListInModeWithFilter[/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox +0x30b26]
#15: _DPSNextEvent[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit +0x46a54]
#16: -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:][/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit +0x7c27ee]
#17: -[GeckoNSApplication nextEventMatchingMask:untilDate:inMode:dequeue:][/Users/posidron/.dev/repos/mozilla/mozilla-inbound/obj/ff-asan-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x8037a45]
#18: -[NSApplication run][/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit +0x3b3db]
#19: nsAppShell::Run()[/Users/posidron/.dev/repos/mozilla/mozilla-inbound/obj/ff-asan-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x803a961]
#20: nsAppStartup::Run()[/Users/posidron/.dev/repos/mozilla/mozilla-inbound/obj/ff-asan-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0xbe1523d]
#21: XREMain::XRE_mainRun()[/Users/posidron/.dev/repos/mozilla/mozilla-inbound/obj/ff-asan-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0xc03e4a1]
#22: XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&)[/Users/posidron/.dev/repos/mozilla/mozilla-inbound/obj/ff-asan-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0xc041a4a]
#23: XRE_main(int, char**, mozilla::BootstrapConfig const&)[/Users/posidron/.dev/repos/mozilla/mozilla-inbound/obj/ff-asan-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0xc043368]
#24: main[/Users/posidron/.dev/repos/mozilla/mozilla-inbound/obj/ff-asan-debug/dist/NightlyDebug.app/Contents/MacOS/firefox +0x21d1]
ASAN:DEADLYSIGNAL
Michael, please take a look as well.
Assignee: nobody → cleu
Comment hidden (mozreview-request)
(Assignee)

Comment 3

a year ago
We will discard our GL context in the webgl context when we perform a simulated lose context, and recreate a gl context when we simulated restore context, which is what this testcase do.

We did not set StencilTest flag when we are reinitializing the gl context, leading to a internal state inconsistency and triggering the assert.

This patch makes InitAndValidateGL also reset mStencilTestEnabled, so we can make the state consistent even playing with force lose/restore context.

Comment 4

11 months ago
mozreview-review
Comment on attachment 8877475 [details]
Bug 1371940 - Reset mStencilTestEnabled when initializing openGL context

https://reviewboard.mozilla.org/r/148922/#review153670
Attachment #8877475 - Flags: review?(jgilbert) → review+
(Assignee)

Updated

11 months ago
Keywords: checkin-needed

Comment 6

11 months ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/bc85129e5c3e
Reset mStencilTestEnabled when initializing openGL context r=jgilbert
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/bc85129e5c3e
Status: NEW → RESOLVED
Last Resolved: 11 months ago
status-firefox56: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Is this something that can ride the 56 train or should we consider backporting it to 55 as well?
status-firefox55: --- → affected
Flags: needinfo?(cleu)
(Assignee)

Comment 9

11 months ago
Yes, I think it would be beneficial for our WebGL stability, and have almost zero risk to uplift.
Flags: needinfo?(cleu)
(Assignee)

Comment 10

11 months ago
Comment on attachment 8877475 [details]
Bug 1371940 - Reset mStencilTestEnabled when initializing openGL context

Approval Request Comment
[Feature/Bug causing the regression]: WebGL Crash under some special testcase
[User impact if declined]: Potential WebGL stability issue
[Is this code covered by automated tests?]: No
[Has the fix been verified in Nightly?]: 
[Needs manual test from QE? If yes, steps to reproduce]:
[List of other uplifts needed for the feature/fix]: N/A
[Is the change risky?]: Not risky
[Why is the change risky/not risky?]: This patch just assign a default value when a context is initialized
[String changes made/needed]: No
Attachment #8877475 - Flags: approval-mozilla-beta?
Comment on attachment 8877475 [details]
Bug 1371940 - Reset mStencilTestEnabled when initializing openGL context

webgl fix, let's get this in 55.0b3
Attachment #8877475 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Comment 12

11 months ago
bugherderuplift
https://hg.mozilla.org/releases/mozilla-beta/rev/4c87c5c7c17b
status-firefox55: affected → fixed
status-firefox54: --- → wontfix
status-firefox-esr52: --- → wontfix
You need to log in before you can comment on or make changes to this bug.