Closed Bug 1780051 Opened 2 years ago Closed 2 years ago

Assertion failure: data != nullptr, at /dom/webgpu/Queue.cpp:57

Categories

(Core :: Graphics: WebGPU, defect)

x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
105 Branch
Tracking Status
firefox105 --- fixed

People

(Reporter: jkratzer, Assigned: nical, NeedInfo)

References

(Blocks 2 open bugs)

Details

(Keywords: testcase, Whiteboard: [bugmon:confirm])

Attachments

(2 files)

Testcase found while fuzzing mozilla-central rev 0ac3dabcf588 (built with: --enable-address-sanitizer --enable-fuzzing).

Testcase can be reproduced using the following commands:

$ pip install fuzzfetch grizzly-framework
$ python -m fuzzfetch --build 0ac3dabcf588 --asan --fuzzing -n firefox
$ python -m grizzly.replay ./firefox/firefox testcase.zip
Assertion failure: data != nullptr, at /dom/webgpu/Queue.cpp:57

    ==3199051==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f32934aa8e0 bp 0x7ffe13caf270 sp 0x7ffe13caf1e0 T3199051)
    ==3199051==The signal is caused by a WRITE memory access.
    ==3199051==Hint: address points to the zero page.
        #0 0x7f32934aa8e0 in mozilla::webgpu::Queue::WriteBuffer(mozilla::webgpu::Buffer const&, unsigned long, mozilla::dom::ArrayBufferViewOrArrayBuffer const&, unsigned long, mozilla::dom::Optional<unsigned long> const&, mozilla::ErrorResult&) /dom/webgpu/Queue.cpp:57:3
        #1 0x7f3292a0cc6d in mozilla::dom::GPUQueue_Binding::writeBuffer(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/WebGPUBinding.cpp:19942:24
        #2 0x7f3293055efc 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:3285:13
        #3 0x7f329855cc30 in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /js/src/vm/Interpreter.cpp:417:13
        #4 0x7f329855c49a in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:504:12
        #5 0x7f329855398c in CallFromStack /js/src/vm/Interpreter.cpp:575:10
        #6 0x7f329855398c in Interpret(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:3313:16
        #7 0x7f329854ad02 in js::RunScript(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:389:13
        #8 0x7f329855c396 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:536:13
        #9 0x7f329855d958 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:602:8
        #10 0x7f3297436686 in js::CallSelfHostedFunction(JSContext*, JS::Handle<js::PropertyName*>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>) /js/src/vm/SelfHosting.cpp:1572:10
        #11 0x7f32971e6431 in AsyncFunctionResume(JSContext*, JS::Handle<js::AsyncFunctionGeneratorObject*>, ResumeKind, JS::Handle<JS::Value>) /js/src/vm/AsyncFunction.cpp:153:8
        #12 0x7f32973cf302 in AsyncFunctionPromiseReactionJob /js/src/builtin/Promise.cpp:2112:12
        #13 0x7f32973cf302 in PromiseReactionJob(JSContext*, unsigned int, JS::Value*) /js/src/builtin/Promise.cpp:2175:12
        #14 0x7f329855cc30 in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /js/src/vm/Interpreter.cpp:417:13
        #15 0x7f329855c49a in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:504:12
        #16 0x7f329855d958 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:602:8
        #17 0x7f3297211311 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
        #18 0x7f329232a34d 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
        #19 0x7f328ff762b5 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:88:12
        #20 0x7f328ff75543 in Call /builds/worker/workspace/obj-build/dist/include/mozilla/dom/PromiseBinding.h:101:12
        #21 0x7f328ff75543 in mozilla::PromiseJobRunnable::Run(mozilla::AutoSlowOperation&) /xpcom/base/CycleCollectedJSContext.cpp:213:18
        #22 0x7f328ff63208 in mozilla::CycleCollectedJSContext::PerformMicroTaskCheckPoint(bool) /xpcom/base/CycleCollectedJSContext.cpp:676:17
        #23 0x7f328ff6407c in mozilla::CycleCollectedJSContext::AfterProcessTask(unsigned int) /xpcom/base/CycleCollectedJSContext.cpp:463:3
        #24 0x7f3290df9b75 in XPCJSContext::AfterProcessTask(unsigned int) /js/xpconnect/src/XPCJSContext.cpp:1485:28
        #25 0x7f3290085eac in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1242:24
        #26 0x7f329008c0fd in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:465:10
        #27 0x7f3290c59f24 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:107:5
        #28 0x7f3290b80397 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:380:10
        #29 0x7f3290b802a2 in RunHandler /ipc/chromium/src/base/message_loop.cc:373:3
        #30 0x7f3290b802a2 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:355:3
        #31 0x7f3294e298f8 in nsBaseAppShell::Run() /widget/nsBaseAppShell.cpp:150:27
        #32 0x7f3296f50cab in XRE_RunAppShell() /toolkit/xre/nsEmbedFunctions.cpp:875:20
        #33 0x7f3290c5ae6a in mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:235:9
        #34 0x7f3290b80397 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:380:10
        #35 0x7f3290b802a2 in RunHandler /ipc/chromium/src/base/message_loop.cc:373:3
        #36 0x7f3290b802a2 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:355:3
        #37 0x7f3296f502cc in XRE_InitChildProcess(int, char**, XREChildData const*) /toolkit/xre/nsEmbedFunctions.cpp:734:34
        #38 0x5618dba4a110 in content_process_main /browser/app/../../ipc/contentproc/plugin-container.cpp:57:28
        #39 0x5618dba4a110 in main /browser/app/nsBrowserApp.cpp:338:18
        #40 0x7f32a6876082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
        #41 0x5618dba1febc in _start (/home/jkratzer/builds/mc-debug/firefox-bin+0x15ebc) (BuildId: a5a643de37db9b352fa1f14641c51027bda29ef4)
    
    UndefinedBehaviorSanitizer can not provide additional info.
    SUMMARY: UndefinedBehaviorSanitizer: SEGV /dom/webgpu/Queue.cpp:57:3 in mozilla::webgpu::Queue::WriteBuffer(mozilla::webgpu::Buffer const&, unsigned long, mozilla::dom::ArrayBufferViewOrArrayBuffer const&, unsigned long, mozilla::dom::Optional<unsigned long> const&, mozilla::ErrorResult&)
    ==3199051==ABORTING
Attached file Testcase

Bugmon Analysis
Unable to reproduce bug 1780051 using build mozilla-central 20220717090304-0ac3dabcf588. Without a baseline, bugmon is unable to analyze this bug.
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.

Keywords: bugmon

The severity field is not set for this bug.
:jimb, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jimb)

This is the same problem as bug 1774452 with Queue::WriteBuffer instead of Queue::WriteTexture.

Assignee: nobody → nical.bugzilla
See Also: → 1774452
Pushed by nsilva@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/08a66c822c6c
Avoid crashing when taking an invalid array buffer in writeBuffer. r=jgilbert
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: