Closed Bug 1371940 Opened 9 years ago Closed 8 years ago

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

Categories

(Core :: Graphics: CanvasWebGL, defect)

defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox-esr52 --- wontfix
firefox54 --- wontfix
firefox55 --- fixed
firefox56 --- fixed

People

(Reporter: posidron, Assigned: cleu)

Details

(Keywords: crash, testcase)

Attachments

(2 files)

Attached file 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
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 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+
Keywords: checkin-needed
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/autoland/rev/bc85129e5c3e Reset mStencilTestEnabled when initializing openGL context r=jgilbert
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Is this something that can ride the 56 train or should we consider backporting it to 55 as well?
Flags: needinfo?(cleu)
Yes, I think it would be beneficial for our WebGL stability, and have almost zero risk to uplift.
Flags: needinfo?(cleu)
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+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: