Closed Bug 2096640 Opened 5 days ago Closed 1 day ago

Hit MOZ_CRASH(called `Option::unwrap()` on a `None` value) at servo/ports/geckolib/glue.rs:4288

Categories

(Core :: Layout, defect)

defect

Tracking

()

VERIFIED FIXED
163 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr153 --- wontfix
firefox161 --- wontfix
firefox162 --- wontfix
firefox163 --- verified

People

(Reporter: tsmith, Assigned: sajidanwar)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: assertion, regression, testcase, Whiteboard: [bugmon:bisected,confirmed])

Crash Data

Attachments

(1 file, 1 external file)

Attached file testcase.html —

Found while fuzzing m-c 20261122-32764ef78659 (--enable-debug --enable-fuzzing)

To reproduce via Grizzly Replay:

$ pip install fuzzfetch grizzly-framework --upgrade
$ python -m fuzzfetch -d --fuzzing -n firefox
$ python -m grizzly.replay.bugzilla ./firefox/firefox <bugid>

Hit MOZ_CRASH(called Option::unwrap() on a None value) at servo/ports/geckolib/glue.rs:4288

#0 0x7bffe4a8dbb8 in MOZ_CrashSequence /builds/worker/workspace/obj-build/dist/include/mozilla/Assertions.h:261:3
#1 0x7bffe4a8dbb8 in MOZ_Crash /builds/worker/workspace/obj-build/dist/include/mozilla/Assertions.h:402:3
#2 0x7bffe4a8dbb8 in RustMozCrash /builds/worker/checkouts/gecko/mozglue/static/rust/wrappers.cpp:17:3
#3 0x7bffe4a8d13b in mozglue_static::panic_hook /builds/worker/checkouts/gecko/mozglue/static/rust/lib.rs:99:9
#4 0x7bffe4a8db15 in <mozglue_static::panic_hook as core::ops::function::Fn<(&std::panic::PanicHookInfo,)>>::call /builds/worker/fetches/rust/library/core/src/ops/function.rs:79:5
#5 0x7bffe93c0a41 in std::panicking::panic_with_hook std.8af3bd109c3ae499-cgu.0:0:0
#6 0x7bffe93ac6b9 in std::panicking::panic_handler::{closure#0} std.8af3bd109c3ae499-cgu.0:0:0
#7 0x7bffe93a3be8 in std::sys::backtrace::__rust_end_short_backtrace::<std::panicking::panic_handler::{closure#0}, !> std.8af3bd109c3ae499-cgu.0:0:0
#8 0x7bffe93ad2cc in __rustc::rust_begin_unwind std.8af3bd109c3ae499-cgu.0:0:0
#9 0x7bffe93e459b in core::panicking::panic_fmt core.7ee0c8296a1d0ca5-cgu.0:0:0
#10 0x7bffe93e4561 in core::panicking::panic core.7ee0c8296a1d0ca5-cgu.0:0:0
#11 0x7bffe93e4318 in core::option::unwrap_failed core.7ee0c8296a1d0ca5-cgu.0:0:0
#12 0x7bffe7a2cf84 in <core::option::Option<i32>>::unwrap /builds/worker/fetches/rust/library/core/src/option.rs:1016:21
#13 0x7bffe7a2cf84 in geckoservo::glue::Servo_CounterStyleRule_IsInRange::{closure#0}::{closure#0} /builds/worker/checkouts/gecko/servo/ports/geckolib/glue.rs:4288:30
#14 0x7bffe7a2cf84 in <core::slice::iter::Iter<style::counter_style::CounterRange> as core::iter::traits::iterator::Iterator>::any::<geckoservo::glue::Servo_CounterStyleRule_IsInRange::{closure#0}::{closure#0}> /builds/worker/fetches/rust/library/core/src/slice/iter/macros.rs:332:24
#15 0x7bffe7a2cf84 in geckoservo::glue::Servo_CounterStyleRule_IsInRange::{closure#0} /builds/worker/checkouts/gecko/servo/ports/geckolib/glue.rs:4278:39
#16 0x7bffe7a2cf84 in geckoservo::glue::read_locked_arc::<style::counter_style::CounterStyleRule, geckoservo::glue::IsOrdinalInRange, geckoservo::glue::Servo_CounterStyleRule_IsInRange::{closure#0}> /builds/worker/checkouts/gecko/servo/ports/geckolib/glue.rs:2224:5
#17 0x7bffe7a2cf84 in Servo_CounterStyleRule_IsInRange /builds/worker/checkouts/gecko/servo/ports/geckolib/glue.rs:4268:5
#18 0x7bffda8447cf in mozilla::CustomCounterStyle::IsOrdinalInRange(int) /builds/worker/workspace/obj-build/layout/style/./../../../../checkouts/gecko/layout/style/CounterStyleManager.cpp:1195:18
#19 0x7bffda845466 in mozilla::CounterStyle::GetCounterText(int, mozilla::WritingMode, nsTSubstring<char16_t>&, bool&) /builds/worker/workspace/obj-build/layout/style/./../../../../checkouts/gecko/layout/style/CounterStyleManager.cpp:1658:18
#20 0x7bffdab59c67 in nsCounterUseNode::GetText(mozilla::WritingMode, mozilla::CounterStyle*, nsTString<char16_t>&) /builds/worker/workspace/obj-build/layout/base/./../../../../checkouts/gecko/layout/base/nsCounterManager.cpp:121:13
#21 0x7bffdab9a3cf in operator() /builds/worker/workspace/obj-build/layout/base/./../../../../checkouts/gecko/layout/base/nsCounterManager.cpp:83:9
#22 0x7bffdab9a3cf in WithCounterStyleNameOrSymbols<(lambda at ./../../../../checkouts/gecko/layout/base/nsCounterManager.cpp:82:54)> /builds/worker/checkouts/gecko/layout/style/CounterStyleManager.h:162:16
#23 0x7bffdab9a3cf in nsCounterUseNode::GetText(nsTString<char16_t>&) /builds/worker/workspace/obj-build/layout/base/./../../../../checkouts/gecko/layout/base/nsCounterManager.cpp:82:9
#24 0x7bffdab9a05c in nsCounterUseNode::Calc(nsCounterList*, bool) /builds/worker/workspace/obj-build/layout/base/./../../../../checkouts/gecko/layout/base/nsCounterManager.cpp:58:5
#25 0x7bffdab9c1b2 in Calc /builds/worker/checkouts/gecko/layout/base/nsCounterManager.h:192:16
#26 0x7bffdab9c1b2 in nsCounterList::RecalcAll() /builds/worker/workspace/obj-build/layout/base/./../../../../checkouts/gecko/layout/base/nsCounterManager.cpp:398:11
#27 0x7bffdab9de76 in nsCounterManager::RecalcAll() /builds/worker/workspace/obj-build/layout/base/./../../../../checkouts/gecko/layout/base/nsCounterManager.cpp:512:13
#28 0x7bffdaa8f5a9 in mozilla::ContainStyleScope::RecalcAllCounters() /builds/worker/workspace/obj-build/layout/base/./../../../../checkouts/gecko/layout/base/ContainStyleScopeManager.cpp:34:23
#29 0x7bffdaa9031d in mozilla::ContainStyleScopeManager::RecalcAllCounters() /builds/worker/workspace/obj-build/layout/base/./../../../../checkouts/gecko/layout/base/ContainStyleScopeManager.cpp:169:18
#30 0x7bffdab89707 in nsCSSFrameConstructor::RecalcQuotesAndCounters() /builds/worker/workspace/obj-build/layout/base/./../../../../checkouts/gecko/layout/base/nsCSSFrameConstructor.cpp:7203:31
#31 0x7bffdaad7388 in DoFlushLayout /builds/worker/workspace/obj-build/layout/base/./../../../../checkouts/gecko/layout/base/PresShell.cpp:11061:22
#32 0x7bffdaad7388 in mozilla::PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush) /builds/worker/workspace/obj-build/layout/base/./../../../../checkouts/gecko/layout/base/PresShell.cpp:4708:9
#33 0x7bffd2afcc18 in FlushPendingNotifications /builds/worker/workspace/obj-build/dist/include/mozilla/PresShell.h:1567:5
#34 0x7bffd2afcc18 in mozilla::dom::Document::DetermineProximityToViewportAndNotifyResizeObservers() /builds/worker/workspace/obj-build/dom/base/./../../../../checkouts/gecko/dom/base/Document.cpp:20090:11
#35 0x7bffdaa521c1 in operator() /builds/worker/checkouts/gecko/layout/base/nsRefreshDriver.cpp:2544:14
#36 0x7bffdaa521c1 in operator() /builds/worker/checkouts/gecko/layout/base/nsRefreshDriver.cpp:1317:7
#37 0x7bffdaa521c1 in RunRenderingPhaseLegacy<(lambda at /builds/worker/checkouts/gecko/layout/base/nsRefreshDriver.cpp:1296:35)> /builds/worker/checkouts/gecko/layout/base/nsRefreshDriver.cpp:1289:3
#38 0x7bffdaa521c1 in void nsRefreshDriver::RunRenderingPhase<nsRefreshDriver::Tick(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp, nsRefreshDriver::IsExtraTick)::$_11>(mozilla::RenderingPhase, nsRefreshDriver::Tick(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp, nsRefreshDriver::IsExtraTick)::$_11&&, bool (*)(mozilla::dom::Document const&)) /builds/worker/checkouts/gecko/layout/base/nsRefreshDriver.cpp:1296:3
#39 0x7bffdaa474a0 in nsRefreshDriver::Tick(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp, nsRefreshDriver::IsExtraTick) /builds/worker/checkouts/gecko/layout/base/nsRefreshDriver.cpp:2540:3
#40 0x7bffdaa5df56 in TickDriver /builds/worker/checkouts/gecko/layout/base/nsRefreshDriver.cpp:365:13
#41 0x7bffdaa5df56 in mozilla::RefreshDriverTimer::TickRefreshDrivers(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp, nsTArray<RefPtr<nsRefreshDriver>>&) /builds/worker/checkouts/gecko/layout/base/nsRefreshDriver.cpp:343:7
#42 0x7bffdaa5dd1a in mozilla::RefreshDriverTimer::Tick(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp) /builds/worker/checkouts/gecko/layout/base/nsRefreshDriver.cpp:359:5
#43 0x7bffdaa5d991 in mozilla::VsyncRefreshDriverTimer::RunRefreshDrivers(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp) /builds/worker/checkouts/gecko/layout/base/nsRefreshDriver.cpp:954:5
#44 0x7bffdaa5c730 in mozilla::VsyncRefreshDriverTimer::TickRefreshDriver(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp) /builds/worker/checkouts/gecko/layout/base/nsRefreshDriver.cpp:864:5
#45 0x7bffdaa5a832 in mozilla::VsyncRefreshDriverTimer::RefreshDriverVsyncObserver::NotifyVsyncTimerOnMainThread() /builds/worker/checkouts/gecko/layout/base/nsRefreshDriver.cpp:587:14
#46 0x7bffd8f3eba1 in mozilla::dom::VsyncMainChild::RecvNotify(mozilla::VsyncEvent const&, float const&) /builds/worker/checkouts/gecko/dom/ipc/VsyncMainChild.cpp:64:15
#47 0x7bffd946125e in mozilla::dom::PVsyncChild::OnMessageReceived(IPC::Message const&) /builds/worker/workspace/obj-build/dom/ipc/./../../ipc/ipdl/PVsyncChild.cpp:241:94
#48 0x7bffcf9d3f87 in mozilla::ipc::PBackgroundChild::OnMessageReceived(IPC::Message const&) /builds/worker/workspace/obj-build/ipc/glue/./../ipdl/PBackgroundChild.cpp:4975:32
#49 0x7bffcf9245d5 in mozilla::ipc::MessageChannel::DispatchAsyncMessage(mozilla::ipc::ActorLifecycleProxy*, IPC::Message const&) /builds/worker/workspace/obj-build/ipc/glue/./../../../../checkouts/gecko/ipc/glue/MessageChannel.cpp:1797:25
#50 0x7bffcf920acd in mozilla::ipc::MessageChannel::DispatchMessage(mozilla::ipc::ActorLifecycleProxy*, std::unique_ptr<IPC::Message, std::default_delete<IPC::Message>>) /builds/worker/workspace/obj-build/ipc/glue/./../../../../checkouts/gecko/ipc/glue/MessageChannel.cpp:1723:9
#51 0x7bffcf9218e4 in mozilla::ipc::MessageChannel::RunMessage(mozilla::ipc::ActorLifecycleProxy*, mozilla::ipc::MessageChannel::MessageTask&) /builds/worker/workspace/obj-build/ipc/glue/./../../../../checkouts/gecko/ipc/glue/MessageChannel.cpp:1512:3
#52 0x7bffcf922e03 in mozilla::ipc::MessageChannel::MessageTask::Run() /builds/worker/workspace/obj-build/ipc/glue/./../../../../checkouts/gecko/ipc/glue/MessageChannel.cpp:1614:14
#53 0x7bffcf6c4b4a in mozilla::RunnableTask::Run() /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:757:16
#54 0x7bffcf6a3170 in mozilla::TaskController::RunTask(mozilla::Task*) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:212:19
#55 0x7bffcf6aa74d in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:1413:20
#56 0x7bffcf6a81b5 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:1233:15
#57 0x7bffcf6a87b6 in mozilla::TaskController::ProcessPendingMTTask(bool) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:693:36
#58 0x7bffcf6c2f64 in operator() /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/TaskController.cpp:384:37
#59 0x7bffcf6c2f64 in mozilla::detail::RunnableFunction<mozilla::TaskController::TaskController()::$_1>::Run() /builds/worker/checkouts/gecko/xpcom/threads/nsThreadUtils.h:535:5
#60 0x7bffcf6ea6d0 in nsThread::ProcessNextEvent(bool, bool*) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/nsThread.cpp:1319:16
#61 0x7bffcf6f46e9 in NS_ProcessNextEvent(nsIThread*, bool) /builds/worker/workspace/obj-build/xpcom/threads/./../../../../checkouts/gecko/xpcom/threads/nsThreadUtils.cpp:471:32
#62 0x7bffd2c07cec in SpinEventLoopUntil<(mozilla::ProcessFailureBehavior)1, (lambda at ./../../../../checkouts/gecko/dom/base/FuzzingFunctions.cpp:414:22)> /builds/worker/workspace/obj-build/dist/include/mozilla/SpinEventLoopUntil.h:174:25
#63 0x7bffd2c07cec in mozilla::dom::FuzzingFunctions::SpinEventLoopFor(mozilla::dom::GlobalObject const&, unsigned int) /builds/worker/workspace/obj-build/dom/base/./../../../../checkouts/gecko/dom/base/FuzzingFunctions.cpp:413:3
#64 0x7bffd4b34b7a in mozilla::dom::FuzzingFunctions_Binding::spinEventLoopFor(JSContext*, unsigned int, JS::Value*) /builds/worker/workspace/obj-build/dom/bindings/./FuzzingFunctionsBinding.cpp:305:3
#65 0x7bffde6bfc77 in CallJSNative /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:530:13
#66 0x7bffde6bfc77 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:628:12
#67 0x7bffdd72bc0d in js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICFallbackStub*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) /builds/worker/workspace/obj-build/js/src/jit/./../../../../../checkouts/gecko/js/src/jit/BaselineIC.cpp:1718:10
#68 0x3c56611d6bb2  ([anon:js-executable-memory]+0x2bb2)
Crash Signature: [@ style::values::specified::number::Integer::get ]

Verified bug as reproducible on mozilla-central 20261123184640-380e0044443e.
The bug appears to have been introduced in the following build range:

Start: 26dc07739a549d7e31a355cb561b5991585d6c65 (20260510094626)
End: 00019f67436fd7cf4f946fc0288a22740277730c (20260510213110)
Pushlog: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=26dc07739a549d7e31a355cb561b5991585d6c65&tochange=00019f67436fd7cf4f946fc0288a22740277730c

Keywords: regression
Whiteboard: [bugmon:bisected,confirmed]

:sajidanwar, since you are the author of the regressor, bug 2035572, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(sajidanwar94)

Huh, the testcase is super minimal:

<style>@counter-style x { system: extends decimal; range: -1 calc(0); }</style>
<ol style="list-style-type: x"><li></li></ol>

I guess calc(0) is the relevant calc expression there that relates this to bug 2035572 as the regressor.

For me, the testcase crashes with crash signature [@ geckoservo::glue::Servo_CounterStyleRule_IsInRange::{{closure}}::{{closure}} ]

Crash reports:
bp-7f293b28-443c-4f75-bebc-7ce990261125
bp-10387b6d-b647-4f14-bcbd-067080261125

Anyway -- pretty sure this abort (with "called Option::unwrap()on aNone value") is a safe crash, so I'm triaging as S3.

Crash Signature: [@ style::values::specified::number::Integer::get ] → [@ style::values::specified::number::Integer::get ] [@ geckoservo::glue::Servo_CounterStyleRule_IsInRange::{{closure}}::{{closure}} ]

Thanks Daniel for triaging, silly mistake in that I used .get() instead of .resolve() there. Publishing a patch with a crashtest shortly.

Flags: needinfo?(sajidanwar94)
Assignee: nobody → sajidanwar94
Status: NEW → ASSIGNED
Pushed by sajidanwar94@gmail.com: https://github.com/mozilla-firefox/firefox/commit/6f6d1a90d5f3 https://hg.mozilla.org/integration/autoland/rev/a35c9e298dc9 Fix crash for @counter-style range with parse-time resolvable calc(). r=firefox-style-system-reviewers,dshin
Status: ASSIGNED → RESOLVED
Closed: 1 day ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch

The patch landed in nightly and ESR is affected.

:sajidanwar, please make an uplift decision for ESR:

  • For ESR, nominate the patch for the appropriate ESR uplift approval if the fix should be included in ESR, or set the ESR status flag(s) to wontfix if an uplift isn't needed. Each affected ESR release needs a decision.

The bugbug regressor model rates the riskiest of the 2 patches (983d5f562063) as high risk: about 15% of the patches with this rating cause a regression. Unless the fix is important for this release, consider letting it ride the trains.

Uplift requests can be submitted from Lando: D346673.

See Requesting an Uplift for documentation on how to request an uplift.

For more information, please visit BugBot documentation.

Flags: needinfo?(sajidanwar94)

Not a security-related bug so I think uplift isn't needed, marking this as wontfix for ESR.

Flags: needinfo?(sajidanwar94)

Verified bug as fixed on rev mozilla-central 20261127190712-2ae032a566f9.
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.

Status: RESOLVED → VERIFIED
Keywords: bugmon
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: