Closed Bug 1813111 Opened 2 years ago Closed 2 years ago

Hit MOZ_CRASH(called `Option::unwrap()` on a `None` value) at gfx/wgpu_bindings/src/client.rs:50

Categories

(Core :: Graphics: WebGPU, defect)

x86_64
Linux
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jkratzer, Unassigned)

References

(Blocks 2 open bugs)

Details

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

Crash Data

Attachments

(1 file)

Testcase found while fuzzing mozilla-central rev f75c73066b88 (built with: --enable-debug --enable-fuzzing).

Testcase can be reproduced using the following commands:

$ pip install fuzzfetch grizzly-framework
$ python -m fuzzfetch --build f75c73066b88 --debug --fuzzing -n firefox
$ python -m grizzly.replay ./firefox/firefox testcase.html
Hit MOZ_CRASH(called `Option::unwrap()` on a `None` value) at gfx/wgpu_bindings/src/client.rs:50

    ==180904==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fadff712885 bp 0x7fffd5b5a350 sp 0x7fffd5b5a340 T180904)
    ==180904==The signal is caused by a WRITE memory access.
    ==180904==Hint: address points to the zero page.
        #0 0x7fadff712885 in MOZ_Crash /builds/worker/workspace/obj-build/dist/include/mozilla/Assertions.h:261:3
        #1 0x7fadff712885 in RustMozCrash /mozglue/static/rust/wrappers.cpp:18:3
        #2 0x7fadff712802 in mozglue_static::panic_hook::h54d936b166c9baa9 /mozglue/static/rust/lib.rs:91:9
        #3 0x7fadff7122cb in core::ops::function::Fn::call::hca13bd9519fdde34 /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/ops/function.rs:78:5
        #4 0x7fae007ea478 in _$LT$alloc..boxed..Box$LT$F$C$A$GT$$u20$as$u20$core..ops..function..Fn$LT$Args$GT$$GT$::call::h44df53ea2a13204b /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/alloc/src/boxed.rs:2001:9
        #5 0x7fae007ea478 in std::panicking::rust_panic_with_hook::hfd45b6b6c12d9fa5 /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:692:13
        #6 0x7fae007ea1b0 in std::panicking::begin_panic_handler::_$u7b$$u7b$closure$u7d$$u7d$::hf591e8609a75bd4b /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:577:13
        #7 0x7fae007e752b in std::sys_common::backtrace::__rust_end_short_backtrace::h81899558795e4ff7 /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:137:18
        #8 0x7fae007e9f11 in rust_begin_unwind /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:575:5
        #9 0x7fae00840bd2 in core::panicking::panic_fmt::h4235fa9b4675b332 /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:65:14
        #10 0x7fae00840cac in core::panicking::panic::h9ced3cf2f605ba6a /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:115:5
        #11 0x7fadfea9d61e in wgpu_client_create_render_pipeline /gfx/wgpu_bindings/src/client.rs
        #12 0x7fadf93fc209 in mozilla::webgpu::WebGPUChild::DeviceCreateRenderPipelineImpl(mozilla::webgpu::PipelineCreationContext*, mozilla::dom::GPURenderPipelineDescriptor const&, mozilla::ipc::ByteBuf*) /dom/webgpu/ipc/WebGPUChild.cpp:947:14
        #13 0x7fadf93fc59a in mozilla::webgpu::WebGPUChild::DeviceCreateRenderPipelineAsync(mozilla::webgpu::PipelineCreationContext*, mozilla::dom::GPURenderPipelineDescriptor const&) /dom/webgpu/ipc/WebGPUChild.cpp:975:20
        #14 0x7fadf93e3c61 in mozilla::webgpu::Device::CreateRenderPipelineAsync(mozilla::dom::GPURenderPipelineDescriptor const&, mozilla::ErrorResult&) /dom/webgpu/Device.cpp:270:12
        #15 0x7fadf88fab3f in createRenderPipelineAsync /builds/worker/workspace/obj-build/dom/bindings/WebGPUBinding.cpp:19589:60
        #16 0x7fadf88fab3f in mozilla::dom::GPUDevice_Binding::createRenderPipelineAsync_promiseWrapper(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/WebGPUBinding.cpp:19605:13
        #17 0x7fadf8f5e8c5 in bool mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::NormalThisPolicy, mozilla::dom::binding_detail::ConvertExceptionsToPromises>(JSContext*, unsigned int, JS::Value*) /dom/bindings/BindingUtils.cpp:3308:13
        #18 0x7fadfd37f376 in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /js/src/vm/Interpreter.cpp:459:13
        #19 0x7fadfd37ec9f in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:547:12
        #20 0x7fadfd3708df in CallFromStack /js/src/vm/Interpreter.cpp:619:10
        #21 0x7fadfd3708df in Interpret(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:3362:16
        #22 0x7fadfd363f9e in js::RunScript(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:431:13
        #23 0x7fadfd37eb9b in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:579:13
        #24 0x7fadfd3800cc 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:646:8
        #25 0x7fadfd670e67 in js::CallSelfHostedFunction(JSContext*, JS::Handle<js::PropertyName*>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>) /js/src/vm/SelfHosting.cpp:1488:10
        #26 0x7fadfd41395c in AsyncFunctionResume(JSContext*, JS::Handle<js::AsyncFunctionGeneratorObject*>, ResumeKind, JS::Handle<JS::Value>) /js/src/vm/AsyncFunction.cpp:149:8
        #27 0x7fadfd5fceb5 in AsyncFunctionPromiseReactionJob /js/src/builtin/Promise.cpp:2111:12
        #28 0x7fadfd5fceb5 in PromiseReactionJob(JSContext*, unsigned int, JS::Value*) /js/src/builtin/Promise.cpp:2174:12
        #29 0x7fadfd37f376 in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /js/src/vm/Interpreter.cpp:459:13
        #30 0x7fadfd37ec9f in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:547:12
        #31 0x7fadfd3800cc 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:646:8
        #32 0x7fadfd43c20c 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
        #33 0x7fadf8175ade in mozilla::dom::PromiseJobCallback::Call(mozilla::dom::BindingCallContext&, JS::Handle<JS::Value>, mozilla::ErrorResult&) /builds/worker/workspace/obj-build/dom/bindings/PromiseBinding.cpp:83:8
        #34 0x7fadf5ca8fe5 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:198:12
        #35 0x7fadf5ca82a3 in Call /builds/worker/workspace/obj-build/dist/include/mozilla/dom/PromiseBinding.h:211:12
        #36 0x7fadf5ca82a3 in mozilla::PromiseJobRunnable::Run(mozilla::AutoSlowOperation&) /xpcom/base/CycleCollectedJSContext.cpp:213:18
        #37 0x7fadf5c95f88 in mozilla::CycleCollectedJSContext::PerformMicroTaskCheckPoint(bool) /xpcom/base/CycleCollectedJSContext.cpp:676:17
        #38 0x7fadf5c96dfc in mozilla::CycleCollectedJSContext::AfterProcessTask(unsigned int) /xpcom/base/CycleCollectedJSContext.cpp:463:3
        #39 0x7fadf6b71ee8 in XPCJSContext::AfterProcessTask(unsigned int) /js/xpconnect/src/XPCJSContext.cpp:1480:28
        #40 0x7fadf5dbd86a in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1234:24
        #41 0x7fadf5dc37cd in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:477:10
        #42 0x7fadf69c6743 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:107:5
        #43 0x7fadf68e8358 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:381:10
        #44 0x7fadf68e8261 in RunHandler /ipc/chromium/src/base/message_loop.cc:374:3
        #45 0x7fadf68e8261 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:356:3
        #46 0x7fadfaeedaf8 in nsBaseAppShell::Run() /widget/nsBaseAppShell.cpp:148:27
        #47 0x7fadfd134cfb in XRE_RunAppShell() /toolkit/xre/nsEmbedFunctions.cpp:742:20
        #48 0x7fadf69c7659 in mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:235:9
        #49 0x7fadf68e8358 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:381:10
        #50 0x7fadf68e8261 in RunHandler /ipc/chromium/src/base/message_loop.cc:374:3
        #51 0x7fadf68e8261 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:356:3
        #52 0x7fadfd134858 in XRE_InitChildProcess(int, char**, XREChildData const*) /toolkit/xre/nsEmbedFunctions.cpp:675:34
        #53 0x559248f12ce0 in content_process_main /browser/app/../../ipc/contentproc/plugin-container.cpp:57:28
        #54 0x559248f12ce0 in main /browser/app/nsBrowserApp.cpp:353:18
        #55 0x7fae09528d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
        #56 0x7fae09528e3f in __libc_start_main csu/../csu/libc-start.c:392:3
        #57 0x559248ee9348 in _start (/home/jkratzer/builds/m-c-20230127094652-fuzzing-debug/firefox-bin+0x5b348) (BuildId: 3dcd87d302507e33b27ddc81c1ad79da4ab2b653)
    
    UndefinedBehaviorSanitizer can not provide additional info.
    SUMMARY: UndefinedBehaviorSanitizer: SEGV /builds/worker/workspace/obj-build/dist/include/mozilla/Assertions.h:261:3 in MOZ_Crash
    ==180904==ABORTING
Attached file Testcase
Crash Signature: [@ wgpu_bindings::client::ProgrammableStageDescriptor::to_wgpu ]

Verified bug as reproducible on mozilla-central 20230127094652-f75c73066b88.
Unable to bisect testcase (Testcase reproduces on start build!):

Start: 7f00dabac085e45723ccdea1c7e7e2f61e273b30 (20220129091708)
End: f75c73066b887c2379158c73c994b5ef95460238 (20230127094652)
BuildFlags: BuildFlags(asan=False, tsan=False, debug=True, fuzzing=True, coverage=False, valgrind=False, no_opt=False, fuzzilli=False, nyx=False)

Whiteboard: [bugmon:confirm] → [bugmon:bisected,confirmed]

Testcase crashes using the initial build (mozilla-central 20230127094652-f75c73066b88) but not with tip (mozilla-central 20230203160655-a356e2d3cf46.)

The bug appears to have been fixed in the following build range:

Start: 591ee1cc97208fa579d150512368fcea2488fdfc (20230127215948)
End: f4f63f0138feb7535fa58c3f77fd8a51361371d8 (20230128112735)
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=591ee1cc97208fa579d150512368fcea2488fdfc&tochange=f4f63f0138feb7535fa58c3f77fd8a51361371d8

jkratzer, can you confirm that the above bisection range is responsible for fixing this issue?
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.

Flags: needinfo?(jkratzer)
Keywords: bugmon

Appears to have been fixed via bug 1799753.

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(jkratzer)
Resolution: --- → WORKSFORME
See Also: → 1799753
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: