Testcase found while fuzzing mozilla-central rev 6938c3b26d14 (built with: --enable-debug --enable-fuzzing).
Testcase can be reproduced using the following commands:
$ pip install fuzzfetch grizzly-framework
$ python -m fuzzfetch --build 6938c3b26d14 --debug --fuzzing -n firefox
$ python -m grizzly.replay ./firefox/firefox testcase.html --repeat 10 --relaunch 1
Assertion failure: mRawPtr != nullptr (You can't dereference a NULL RefPtr with operator->().), at /builds/worker/workspace/obj-build/dist/include/mozilla/RefPtr.h:315
==963926==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f2882db71e7 bp 0x7ffcb459d5f0 sp 0x7ffcb459d5f0 T963926)
==963926==The signal is caused by a WRITE memory access.
==963926==Hint: address points to the zero page.
#0 0x7f2882db71e7 in RefPtr<mozilla::dom::Document>::operator->() const /builds/worker/workspace/obj-build/dist/include/mozilla/RefPtr.h:314:5
#1 0x7f2888762e81 in nsWindowWatcher::OpenWindowInternal(mozIDOMWindowProxy*, nsTSubstring<char> const&, nsTSubstring<char> const&, nsTSubstring<char> const&, bool, bool, bool, nsIArray*, bool, bool, bool, nsPIWindowWatcher::PrintKind, nsDocShellLoadState*, mozilla::dom::BrowsingContext**) /toolkit/components/windowwatcher/nsWindowWatcher.cpp:1170:38
#2 0x7f2888764daa in nsWindowWatcher::OpenWindow2(mozIDOMWindowProxy*, nsTSubstring<char> const&, nsTSubstring<char> const&, nsTSubstring<char> const&, bool, bool, bool, nsISupports*, bool, bool, bool, nsPIWindowWatcher::PrintKind, nsDocShellLoadState*, mozilla::dom::BrowsingContext**) /toolkit/components/windowwatcher/nsWindowWatcher.cpp:387:10
#3 0x7f28836b3e94 in nsGlobalWindowOuter::OpenInternal(nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, bool, bool, bool, bool, bool, nsIArray*, nsISupports*, nsDocShellLoadState*, bool, nsGlobalWindowOuter::PrintKind, mozilla::dom::BrowsingContext**) /dom/base/nsGlobalWindowOuter.cpp:7085:21
#4 0x7f28836b1dc0 in nsGlobalWindowOuter::Print(nsIPrintSettings*, nsIWebProgressListener*, nsIDocShell*, nsGlobalWindowOuter::IsPreview, nsGlobalWindowOuter::IsForWindowDotPrint, std::function<void (mozilla::dom::PrintPreviewResultInfo const&)>&&, mozilla::ErrorResult&) /dom/base/nsGlobalWindowOuter.cpp:5246:16
#5 0x7f288366a887 in nsGlobalWindowInner::PrintPreview(nsIPrintSettings*, nsIWebProgressListener*, nsIDocShell*, mozilla::ErrorResult&) /dom/base/nsGlobalWindowInner.cpp:3829:3
#6 0x7f28848177c1 in mozilla::dom::Window_Binding::printPreview(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/WindowBinding.cpp:3216:59
#7 0x7f2884de19c4 in bool mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::MaybeCrossOriginObjectThisPolicy, mozilla::dom::binding_detail::ThrowExceptions>(JSContext*, unsigned int, JS::Value*) /dom/bindings/BindingUtils.cpp:3306:13
#8 0x7f288894040f in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /js/src/vm/Interpreter.cpp:425:13
#9 0x7f288893fb0d in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:512:12
#10 0x7f28889415ee in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) /js/src/vm/Interpreter.cpp:572:10
#11 0x7f2888936ea6 in CallFromStack /js/src/vm/Interpreter.cpp:576:10
#12 0x7f2888936ea6 in Interpret(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:3309:16
#13 0x7f288892dda3 in js::RunScript(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:394:13
#14 0x7f288893fa08 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:544:13
#15 0x7f28889415ee in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) /js/src/vm/Interpreter.cpp:572:10
#16 0x7f28889417f1 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:589:8
#17 0x7f2888cd7f50 in js::CallSelfHostedFunction(JSContext*, JS::Handle<js::PropertyName*>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>) /js/src/vm/SelfHosting.cpp:1586:10
#18 0x7f2888a4bf1b in AsyncFunctionResume(JSContext*, JS::Handle<js::AsyncFunctionGeneratorObject*>, ResumeKind, JS::Handle<JS::Value>) /js/src/vm/AsyncFunction.cpp:152:8
#19 0x7f2888c38e73 in AsyncFunctionPromiseReactionJob /js/src/builtin/Promise.cpp:1954:10
#20 0x7f2888c38e73 in PromiseReactionJob(JSContext*, unsigned int, JS::Value*) /js/src/builtin/Promise.cpp:2012:12
#21 0x7f288894040f in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /js/src/vm/Interpreter.cpp:425:13
#22 0x7f288893fb0d in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:512:12
#23 0x7f28889415ee in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) /js/src/vm/Interpreter.cpp:572:10
#24 0x7f28889417f1 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:589:8
#25 0x7f2888a73ef1 in JS::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::HandleValueArray const&, JS::MutableHandle<JS::Value>) /js/src/vm/CallAndConstruct.cpp:117:10
#26 0x7f288409efb5 in mozilla::dom::PromiseJobCallback::Call(mozilla::dom::BindingCallContext&, JS::Handle<JS::Value>, mozilla::ErrorResult&) /builds/worker/workspace/obj-build/dom/bindings/PromiseBinding.cpp:35:8
#27 0x7f28818a1fd5 in mozilla::dom::PromiseJobCallback::Call(mozilla::ErrorResult&, char const*, mozilla::dom::CallbackObject::ExceptionHandling, JS::Realm*) /builds/worker/workspace/obj-build/dist/include/mozilla/dom/PromiseBinding.h:89:12
#28 0x7f28818a130b in Call /builds/worker/workspace/obj-build/dist/include/mozilla/dom/PromiseBinding.h:102:12
#29 0x7f28818a130b in mozilla::PromiseJobRunnable::Run(mozilla::AutoSlowOperation&) /xpcom/base/CycleCollectedJSContext.cpp:213:18
#30 0x7f288188e3f8 in mozilla::CycleCollectedJSContext::PerformMicroTaskCheckPoint(bool) /xpcom/base/CycleCollectedJSContext.cpp:674:17
#31 0x7f2883653fc0 in LeaveMicroTask /builds/worker/workspace/obj-build/dist/include/mozilla/CycleCollectedJSContext.h:243:7
#32 0x7f2883653fc0 in ~nsAutoMicroTask /builds/worker/workspace/obj-build/dist/include/mozilla/CycleCollectedJSContext.h:395:13
#33 0x7f2883653fc0 in nsGlobalWindowInner::CallDocumentFlushedResolvers(bool) /dom/base/nsGlobalWindowInner.cpp:7185:5
#34 0x7f2883651ef1 in nsGlobalWindowInner::FreeInnerObjects() /dom/base/nsGlobalWindowInner.cpp:1240:3
#35 0x7f288369eabe in nsGlobalWindowOuter::DetachFromDocShell(bool) /dom/base/nsGlobalWindowOuter.cpp:2709:12
#36 0x7f288810a18d in nsDocShell::Destroy() /docshell/base/nsDocShell.cpp:4592:20
#37 0x7f2883a52f59 in nsFrameLoader::DestroyDocShell() /dom/base/nsFrameLoader.cpp:2056:20
#38 0x7f2883a52d59 in nsFrameLoaderDestroyRunnable::Run() /dom/base/nsFrameLoader.cpp:1985:21
#39 0x7f288380fffb in mozilla::dom::Document::MaybeInitializeFinalizeFrameLoaders() /dom/base/Document.cpp:9244:22
#40 0x7f28838b7c4b in applyImpl<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1147:12
#41 0x7f28838b7c4b in apply<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1153:12
#42 0x7f28838b7c4b in mozilla::detail::RunnableMethodImpl<mozilla::dom::Document*, void (mozilla::dom::Document::*)(), true, (mozilla::RunnableKind)0>::Run() /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1200:13
#43 0x7f28835e120d in nsContentUtils::RemoveScriptBlocker() /dom/base/nsContentUtils.cpp:5693:17
#44 0x7f2886af0391 in ~nsAutoScriptBlocker /dom/base/nsContentUtils.h:3500:28
#45 0x7f2886af0391 in nsDocumentViewer::Destroy() /layout/base/nsDocumentViewer.cpp:1789:1
#46 0x7f288810a0e2 in nsDocShell::Destroy() /docshell/base/nsDocShell.cpp:4582:21
#47 0x7f2888483ca0 in nsWebBrowser::SetDocShell(nsDocShell*) /toolkit/components/browser/nsWebBrowser.cpp:1123:18
#48 0x7f2888483225 in nsWebBrowser::InternalDestroy() /toolkit/components/browser/nsWebBrowser.cpp:176:3
#49 0x7f2888486f0c in Destroy /toolkit/components/browser/nsWebBrowser.cpp:856:3
#50 0x7f2888486f0c in non-virtual thunk to nsWebBrowser::Destroy() /toolkit/components/browser/nsWebBrowser.cpp
#51 0x7f28861c95c9 in mozilla::dom::BrowserChild::DestroyWindow() /dom/ipc/BrowserChild.cpp:880:31
#52 0x7f28861d9f0b in mozilla::dom::BrowserChild::RecvDestroy() /dom/ipc/BrowserChild.cpp:2601:3
#53 0x7f2882c0e3cc in mozilla::dom::PBrowserChild::OnMessageReceived(IPC::Message const&) /builds/worker/workspace/obj-build/ipc/ipdl/PBrowserChild.cpp:6637:56
#54 0x7f28825f9d7b in mozilla::dom::PContentChild::OnMessageReceived(IPC::Message const&) /builds/worker/workspace/obj-build/ipc/ipdl/PContentChild.cpp:8275:32
#55 0x7f288246bd01 in mozilla::ipc::MessageChannel::DispatchAsyncMessage(mozilla::ipc::ActorLifecycleProxy*, IPC::Message const&) /ipc/glue/MessageChannel.cpp:1661:25
#56 0x7f2882469142 in mozilla::ipc::MessageChannel::DispatchMessage(IPC::Message&&) /ipc/glue/MessageChannel.cpp:1586:9
#57 0x7f2882469c8d in mozilla::ipc::MessageChannel::RunMessage(mozilla::ipc::MessageChannel::MessageTask&) /ipc/glue/MessageChannel.cpp:1454:3
#58 0x7f288246a76d in mozilla::ipc::MessageChannel::MessageTask::Run() /ipc/glue/MessageChannel.cpp:1482:14
#59 0x7f28819cf2ce in mozilla::RunnableTask::Run() /xpcom/threads/TaskController.cpp:467:16
#60 0x7f28819a84f6 in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:770:26
#61 0x7f28819a71b8 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:606:15
#62 0x7f28819a7433 in mozilla::TaskController::ProcessPendingMTTask(bool) /xpcom/threads/TaskController.cpp:390:36
#63 0x7f28819d27e9 in operator() /xpcom/threads/TaskController.cpp:127:37
#64 0x7f28819d27e9 in mozilla::detail::RunnableFunction<mozilla::TaskController::InitializeInternal()::$_1>::Run() /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:531:5
#65 0x7f28819bd443 in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1171:16
#66 0x7f28819c495a in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:467:10
#67 0x7f2882471054 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:107:5
#68 0x7f288238e167 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:331:10
#69 0x7f288238e072 in RunHandler /ipc/chromium/src/base/message_loop.cc:324:3
#70 0x7f288238e072 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:306:3
#71 0x7f288674f388 in nsBaseAppShell::Run() /widget/nsBaseAppShell.cpp:137:27
#72 0x7f28887c3b63 in XRE_RunAppShell() /toolkit/xre/nsEmbedFunctions.cpp:878:20
#73 0x7f2882471f9a in mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:235:9
#74 0x7f288238e167 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:331:10
#75 0x7f288238e072 in RunHandler /ipc/chromium/src/base/message_loop.cc:324:3
#76 0x7f288238e072 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:306:3
#77 0x7f28887c319c in XRE_InitChildProcess(int, char**, XREChildData const*) /toolkit/xre/nsEmbedFunctions.cpp:715:34
#78 0x55868924ad37 in content_process_main /browser/app/../../ipc/contentproc/plugin-container.cpp:57:28
#79 0x55868924ad37 in main /browser/app/nsBrowserApp.cpp:327:18
#80 0x7f2897b4b0b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
#81 0x5586892264bc in _start (/home/jkratzer/builds/mc-debug/firefox-bin+0x154bc)
UndefinedBehaviorSanitizer can not provide additional info.
SUMMARY: UndefinedBehaviorSanitizer: SEGV /builds/worker/workspace/obj-build/dist/include/mozilla/RefPtr.h:314:5 in RefPtr<mozilla::dom::Document>::operator->() const
==963926==ABORTING
Description
•