Closed Bug 1783056 Opened 2 years ago Closed 2 years ago

Hit MOZ_CRASH(called `Result::unwrap()` on an `Err` value: UnalignedRangeSize { range_size: 30953 }) at gfx/wgpu_bindings/src/server.rs:391

Categories

(Core :: Graphics: WebGPU, defect)

x86_64
Linux
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: jkratzer, Unassigned)

References

(Blocks 2 open bugs)

Details

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

Attachments

(1 file)

3.61 KB, application/octet-stream
Details

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

Testcase can be reproduced using the following commands:

$ pip install fuzzfetch grizzly-framework
$ python -m fuzzfetch --build 2b0355f2d9f2 --debug --fuzzing -n firefox
$ python -m grizzly.replay ./firefox/firefox testcase.zip
Hit MOZ_CRASH(called `Result::unwrap()` on an `Err` value: UnalignedRangeSize { range_size: 30953 }) at gfx/wgpu_bindings/src/server.rs:391

    ==671728==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f7f752bb4e5 bp 0x7f7f582fa510 sp 0x7f7f582fa500 T671804)
    ==671728==The signal is caused by a WRITE memory access.
    ==671728==Hint: address points to the zero page.
        #0 0x7f7f752bb4e5 in MOZ_Crash /builds/worker/workspace/obj-build/dist/include/mozilla/Assertions.h:261:3
        #1 0x7f7f752bb4e5 in RustMozCrash /mozglue/static/rust/wrappers.cpp:18:3
        #2 0x7f7f752bb468 in mozglue_static::panic_hook::hc73c6ec992377969 /mozglue/static/rust/lib.rs:91:9
        #3 0x7f7f752baeeb in core::ops::function::Fn::call::h3d3ab1c02c30d6c6 /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/core/src/ops/function.rs:77:5
        #4 0x7f7f76278d85 in std::panicking::rust_panic_with_hook::hc82286af2030e925 /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:702:17
        #5 0x7f7f76278b86 in std::panicking::begin_panic_handler::_$u7b$$u7b$closure$u7d$$u7d$::h1c15057c2f09081f /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:588:13
        #6 0x7f7f76275d43 in std::sys_common::backtrace::__rust_end_short_backtrace::h65de906a5330f8da /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/sys_common/backtrace.rs:138:18
        #7 0x7f7f762788b8 in rust_begin_unwind /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/std/src/panicking.rs:584:5
        #8 0x7f7f6ba00222 in core::panicking::panic_fmt::h741cfbfc95bc6112 /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/core/src/panicking.rs:142:14
        #9 0x7f7f6ba00312 in core::result::unwrap_failed::h995262f85f9c4e2c /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/core/src/result.rs:1785:5
        #10 0x7f7f745ea377 in core::result::Result$LT$T$C$E$GT$::unwrap::h9d0843872ff75350 /rustc/a8314ef7d0ec7b75c336af2c9857bfaf43002bfc/library/core/src/result.rs:1078:23
        #11 0x7f7f745ea377 in wgpu_server_buffer_get_mapped_range /gfx/wgpu_bindings/src/server.rs:386:5
        #12 0x7f7f6f2055fa in mozilla::webgpu::MapCallback(mozilla::webgpu::ffi::WGPUBufferMapAsyncStatus, unsigned char*) /dom/webgpu/ipc/WebGPUParent.cpp:384:26
        #13 0x7f7f7469c135 in wgpu_core::resource::BufferMapCallback::call::h8906a3c69ab31146 /third_party/rust/wgpu-core/src/resource.rs:93:17
        #14 0x7f7f7469c135 in wgpu_core::device::UserClosures::fire::h505157ed6892429b /third_party/rust/wgpu-core/src/device/mod.rs:148:13
        #15 0x7f7f745d45da in wgpu_core::device::_$LT$impl$u20$wgpu_core..hub..Global$LT$G$GT$$GT$::poll_all_devices::hb2863d727a91f822 /third_party/rust/wgpu-core/src/device/mod.rs:5207:9
        #16 0x7f7f745d45da in wgpu_server_poll_all_devices /gfx/wgpu_bindings/src/server.rs:124:5
        #17 0x7f7f6f211253 in DispatchToMethod<mozilla::webgpu::WebGPUParent, void (mozilla::webgpu::WebGPUParent::*)()> /ipc/chromium/src/base/tuple.h:381:3
        #18 0x7f7f6f211253 in base::BaseTimer<mozilla::webgpu::WebGPUParent, true>::TimerTask::Run() /ipc/chromium/src/base/timer.h:157:7
        #19 0x7f7f6bd8b54b in mozilla::DelayedRunnable::Notify(nsITimer*) /xpcom/threads/DelayedRunnable.cpp:92:20
        #20 0x7f7f6bdd7f3c in operator() /xpcom/threads/nsTimerImpl.cpp:656:44
        #21 0x7f7f6bdd7f3c in matchN<mozilla::Variant<nsTimerImpl::UnknownCallback, nsCOMPtr<nsITimerCallback>, nsCOMPtr<nsIObserver>, nsTimerImpl::FuncCallback, nsTimerImpl::ClosureCallback> &, (lambda at /xpcom/threads/nsTimerImpl.cpp:656:7), (lambda at /xpcom/threads/nsTimerImpl.cpp:657:7), (lambda at /xpcom/threads/nsTimerImpl.cpp:660:7), (lambda at /xpcom/threads/nsTimerImpl.cpp:661:7)> /builds/worker/workspace/obj-build/dist/include/mozilla/Variant.h:309:16
        #22 0x7f7f6bdd7f3c in matchN<mozilla::Variant<nsTimerImpl::UnknownCallback, nsCOMPtr<nsITimerCallback>, nsCOMPtr<nsIObserver>, nsTimerImpl::FuncCallback, nsTimerImpl::ClosureCallback> &, (lambda at /xpcom/threads/nsTimerImpl.cpp:655:7), (lambda at /xpcom/threads/nsTimerImpl.cpp:656:7), (lambda at /xpcom/threads/nsTimerImpl.cpp:657:7), (lambda at /xpcom/threads/nsTimerImpl.cpp:660:7), (lambda at /xpcom/threads/nsTimerImpl.cpp:661:7)> /builds/worker/workspace/obj-build/dist/include/mozilla/Variant.h:318:14
        #23 0x7f7f6bdd7f3c in matchN<mozilla::Variant<nsTimerImpl::UnknownCallback, nsCOMPtr<nsITimerCallback>, nsCOMPtr<nsIObserver>, nsTimerImpl::FuncCallback, nsTimerImpl::ClosureCallback> &, (lambda at /xpcom/threads/nsTimerImpl.cpp:655:7), (lambda at /xpcom/threads/nsTimerImpl.cpp:656:7), (lambda at /xpcom/threads/nsTimerImpl.cpp:657:7), (lambda at /xpcom/threads/nsTimerImpl.cpp:660:7), (lambda at /xpcom/threads/nsTimerImpl.cpp:661:7)> /builds/worker/workspace/obj-build/dist/include/mozilla/Variant.h:902:12
        #24 0x7f7f6bdd7f3c in match<(lambda at /xpcom/threads/nsTimerImpl.cpp:655:7), (lambda at /xpcom/threads/nsTimerImpl.cpp:656:7), (lambda at /xpcom/threads/nsTimerImpl.cpp:657:7), (lambda at /xpcom/threads/nsTimerImpl.cpp:660:7), (lambda at /xpcom/threads/nsTimerImpl.cpp:661:7)> /builds/worker/workspace/obj-build/dist/include/mozilla/Variant.h:857:12
        #25 0x7f7f6bdd7f3c in nsTimerImpl::Fire(int) /xpcom/threads/nsTimerImpl.cpp:654:22
        #26 0x7f7f6bda743e in nsTimerEvent::Run() /xpcom/threads/TimerThread.cpp:365:11
        #27 0x7f7f6bdb3487 in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1199:16
        #28 0x7f7f6bdb99cd in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:465:10
        #29 0x7f7f6c98a464 in mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:330:5
        #30 0x7f7f6c8ae6f7 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:380:10
        #31 0x7f7f6c8ae602 in RunHandler /ipc/chromium/src/base/message_loop.cc:373:3
        #32 0x7f7f6c8ae602 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:355:3
        #33 0x7f7f6bdae7b6 in nsThread::ThreadFunc(void*) /xpcom/threads/nsThread.cpp:384:10
        #34 0x7f7f81ca1557 in _pt_root /nsprpub/pr/src/pthreads/ptthread.c:201:5
        #35 0x7f7f82a13608 in start_thread /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8
        #36 0x7f7f825da132 in __clone /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
    
    UndefinedBehaviorSanitizer can not provide additional info.
    SUMMARY: UndefinedBehaviorSanitizer: SEGV /builds/worker/workspace/obj-build/dist/include/mozilla/Assertions.h:261:3 in MOZ_Crash
    ==671728==ABORTING
Attached file Testcase

Bugmon Analysis
Verified bug as reproducible on mozilla-central 20220803212830-ae4cb105d717.
Unable to bisect testcase (Testcase reproduces on start build!):

Start: 6f4023442b769570b3a6ce02735c35aecf32b859 (20210805040801)
End: 2b0355f2d9f2fdf3b8dfb61e275eeb6e878f734b (20220803094413)
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]

Bugmon Analysis
Testcase crashes using the initial build (mozilla-central 20220803094413-2b0355f2d9f2) but not with tip (mozilla-central 20220812214215-fbae7216fa06.)

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

Start: 880cac21dca544a25fa34b5d0c6599d0fd240c17 (20220810143834)
End: bdb42cfe62138374343d5be83ac208826812cd2d (20220810161147)
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=880cac21dca544a25fa34b5d0c6599d0fd240c17&tochange=bdb42cfe62138374343d5be83ac208826812cd2d

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

:nical, could you confirm which bug is responsible for fixing this issue?

Flags: needinfo?(jkratzer) → needinfo?(nical.bugzilla)
Status: NEW → RESOLVED
Closed: 2 years ago
Depends on: 1777535
Flags: needinfo?(nical.bugzilla)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: