Testcase found while fuzzing mozilla-central rev caf560206ff2 (built with: --enable-debug --enable-fuzzing).
Testcase can be reproduced using the following commands:
$ pip install fuzzfetch grizzly-framework
$ fuzzfetch --build caf560206ff2 --debug --fuzzing -n firefox
$ unzip testcase.zip -d testcase
$ grizzly-replay ./firefox/firefox ./testcase
Assertion failure: sInServoTraversal || NS_IsMainThread(), at /builds/worker/workspace/obj-build/dist/include/mozilla/ServoUtils.h:33
==1714852==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7cdcefc15d0e bp 0x7cdc9766e220 sp 0x7cdc9766e200 T1714959)
==1714852==The signal is caused by a WRITE memory access.
==1714852==Hint: address points to the zero page.
#0 0x7cdcefc15d0e in MOZ_CrashSequence /builds/worker/workspace/obj-build/dist/include/mozilla/Assertions.h:237:3
#1 0x7cdcefc15d0e in IsInServoTraversal /builds/worker/workspace/obj-build/dist/include/mozilla/ServoUtils.h:33:3
#2 0x7cdcefc15d0e in IsInServoTraversal /builds/worker/workspace/obj-build/dist/include/mozilla/ServoStyleSet.h:120:45
#3 0x7cdcefc15d0e in mozilla::Preferences::InitStaticMembers() /modules/libpref/Preferences.cpp:3883:3
#4 0x7cdcefc0c0cf in mozilla::Preferences::HasUserValue(char const*) /modules/libpref/Preferences.cpp:5508:3
#5 0x7cdcefd381b8 in mozilla::intl::LocaleService::GetAcceptLanguages(nsTSubstring<char>&) /intl/locale/LocaleService.cpp:741:7
#6 0x7cdcf13787c5 in gfxPlatformFontList::AppendCJKPrefLangs(eFontPrefLang*, unsigned int&, eFontPrefLang, eFontPrefLang) /gfx/thebes/gfxPlatformFontList.cpp:2505:34
#7 0x7cdcf1378360 in gfxPlatformFontList::GetLangPrefs(eFontPrefLang*, unsigned int&, eFontPrefLang, eFontPrefLang) /gfx/thebes/gfxPlatformFontList.cpp:2477:5
#8 0x7cdcf139b4c9 in gfxFontGroup::WhichPrefFontSupportsChar(unsigned int, unsigned int, FontPresentation) /gfx/thebes/gfxTextRun.cpp:3865:8
#9 0x7cdcf1396f10 in gfxFontGroup::FindFontForChar(unsigned int, unsigned int, unsigned int, mozilla::intl::Script, gfxFont*, FontMatchType*) /gfx/thebes/gfxTextRun.cpp:3502:26
#10 0x7cdcf13b7073 in void gfxFontGroup::ComputeRanges<char16_t>(nsTArray<gfxFontGroup::TextRange>&, char16_t const*, unsigned int, mozilla::intl::Script, mozilla::gfx::ShapedTextFlags) /gfx/thebes/gfxTextRun.cpp:3645:11
#11 0x7cdcf13b4043 in void gfxFontGroup::InitScriptRun<char16_t>(mozilla::gfx::DrawTarget*, gfxTextRun*, char16_t const*, unsigned int, unsigned int, mozilla::intl::Script, gfxMissingFontRecorder*) /gfx/thebes/gfxTextRun.cpp:2843:3
#12 0x7cdcf139981a in void gfxFontGroup::InitTextRun<char16_t>(mozilla::gfx::DrawTarget*, gfxTextRun*, char16_t const*, unsigned int, gfxMissingFontRecorder*) /gfx/thebes/gfxTextRun.cpp:0:11
#13 0x7cdcf1398f05 in already_AddRefed<gfxTextRun> gfxFontGroup::MakeTextRun<char16_t>(char16_t const*, unsigned int, gfxTextRunFactory::Parameters const*, mozilla::gfx::ShapedTextFlags, nsTextFrameUtils::Flags, gfxMissingFontRecorder*) /gfx/thebes/gfxTextRun.cpp:2539:3
#14 0x7cdcf31331af in MakeTextRun<char16_t> /builds/worker/workspace/obj-build/dist/include/gfxTextRun.h:992:12
#15 0x7cdcf31331af in mozilla::dom::CanvasBidiProcessor::SetText(char16_t const*, int, mozilla::intl::BidiDirection) /dom/canvas/CanvasRenderingContext2D.cpp:4722:26
#16 0x7cdcf5b81484 in nsBidiPresUtils::ProcessText(char16_t const*, unsigned long, mozilla::intl::BidiEmbeddingLevel, nsPresContext*, nsBidiPresUtils::BidiProcessor&, nsBidiPresUtils::Mode, nsBidiPositionResolve*, int, int*, mozilla::intl::Bidi&) /layout/base/nsBidiPresUtils.cpp:2259:18
#17 0x7cdcf309d19a in mozilla::dom::CanvasRenderingContext2D::DrawOrMeasureText(nsTSubstring<char16_t> const&, float, float, mozilla::dom::Optional<double> const&, mozilla::dom::CanvasRenderingContext2D::TextDrawOperation, mozilla::ErrorResult&) /dom/canvas/CanvasRenderingContext2D.cpp:5126:12
#18 0x7cdcf309e04d in mozilla::dom::CanvasRenderingContext2D::MeasureText(nsTSubstring<char16_t> const&, mozilla::ErrorResult&) /dom/canvas/CanvasRenderingContext2D.cpp:4608:10
#19 0x7cdcf230f077 in mozilla::dom::OffscreenCanvasRenderingContext2D_Binding::measureText(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/./OffscreenCanvasRenderingContext2DBinding.cpp:4128:78
#20 0x7cdcf2f75b4d in bool mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::NormalThisPolicy, mozilla::dom::binding_detail::ThrowExceptions>(JSContext*, unsigned int, JS::Value*) /dom/bindings/BindingUtils.cpp:3306:13
#21 0x7cdcf699b8b4 in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /js/src/vm/Interpreter.cpp:490:13
#22 0x7cdcf699b10f in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:586:12
#23 0x7cdcf69ac202 in CallFromStack /js/src/vm/Interpreter.cpp:658:10
#24 0x7cdcf69ac202 in js::Interpret(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:3272:16
#25 0x7cdcf699a76a in js::RunScript(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:460:13
#26 0x7cdcf699b135 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:618:13
#27 0x7cdcf699c55c in js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>, js::CallReason) /js/src/vm/Interpreter.cpp:685:8
#28 0x7cdcf6a84d6b in JS::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::HandleValueArray const&, JS::MutableHandle<JS::Value>) /js/src/vm/CallAndConstruct.cpp:119:10
#29 0x7cdcf2d36a15 in mozilla::dom::EventHandlerNonNull::Call(mozilla::dom::BindingCallContext&, JS::Handle<JS::Value>, mozilla::dom::Event&, JS::MutableHandle<JS::Value>, mozilla::ErrorResult&) /builds/worker/workspace/obj-build/dom/bindings/./EventHandlerBinding.cpp:65:37
#30 0x7cdcf38a549b in void mozilla::dom::EventHandlerNonNull::Call<nsCOMPtr<mozilla::dom::EventTarget>>(nsCOMPtr<mozilla::dom::EventTarget> const&, mozilla::dom::Event&, JS::MutableHandle<JS::Value>, mozilla::ErrorResult&, char const*, mozilla::dom::CallbackObjectBase::ExceptionHandling, JS::Realm*) /builds/worker/workspace/obj-build/dist/include/mozilla/dom/EventHandlerBinding.h:82:12
#31 0x7cdcf38a3fe2 in mozilla::JSEventHandler::HandleEvent(mozilla::dom::Event*) /dom/events/JSEventHandler.cpp:201:12
#32 0x7cdcf387f6a1 in mozilla::EventListenerManager::HandleEventSingleListener(mozilla::EventListenerManager::Listener*, nsAtom*, mozilla::WidgetEvent*, mozilla::dom::Event*, mozilla::dom::EventTarget*, bool) /dom/events/EventListenerManager.cpp:1273:22
#33 0x7cdcf38807f9 in mozilla::EventListenerManager::HandleEventWithListenerArray(mozilla::EventListenerManager::ListenerArray*, nsAtom*, mozilla::EventMessage, nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event**, mozilla::dom::EventTarget*, bool) /dom/events/EventListenerManager.cpp:1579:12
#34 0x7cdcf38800e1 in mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event**, mozilla::dom::EventTarget*, nsEventStatus*, bool) /dom/events/EventListenerManager.cpp:1484:35
#35 0x7cdcf3874b7e in HandleEvent /builds/worker/workspace/obj-build/dist/include/mozilla/EventListenerManager.h:465:5
#36 0x7cdcf3874b7e in mozilla::EventTargetChainItem::HandleEvent(mozilla::EventChainPostVisitor&, mozilla::ELMCreationDetector&) /dom/events/EventDispatcher.cpp:364:17
#37 0x7cdcf387424c in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&) /dom/events/EventDispatcher.cpp:605:16
#38 0x7cdcf3876a02 in mozilla::EventDispatcher::Dispatch(mozilla::dom::EventTarget*, nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event*, nsEventStatus*, mozilla::EventDispatchingCallback*, nsTArray<mozilla::dom::EventTarget*>*) /dom/events/EventDispatcher.cpp:1260:11
#39 0x7cdcf387958a in mozilla::EventDispatcher::DispatchDOMEvent(mozilla::dom::EventTarget*, mozilla::WidgetEvent*, mozilla::dom::Event*, nsPresContext*, nsEventStatus*) /dom/events/EventDispatcher.cpp:0:0
#40 0x7cdcf384acfb in mozilla::DOMEventTargetHelper::DispatchEvent(mozilla::dom::Event&, mozilla::dom::CallerType, mozilla::ErrorResult&) /dom/events/DOMEventTargetHelper.cpp:153:17
#41 0x7cdcf38871d7 in mozilla::dom::EventTarget::DispatchEvent(mozilla::dom::Event&, mozilla::ErrorResult&) /dom/events/EventTarget.cpp:215:9
#42 0x7cdcf5198101 in mozilla::dom::MessageEventRunnable::DispatchDOMEvent(JSContext*, mozilla::dom::WorkerPrivate*, mozilla::DOMEventTargetHelper*, bool) /dom/workers/MessageEventRunnable.cpp:79:12
#43 0x7cdcf51e307a in mozilla::dom::WorkerThreadRunnable::Run() /dom/workers/WorkerRunnable.cpp:440:12
#44 0x7cdcefb97bf2 in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1158:16
#45 0x7cdcefb9e31f in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:461:10
#46 0x7cdcf51d1af4 in mozilla::dom::WorkerPrivate::DoRunLoop(JSContext*) /dom/workers/WorkerPrivate.cpp:3977:7
#47 0x7cdcf51b4884 in mozilla::dom::workerinternals::(anonymous namespace)::WorkerThreadPrimaryRunnable::Run() /dom/workers/RuntimeService.cpp:2311:42
#48 0x7cdcefb97bf2 in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1158:16
#49 0x7cdcefb9e31f in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:461:10
#50 0x7cdcf078f6a8 in mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:299:20
#51 0x7cdcf06e9a31 in RunHandler /ipc/chromium/src/base/message_loop.cc:361:3
#52 0x7cdcf06e9a31 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:343:3
#53 0x7cdcefb9382e in nsThread::ThreadFunc(void*) /xpcom/threads/nsThread.cpp:373:10
#54 0x7cdd00cb23ac in _pt_root /nsprpub/pr/src/pthreads/ptthread.c:191:3
#55 0x7cdd00d56aa3 in start_thread ./nptl/pthread_create.c:447:8
#56 0x7cdd00de3c6b in clone3 ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78:0
==1714852==Register values:
rax = 0x0000000000000000 rbx = 0x00007cdc9766e6d0 rcx = 0x0000000000000021 rdx = 0x00007cdd00ebe563
rdi = 0x00007cdd00ebf700 rsi = 0x0000000000000000 rbp = 0x00007cdc9766e220 rsp = 0x00007cdc9766e200
r8 = 0x0000000000000000 r9 = 0x0000000000000003 r10 = 0x0000000000000002 r11 = 0x0000000000000293
r12 = 0x000000000000001d r13 = 0x0000000000000000 r14 = 0x00007cdcec4bcac1 r15 = 0x00005ba7a881f440
UndefinedBehaviorSanitizer can not provide additional info.
SUMMARY: UndefinedBehaviorSanitizer: SEGV (/home/jkratzer/builds/m-c-20251119095727-fuzzing-debug/libxul.so+0x44e9d0e) (BuildId: d335436ffcbb6e1570451c1056f722cd396be0c1)
==1714852==ABORTING
Description
•