Closed Bug 1813113 Opened 1 year ago Closed 1 year ago

Hit MOZ_CRASH(attempt to add with overflow) at /third_party/rust/wgpu-core/src/command/transfer.rs:182

Categories

(Core :: Graphics: WebGPU, defect, P1)

x86_64
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 1816781

People

(Reporter: jkratzer, Assigned: teoxoy)

References

(Blocks 2 open bugs)

Details

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

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(attempt to add with overflow) at /third_party/rust/wgpu-core/src/command/transfer.rs:182

    ==184310==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f71532ea885 bp 0x7f70cecc5810 sp 0x7f70cecc5800 T184379)
    ==184310==The signal is caused by a WRITE memory access.
    ==184310==Hint: address points to the zero page.
        #0 0x7f71532ea885 in MOZ_Crash /builds/worker/workspace/obj-build/dist/include/mozilla/Assertions.h:261:3
        #1 0x7f71532ea885 in RustMozCrash /mozglue/static/rust/wrappers.cpp:18:3
        #2 0x7f71532ea802 in mozglue_static::panic_hook::h54d936b166c9baa9 /mozglue/static/rust/lib.rs:91:9
        #3 0x7f71532ea2cb in core::ops::function::Fn::call::hca13bd9519fdde34 /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/ops/function.rs:78:5
        #4 0x7f71543c2478 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 0x7f71543c2478 in std::panicking::rust_panic_with_hook::hfd45b6b6c12d9fa5 /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:692:13
        #6 0x7f71543c21b0 in std::panicking::begin_panic_handler::_$u7b$$u7b$closure$u7d$$u7d$::hf591e8609a75bd4b /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:577:13
        #7 0x7f71543bf52b in std::sys_common::backtrace::__rust_end_short_backtrace::h81899558795e4ff7 /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:137:18
        #8 0x7f71543c1f11 in rust_begin_unwind /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:575:5
        #9 0x7f7154418bd2 in core::panicking::panic_fmt::h4235fa9b4675b332 /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:65:14
        #10 0x7f7154418cac in core::panicking::panic::h9ced3cf2f605ba6a /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:115:5
        #11 0x7f71526b3dda in wgpu_server_queue_write_action /gfx/wgpu_bindings/src/server.rs
        #12 0x7f714cfd7413 in mozilla::webgpu::WebGPUParent::RecvQueueWriteAction(unsigned long, unsigned long, mozilla::ipc::ByteBuf const&, mozilla::ipc::UnsafeSharedMemoryHandle&&) /dom/webgpu/ipc/WebGPUParent.cpp:627:3
        #13 0x7f714cff031c in mozilla::webgpu::PWebGPUParent::OnMessageReceived(IPC::Message const&) /builds/worker/workspace/obj-build/ipc/ipdl/PWebGPUParent.cpp:1482:80
        #14 0x7f714af7d980 in mozilla::gfx::PCanvasManagerParent::OnMessageReceived(IPC::Message const&) /builds/worker/workspace/obj-build/ipc/ipdl/PCanvasManagerParent.cpp:214:32
        #15 0x7f714a59884a in mozilla::ipc::MessageChannel::DispatchAsyncMessage(mozilla::ipc::ActorLifecycleProxy*, IPC::Message const&) /ipc/glue/MessageChannel.cpp:1800:25
        #16 0x7f714a5954c7 in mozilla::ipc::MessageChannel::DispatchMessage(mozilla::ipc::ActorLifecycleProxy*, mozilla::UniquePtr<IPC::Message, mozilla::DefaultDelete<IPC::Message>>) /ipc/glue/MessageChannel.cpp:1725:9
        #17 0x7f714a595ff5 in mozilla::ipc::MessageChannel::RunMessage(mozilla::ipc::ActorLifecycleProxy*, mozilla::ipc::MessageChannel::MessageTask&) /ipc/glue/MessageChannel.cpp:1525:3
        #18 0x7f714a59732f in mozilla::ipc::MessageChannel::MessageTask::Run() /ipc/glue/MessageChannel.cpp:1623:14
        #19 0x7f7149995568 in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1191:16
        #20 0x7f714999b7cd in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:477:10
        #21 0x7f714a59f9c3 in mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:330:5
        #22 0x7f714a4c0358 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:381:10
        #23 0x7f714a4c0261 in RunHandler /ipc/chromium/src/base/message_loop.cc:374:3
        #24 0x7f714a4c0261 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:356:3
        #25 0x7f7149990a67 in nsThread::ThreadFunc(void*) /xpcom/threads/nsThread.cpp:383:10
        #26 0x7f715c8cec86 in _pt_root /nsprpub/pr/src/pthreads/ptthread.c:201:5
        #27 0x7f715d16fb42 in start_thread nptl/pthread_create.c:442:8
        #28 0x7f715d2019ff  misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
    
    UndefinedBehaviorSanitizer can not provide additional info.
    SUMMARY: UndefinedBehaviorSanitizer: SEGV /builds/worker/workspace/obj-build/dist/include/mozilla/Assertions.h:261:3 in MOZ_Crash
    ==184310==ABORTING
Attached file Testcase

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]

Marking as S3 because WebGPU is not enabled.

Blocking webgpu-in-nightly because overflow checks are not enabled for ordinary arithmetic in Rust code in release builds.

Severity: -- → S3
Priority: -- → P1
Assignee: nobody → ttanasoaia
Status: NEW → ASSIGNED

Should be fixed when we vendor next time (see https://github.com/gfx-rs/wgpu/pull/3487).

wgpu#3487 merged upstream as b33731c4.

With that change, this test case elicits the benign JS error:

destination buffer/texture is missing the `COPY_DST` usage flag 
Whiteboard: [bugmon:bisected,confirmed] → [bugmon:verify]
Whiteboard: [bugmon:verify] → [bugmon:bisected,confirmed,verify]

I believe this has been fixed by Bug 1816781.

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

Testcase crashes using the initial build (mozilla-central 20230127094652-f75c73066b88) but not with tip (mozilla-central 20230217091713-41710d48be48.)

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

Start: 5e840329fc3930c3221c8b997197bde990caca13 (20230215171027)
End: 20c40d607f5ac4abaf9f617381d1f902434a616d (20230215181617)
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=5e840329fc3930c3221c8b997197bde990caca13&tochange=20c40d607f5ac4abaf9f617381d1f902434a616d

teoxoy, 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?(ttanasoaia)
Keywords: bugmon
Whiteboard: [bugmon:bisected,confirm] → [bugmon:bisected,confirmed]
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Duplicate of bug: 1816781
Resolution: --- → DUPLICATE

teoxoy, can you confirm that the above bisection range is responsible for fixing this issue?

Yes, fix landed as part of 1816781.

Flags: needinfo?(ttanasoaia)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: