Closed Bug 1905417 Opened 1 year ago Closed 1 year ago

Assertion failure: nsContentUtils::IsSafeToRunScript(), at /builds/worker/checkouts/gecko/docshell/base/nsDocShell.cpp:1559 via WindowsUIUtils::UpdateInTabletMode

Categories

(Core :: Widget: Win32, defect, P2)

defect

Tracking

()

RESOLVED FIXED
132 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- wontfix
firefox130 --- wontfix
firefox131 --- wontfix
firefox132 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: rkraesig)

References

Details

(Keywords: assertion, intermittent-failure)

Attachments

(1 file)

Filed by: rob [at] robwu.nl
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=464445182&repo=try
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/QrE3mqwCTLeGVId7423w5w/runs/0/artifacts/public/logs/live_backing.log


To reproduce, run this test on a debug build on Windows:

`./mach test toolkit/components/extensions/test/xpcshell/test_ext_theme_startupData.js`

The test fails consistently on try.

What the xpcshell test does is updating a theme, then loading a windowless browser to verify that the theme was applied correctly.

Stack trace with links to relevant code:

INFO - xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_theme_startupData.js | Starting test_dynamic_theme_startupData
...
INFO - "Extension attached"
INFO - PID 9516 | [9516] Assertion failure: nsContentUtils::IsSafeToRunScript(), at /builds/worker/checkouts/gecko/docshell/base/nsDocShell.cpp:1559
INFO - Initializing stack-fixing for the first stack frame, this may take a while...
INFO - PID 9516 | #01: nsDocShell::SetCurrentURI(nsIURI*, nsIRequest*, bool, bool, unsigned int) [docshell/base/nsDocShell.cpp:1559]
INFO - PID 9516 | #02: nsDocShell::CreateAboutBlankDocumentViewer(nsIPrincipal*, nsIPrincipal*, nsIContentSecurityPolicy*, nsIURI*, bool, mozilla::Maybe<nsILoadInfo::CrossOriginEmbedderPolicy> const&, bool, bool, mozilla::dom::WindowGlobalChild*) [docshell/base/nsDocShell.cpp:6604]
INFO - PID 9516 | #03: nsAppShellService::JustCreateTopWindow(nsIAppWindow*, nsIURI*, unsigned int, int, int, bool, mozilla::AppWindow**) [xpfe/appshell/nsAppShellService.cpp:651]
INFO - PID 9516 | #04: nsAppShellService::CreateHiddenWindow() [xpfe/appshell/nsAppShellService.cpp:139]
INFO - PID 9516 | #05: nsAppShellService::GetHiddenDOMWindow(mozIDOMWindowProxy**) [xpfe/appshell/nsAppShellService.cpp:699]
INFO - PID 9516 | #06: WindowsUIUtils::UpdateInTabletMode() [widget/windows/WindowsUIUtils.cpp:564]
INFO - PID 9516 | #07: WindowsUIUtils::GetInTabletMode() [[https://searchfox.org/mozilla-central/rev/5b037d9c6ecdb0729f39ad519f0b867d80a92aad/widget/windows/WindowsUIUtils.cpp#288)]
INFO - PID 9516 | #08: mozilla::widget::WinUtils::GetPrimaryPointerCapabilities() [widget/windows/WinUtils.cpp:1607]
INFO - PID 9516 | #09: nsLookAndFeel::NativeGetInt(mozilla::LookAndFeel::IntID, int&) [widget/windows/nsLookAndFeel.cpp:572]
INFO - PID 9516 | #10: mozilla::widget::RemoteLookAndFeel::ExtractData() [widget/RemoteLookAndFeel.cpp:222]
INFO - PID 9516 | #11: mozilla::dom::ContentParent::BroadcastThemeUpdate(mozilla::widget::ThemeChangeKind) [dom/ipc/ContentParent.cpp:1533]
INFO - PID 9516 | #12: mozilla::LookAndFeel::DoHandleGlobalThemeChange() [widget/nsXPLookAndFeel.cpp:1266]
INFO - PID 9516 | #13: nsPresContext::AttachPresShell(mozilla::PresShell*) [layout/base/nsPresContext.cpp:880]
INFO - PID 9516 | #14: mozilla::PresShell::Init(nsPresContext*, nsViewManager*) [layout/base/PresShell.cpp:907]
INFO - PID 9516 | #15: mozilla::dom::Document::CreatePresShell(nsPresContext*, nsViewManager*) [dom/base/Document.cpp:7024]
INFO - PID 9516 | #16: nsDocumentViewer::InitPresentationStuff(bool) [layout/base/nsDocumentViewer.cpp:704]
INFO - PID 9516 | #17: nsDocumentViewer::InitInternal(nsIWidget*, nsISupports*, mozilla::dom::WindowGlobalChild*, mozilla::gfx::IntRectTyped<mozilla::gfx::UnknownUnits> const&, bool, bool, bool) [layout/base/nsDocumentViewer.cpp:912]
INFO - PID 9516 | #18: nsDocumentViewer::Init(nsIWidget*, mozilla::gfx::IntRectTyped<mozilla::gfx::UnknownUnits> const&, mozilla::dom::WindowGlobalChild*) [layout/base/nsDocumentViewer.cpp:677]
INFO - PID 9516 | #19: nsDocShell::SetupNewViewer(nsIDocumentViewer*, mozilla::dom::WindowGlobalChild*) [docshell/base/nsDocShell.cpp:7995]
INFO - PID 9516 | #20: nsDocShell::Embed(nsIDocumentViewer*, mozilla::dom::WindowGlobalChild*, bool, bool, nsIRequest*, nsIURI*) [docshell/base/nsDocShell.cpp:5502]
INFO - PID 9516 | #21: nsDocShell::CreateAboutBlankDocumentViewer(nsIPrincipal*, nsIPrincipal*, nsIContentSecurityPolicy*, nsIURI*, bool, mozilla::Maybe<nsILoadInfo::CrossOriginEmbedderPolicy> const&, bool, bool, mozilla::dom::WindowGlobalChild*) [docshell/base/nsDocShell.cpp:6598]
INFO - PID 9516 | #22: nsDocShell::EnsureDocumentViewer() [docshell/base/nsDocShell.cpp:6403]
INFO - PID 9516 | #23: nsDocShell::GetDocument() [docshell/base/nsDocShell.cpp:3010]
INFO - PID 9516 | #24: nsDocShell::InternalLoad(nsDocShellLoadState*, mozilla::Maybe<unsigned int>) [docshell/base/nsDocShell.cpp:9407]
INFO - PID 9516 | #25: nsDocShell::LoadURI(nsDocShellLoadState*, bool, bool) [docshell/base/nsDocShell.cpp:851]
INFO - PID 9516 | #26: nsDocShell::LoadURI(nsIURI*, mozilla::dom::LoadURIOptions const&) [docshell/base/nsDocShell.cpp:3195]
INFO - PID 9516 | #27: nsDocShell::LoadURIFromScript(nsIURI*, JS::Handle<JS::Value>, JSContext*) [docshell/base/nsDocShell.cpp:3207]
INFO - PID 9516 | #28: XPTC__InvokebyIndex() [/builds/worker/workspace/obj-build/toolkit/library/build/Z:/builds/worker/checkouts/gecko/xpcom/reflect/xptcall/md/win32/xptcinvoke_asm_x86_64.asm:99]
INFO - PID 9516 | #29: CallMethodHelper::Call() [js/xpconnect/src/XPCWrappedNative.cpp:1174]
INFO - PID 9516 | #30: XPCWrappedNative::CallMethod(XPCCallContext&, XPCWrappedNative::CallMode) [js/xpconnect/src/XPCWrappedNative.cpp:1120]
INFO - PID 9516 | #31: XPC_WN_CallMethod(JSContext*, unsigned int, JS::Value*) [js/xpconnect/src/XPCWrappedNativeJSOps.cpp:966]
INFO - PID 9516 | #32: CallJSNative(JSContext*, bool ()(JSContext, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) [js/src/vm/Interpreter.cpp:487]
INFO - PID 9516 | #33: js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) [js/src/vm/Interpreter.cpp:581]
INFO - PID 9516 | #34: js::Interpret(JSContext*, js::RunState&) [js/src/vm/Interpreter.cpp:3291]
INFO - PID 9516 | #35: js::RunScript(JSContext*, js::RunState&) [js/src/vm/Interpreter.cpp:459]
INFO - PID 9516 | #36: js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) [js/src/vm/Interpreter.cpp:613]
INFO - PID 9516 | #37: js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICFallbackStub*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) [js/src/jit/BaselineIC.cpp:1670]
INFO - PID 9516 | #38: ??? (???:???)
INFO - <<<<<<<
WARNING - PROCESS-CRASH | MOZ_ASSERT(nsContentUtils::IsSafeToRunScript()) [@ nsDocShell::SetCurrentURI] | xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_theme_startupData.js
INFO - Process type: main
INFO - Process pid: 9516
INFO - Mozilla crash reason: MOZ_ASSERT(nsContentUtils::IsSafeToRunScript())

This is not an intermittent failure, but a permafail. I disabled the test on Windows + debug in https://phabricator.services.mozilla.com/D214540?vs=882006&id=884012#toc because the test consistently fails on try.

The test utility was added for bug 1830136 in https://phabricator.services.mozilla.com/D214540?id=884012#C8091270NL19

but interestingly the failure is in the test_dynamic_theme_startupData test that was added later in the patch stack (for bug 1830144), called from https://phabricator.services.mozilla.com/D214832#C8075557NL151

Severity: S4 → --
Priority: P5 → --
See Also: → 1830144

(In reply to Rob Wu [:robwu] from comment #1)

What the xpcshell test does is updating a theme, then loading a windowless browser to verify that the theme was applied correctly.

This has probably not been fixed by bug 1914559, but at the very least it should present differently now. An actual fix is likely to require the changes described in bug 1914612 comment 1.

Severity: -- → S3
Priority: -- → P2

As of bug 1914559, WindowsUIUtils::UpdateInTabletMode no longer
attempts to launch the hidden window. Doing so was part of the reason a
test had begun failing; it can now be reenabled.

Assignee: nobody → rkraesig
Status: NEW → ASSIGNED

(In reply to Ray Kraesig [:rkraesig] from comment #4)

This has probably not been fixed by bug 1914559, but at the very least it should present differently now. An actual fix is likely to require the changes described in bug 1914612 comment 1.

I am pleased to learn that I seem to have been wrong — the test appears to pass now: https://treeherder.mozilla.org/jobs?repo=try&revision=1af6692ce62ea682b0a1e5b95eb0314d425dff18

Pushed by rkraesig@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1ec6890b6704 [1/1] Reenable formerly-failing test r=robwu
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 132 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: