Closed Bug 1746310 Opened 2 years ago Closed 2 years ago

High frequency Hit MOZ_CRASH(Resolving style on <menuitem id="menu_bookmarkThisPage" command="Browser:AddBookmarkAs" key="addBookmarkAsKb" data-l10n-id="menu-bookmark-edit" label="Edit This Bookmark"> (0x7f5482d4e040) without current styles: Element

Categories

(Core :: Layout, defect)

defect

Tracking

()

RESOLVED FIXED
97 Branch
Tracking Status
firefox97 --- fixed

People

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

References

Details

(Keywords: intermittent-failure, Whiteboard: [retriggered][stockwell disable-recommended])

Crash Data

Attachments

(2 files)

Filed by: nbeleuzu [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=361421911&repo=autoland
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/SO36H-YVR42UVXwvTZxzuw/runs/0/artifacts/public/logs/live_backing.log


[task 2021-12-16T00:09:28.366Z] 00:09:28     INFO - GECKO(9663) | Hit MOZ_CRASH(Resolving style on <menuitem id="menu_bookmarkThisPage" command="Browser:AddBookmarkAs" key="addBookmarkAsKb" data-l10n-id="menu-bookmark-edit" label="Edit This Bookmark"> (0x7f5482d4e040) without current styles: ElementData { styles: ElementStyles { primary: Some(Some(0x7f5480a0d420)), pseudos: EagerPseudoStyles(None) }, damage: GeckoRestyleDamage(nsChangeHint(0)), hint: (empty), flags: PRIMARY_STYLE_REUSED_VIA_RULE_NODE }) at servo/ports/geckolib/glue.rs:5627
[task 2021-12-16T00:09:28.370Z] 00:09:28     INFO - GECKO(9663) | #01: RustMozCrash [mozglue/static/rust/wrappers.cpp:18]
[task 2021-12-16T00:09:28.372Z] 00:09:28     INFO - GECKO(9663) | #02: mozglue_static::panic_hook [mozglue/static/rust/lib.rs:91]
[task 2021-12-16T00:09:28.374Z] 00:09:28     INFO - GECKO(9663) | #03: core::ops::function::Fn::call [git:github.com/rust-lang/rust:library/core/src/ops/function.rs:f1edd0429582dd29cccacaf50fd134b05593bd9c:70]
[task 2021-12-16T00:09:28.376Z] 00:09:28     INFO - GECKO(9663) | #04: std::panicking::rust_panic_with_hook [git:github.com/rust-lang/rust:library/std/src/panicking.rs:f1edd0429582dd29cccacaf50fd134b05593bd9c:631]
[task 2021-12-16T00:09:28.378Z] 00:09:28     INFO - GECKO(9663) | #05: std::panicking::begin_panic_handler::{{closure}} [git:github.com/rust-lang/rust:library/std/src/panicking.rs:f1edd0429582dd29cccacaf50fd134b05593bd9c:521]
[task 2021-12-16T00:09:28.380Z] 00:09:28     INFO - GECKO(9663) | #06: std::sys_common::backtrace::__rust_end_short_backtrace [git:github.com/rust-lang/rust:library/std/src/sys_common/backtrace.rs:f1edd0429582dd29cccacaf50fd134b05593bd9c:139]
[task 2021-12-16T00:09:28.393Z] 00:09:28     INFO - GECKO(9663) | #07: rust_begin_unwind [git:github.com/rust-lang/rust:library/std/src/panicking.rs:f1edd0429582dd29cccacaf50fd134b05593bd9c:517]
[task 2021-12-16T00:09:28.393Z] 00:09:28     INFO - GECKO(9663) | #08: std::panicking::begin_panic_fmt [git:github.com/rust-lang/rust:library/std/src/panicking.rs:f1edd0429582dd29cccacaf50fd134b05593bd9c:460]
[task 2021-12-16T00:09:28.395Z] 00:09:28     INFO - GECKO(9663) | #09: Servo_ResolveStyle [servo/ports/geckolib/glue.rs:5627]
[task 2021-12-16T00:09:28.397Z] 00:09:28     INFO - GECKO(9663) | #10: nsCSSFrameConstructor::ResolveComputedStyle(nsIContent*) [layout/base/nsCSSFrameConstructor.cpp:4652]
[task 2021-12-16T00:09:28.398Z] 00:09:28     INFO - GECKO(9663) | #11: nsCSSFrameConstructor::AddFrameConstructionItems(nsFrameConstructorState&, nsIContent*, bool, mozilla::ComputedStyle const&, nsCSSFrameConstructor::InsertionPoint const&, nsCSSFrameConstructor::FrameConstructionItemList&, mozilla::EnumSet<nsCSSFrameConstructor::ItemFlag, unsigned char>) [layout/base/nsCSSFrameConstructor.cpp:5165]
[task 2021-12-16T00:09:28.400Z] 00:09:28     INFO - GECKO(9663) | #12: nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState&, nsIContent*, mozilla::ComputedStyle*, nsContainerFrame*, bool, nsFrameList&, bool, nsIFrame*) [layout/base/nsCSSFrameConstructor.cpp:9663]
[task 2021-12-16T00:09:28.401Z] 00:09:28     INFO - GECKO(9663) | #13: nsCSSFrameConstructor::GenerateChildFrames(nsContainerFrame*) [layout/base/nsCSSFrameConstructor.cpp:11712]
[task 2021-12-16T00:09:28.403Z] 00:09:28     INFO - GECKO(9663) | #14: nsMenuPopupFrame::GenerateFrames() [layout/xul/nsMenuPopupFrame.cpp:1801]
[task 2021-12-16T00:09:28.404Z] 00:09:28     INFO - GECKO(9663) | #15: nsXULPopupManager::BeginShowingPopup(PendingPopup const&, bool, bool) [layout/xul/nsXULPopupManager.cpp:1566]
[task 2021-12-16T00:09:28.404Z] 00:09:28     INFO - GECKO(9663) | #16: mozilla::detail::RunnableFunction<nsXULPopupManager::ShowMenu(nsIContent*, bool, bool)::$_1>::Run() [xpcom/threads/nsThreadUtils.h:531]
[task 2021-12-16T00:09:28.405Z] 00:09:28     INFO - GECKO(9663) | #17: mozilla::RunnableTask::Run() [xpcom/threads/TaskController.cpp:469]
[task 2021-12-16T00:09:28.406Z] 00:09:28     INFO - GECKO(9663) | #18: mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) [xpcom/threads/TaskController.cpp:771]
[task 2021-12-16T00:09:28.407Z] 00:09:28     INFO - GECKO(9663) | #19: mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) [xpcom/threads/TaskController.cpp:607]
[task 2021-12-16T00:09:28.407Z] 00:09:28     INFO - GECKO(9663) | #20: mozilla::TaskController::ProcessPendingMTTask(bool) [xpcom/threads/TaskController.cpp:391]
[task 2021-12-16T00:09:28.408Z] 00:09:28     INFO - GECKO(9663) | #21: mozilla::detail::RunnableFunction<mozilla::TaskController::InitializeInternal()::$_0>::Run() [xpcom/threads/nsThreadUtils.h:532]
[task 2021-12-16T00:09:28.409Z] 00:09:28     INFO - GECKO(9663) | #22: nsThread::ProcessNextEvent(bool, bool*) [xpcom/threads/nsThread.cpp:1187]
[task 2021-12-16T00:09:28.409Z] 00:09:28     INFO - GECKO(9663) | #23: NS_ProcessNextEvent(nsIThread*, bool) [xpcom/threads/nsThreadUtils.cpp:467]
[task 2021-12-16T00:09:28.410Z] 00:09:28     INFO - GECKO(9663) | #24: mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) [ipc/glue/MessagePump.cpp:85]
[task 2021-12-16T00:09:28.411Z] 00:09:28     INFO - GECKO(9663) | #25: MessageLoop::RunInternal() [ipc/chromium/src/base/message_loop.cc:331]
[task 2021-12-16T00:09:28.411Z] 00:09:28     INFO - GECKO(9663) | #26: MessageLoop::Run() [ipc/chromium/src/base/message_loop.cc:307]
[task 2021-12-16T00:09:28.412Z] 00:09:28     INFO - GECKO(9663) | #27: nsBaseAppShell::Run() [widget/nsBaseAppShell.cpp:139]
[task 2021-12-16T00:09:28.413Z] 00:09:28     INFO - GECKO(9663) | #28: nsAppStartup::Run() [toolkit/components/startup/nsAppStartup.cpp:296]
[task 2021-12-16T00:09:28.414Z] 00:09:28     INFO - GECKO(9663) | #29: XREMain::XRE_mainRun() [toolkit/xre/nsAppRunner.cpp:5362]
[task 2021-12-16T00:09:28.415Z] 00:09:28     INFO - GECKO(9663) | #30: XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) [toolkit/xre/nsAppRunner.cpp:5547]
[task 2021-12-16T00:09:28.416Z] 00:09:28     INFO - GECKO(9663) | #31: XRE_main(int, char**, mozilla::BootstrapConfig const&) [toolkit/xre/nsAppRunner.cpp:5606]
[task 2021-12-16T00:09:28.419Z] 00:09:28     INFO - GECKO(9663) | #32: ??? [/builds/worker/workspace/build/application/firefox/firefox + 0x425d6]
[task 2021-12-16T00:09:28.420Z] 00:09:28     INFO - GECKO(9663) | #33: __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6 + 0x21b97]
[task 2021-12-16T00:09:28.421Z] 00:09:28     INFO - GECKO(9663) | #34: ??? [/builds/worker/workspace/build/application/firefox/firefox + 0x42149]
[task 2021-12-16T00:09:28.422Z] 00:09:28     INFO - GECKO(9663) | #35: ??? (???:???)
[task 2021-12-16T00:09:28.423Z] 00:09:28     INFO - GECKO(9663) | ExceptionHandler::GenerateDump cloned child 11917
[task 2021-12-16T00:09:28.424Z] 00:09:28     INFO - GECKO(9663) | ExceptionHandler::SendContinueSignalToChild sent continue signal to child
[task 2021-12-16T00:09:28.425Z] 00:09:28     INFO - GECKO(9663) | ExceptionHandler::WaitForContinueSignal waiting for continue signal...

Moving across to layout for investigation - I don't think we've made any changes to the UI part of this code, unless it was somewhere in CSS.

Note bug 1746309 is also related.

Severity: S4 → --
Component: Bookmarks & History → Layout
Priority: P5 → --
Product: Firefox → Core
See Also: → 1746309
Summary: Intermittent Hit MOZ_CRASH(Resolving style on <menuitem id="menu_bookmarkThisPage" command="Browser:AddBookmarkAs" key="addBookmarkAsKb" data-l10n-id="menu-bookmark-edit" label="Edit This Bookmark"> (0x7f5482d4e040) without current styles: ElementData → High frequency Hit MOZ_CRASH(Resolving style on <menuitem id="menu_bookmarkThisPage" command="Browser:AddBookmarkAs" key="addBookmarkAsKb" data-l10n-id="menu-bookmark-edit" label="Edit This Bookmark"> (0x7f5482d4e040) without current styles: Element

Daniel, could you investigate this frequent CI crash?

Flags: needinfo?(dholbert)

Adding Emilio to NI as per bug 1746309.

Flags: needinfo?(emilio)

Thanks! I couldn't repro the test failing in bug 1746309 but I could repro this one with enough patience, will look.

Assignee: nobody → emilio

The root of the problem is that nsMenuPopupFrame::GenerateFrames calls
into frame construction without making sure that styles are clean. So it
was pretty much working by chance, sorta.

I was going to fix this by adding the necessary flushes before calling
GenerateFrames, but on closer inspection, the front-end has effectively
already implemented this optimization by only generating the relevant
DOM on popupShowing:

https://searchfox.org/mozilla-central/rev/a11b63915bd7810a03635d733123448ab5bfcad3/toolkit/content/widgets/menupopup.js#87-91

And for menulists on creation:

https://searchfox.org/mozilla-central/rev/a11b63915bd7810a03635d733123448ab5bfcad3/toolkit/content/widgets/menupopup.js#151

After bug 1714846 we even destroy frames as needed, for panels.

So I think all of this complexity is unwarranted, and if we need some of
it we should implement it in the front-end like bug 1714846 did, and I'd
rather do this than flushing styles and so on.

Flags: needinfo?(emilio)
Flags: needinfo?(dholbert)
Crash Signature: [@ Servo_ResolveStyle] [@ geckoservo::glue::Servo_ResolveStyle(style::gecko_bindings::structs::root::mozilla::dom::Element*)]
Crash Signature: [@ Servo_ResolveStyle] [@ geckoservo::glue::Servo_ResolveStyle(style::gecko_bindings::structs::root::mozilla::dom::Element*)] → [@ Servo_ResolveStyle] [@ geckoservo::glue::Servo_ResolveStyle(style::gecko_bindings::structs::root::mozilla::dom::Element*)]
Whiteboard: [retriggered][stockwell needswork:owner]

This is almost a revert of bug 1741089 (just with the relevant test fix
and so on). With the previous patch, for something like:

<menupopup>
<menuitem />
</menupopup>

We would still generate the frames for the menuitem. That causes various
a11y tests to fail and starts loading images used by the menuitem which
was caught by browser_startup_images.js.

Make the children completely invisible to layout by keeping them
unslotted. This makes getComputedStyle on them return an empty style,
but only one test was depending on that.

Depends on D134331

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3cd27ead74b3
Remove nsMenuPopupFrame::GenerateFrames and related code. r=tnikkel
https://hg.mozilla.org/integration/autoland/rev/69410a2138ec
Make panels and menupopups not have their children in the flat tree if not initialized. r=Gijs
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
See Also: 1746309
Depends on: 1693176
Depends on: 1745348
Regressions: 1763990
No longer regressions: 1763990
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: