Closed Bug 1731596 Opened 3 years ago Closed 2 years ago

Hit MOZ_CRASH(ArrayVec: capacity exceeded in extend/from_iter) at /third_party/rust/arrayvec/src/arrayvec.rs:1008

Categories

(Core :: Graphics: WebGPU, defect)

x86_64
Linux
defect

Tracking

()

VERIFIED FIXED
Tracking Status
firefox-esr78 --- unaffected
firefox-esr91 --- disabled
firefox93 --- disabled
firefox94 --- disabled
firefox95 --- disabled
firefox96 --- disabled
firefox97 --- fixed

People

(Reporter: jkratzer, Assigned: kvark)

References

(Blocks 2 open bugs, Regression)

Details

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

Attachments

(1 file)

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

Testcase can be reproduced using the following commands:

$ pip install fuzzfetch grizzly-framework
$ python -m fuzzfetch --build 29d6504debf5 --debug --fuzzing -n firefox
$ python -m grizzly.replay ./firefox/firefox testcase.html
Hit MOZ_CRASH(ArrayVec: capacity exceeded in extend/from_iter) at /third_party/rust/arrayvec/src/arrayvec.rs:1008

    ==1905155==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f7169f0c505 bp 0x7ffd28a41870 sp 0x7ffd28a41860 T1905155)
    ==1905155==The signal is caused by a WRITE memory access.
    ==1905155==Hint: address points to the zero page.
        #0 0x7f7169f0c505 in MOZ_Crash /builds/worker/workspace/obj-build/dist/include/mozilla/Assertions.h:256:3
        #1 0x7f7169f0c505 in RustMozCrash /mozglue/static/rust/wrappers.cpp:18:3
        #2 0x7f7169f0c484 in mozglue_static::panic_hook::h216d5f09042d10ab /mozglue/static/rust/lib.rs:91:9
        #3 0x7f7169f0befb in core::ops::function::Fn::call::h7b33fc64ef50c9e0 /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs:70:5
        #4 0x7f716ace0f08 in std::panicking::rust_panic_with_hook::h67c812a4fe9d4c91 /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:626:17
        #5 0x7f7169410455 in std::panicking::begin_panic::_$u7b$$u7b$closure$u7d$$u7d$::hfdda4f375ae5279e /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:542:9
        #6 0x7f716941040f in std::sys_common::backtrace::__rust_end_short_backtrace::hb2f9b795c8809e3d /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:141:18
        #7 0x7f7160dbda24 in std::panicking::begin_panic::h02b485762a1ddbc8 /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:541:12
        #8 0x7f7160dbda38 in arrayvec::arrayvec::extend_panic::hc16a31b3f23066bd /third_party/rust/arrayvec/src/arrayvec.rs:1008:5
        #9 0x7f716917b8c3 in arrayvec::arrayvec::ArrayVec$LT$T$C$_$GT$::extend_from_iter::h8ed4f8f7fcff0bfe /third_party/rust/arrayvec/src/arrayvec.rs:1039:46
        #10 0x7f716917b8c3 in _$LT$arrayvec..arrayvec..ArrayVec$LT$T$C$_$GT$$u20$as$u20$core..iter..traits..collect..Extend$LT$T$GT$$GT$::extend::ha693eceb19ab414d /third_party/rust/arrayvec/src/arrayvec.rs:1000:13
        #11 0x7f716917b8c3 in _$LT$arrayvec..arrayvec..ArrayVec$LT$T$C$_$GT$$u20$as$u20$core..iter..traits..collect..FromIterator$LT$T$GT$$GT$::from_iter::hd10033d65659d07b /third_party/rust/arrayvec/src/arrayvec.rs:1083:9
        #12 0x7f716917b8c3 in core::iter::traits::iterator::Iterator::collect::hdb1c66ef66482a13 /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/iter/traits/iterator.rs:1749:9
        #13 0x7f716917b8c3 in wgpu_core::command::bundle::RenderBundleEncoder::new::hdb72fc9da6426c83 /third_party/rust/wgpu-core/src/command/bundle.rs:100:29
        #14 0x7f71690c1dec in wgpu_device_create_render_bundle_encoder /gfx/wgpu_bindings/src/client.rs:633:11
        #15 0x7f7164545422 in mozilla::webgpu::CreateRenderBundleEncoder(unsigned long, mozilla::dom::GPURenderBundleEncoderDescriptor const&) /dom/webgpu/RenderBundleEncoder.cpp:59:10
        #16 0x7f716454555d in mozilla::webgpu::RenderBundleEncoder::RenderBundleEncoder(mozilla::webgpu::Device*, mozilla::webgpu::WebGPUChild*, mozilla::dom::GPURenderBundleEncoderDescriptor const&) /dom/webgpu/RenderBundleEncoder.cpp:66:16
        #17 0x7f716453b996 in mozilla::webgpu::Device::CreateRenderBundleEncoder(mozilla::dom::GPURenderBundleEncoderDescriptor const&) /dom/webgpu/Device.cpp:175:11
        #18 0x7f7163be79fc in mozilla::dom::GPUDevice_Binding::createRenderBundleEncoder(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/WebGPUBinding.cpp:17735:89
        #19 0x7f716421f748 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:3300:13
        #20 0x7f71679a69a0 in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /js/src/vm/Interpreter.cpp:401:13
        #21 0x7f71679a609e in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:488:12
        #22 0x7f71679a7a9e in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) /js/src/vm/Interpreter.cpp:548:10
        #23 0x7f716799d29d in CallFromStack /js/src/vm/Interpreter.cpp:552:10
        #24 0x7f716799d29d in Interpret(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:3255:16
        #25 0x7f7167993fe5 in js::RunScript(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:370:13
        #26 0x7f71679a5f97 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:520:13
        #27 0x7f71679a7a9e in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) /js/src/vm/Interpreter.cpp:548:10
        #28 0x7f71679a7ca1 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:565:8
        #29 0x7f7167dad550 in js::CallSelfHostedFunction(JSContext*, JS::Handle<js::PropertyName*>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>) /js/src/vm/SelfHosting.cpp:1538:10
        #30 0x7f7167b4a9c0 in AsyncFunctionResume(JSContext*, JS::Handle<js::AsyncFunctionGeneratorObject*>, ResumeKind, JS::Handle<JS::Value>) /js/src/vm/AsyncFunction.cpp:129:8
        #31 0x7f7167c7957e in AsyncFunctionPromiseReactionJob /js/src/builtin/Promise.cpp:1718:12
        #32 0x7f7167c7957e in PromiseReactionJob(JSContext*, unsigned int, JS::Value*) /js/src/builtin/Promise.cpp:1874:12
        #33 0x7f71679a69a0 in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /js/src/vm/Interpreter.cpp:401:13
        #34 0x7f71679a609e in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:488:12
        #35 0x7f71679a7a9e in InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason) /js/src/vm/Interpreter.cpp:548:10
        #36 0x7f71679a7ca1 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:565:8
        #37 0x7f7167b6ff93 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
        #38 0x7f71634e758c 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
        #39 0x7f7160fa59c5 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
        #40 0x7f7160fa4ddb in Call /builds/worker/workspace/obj-build/dist/include/mozilla/dom/PromiseBinding.h:102:12
        #41 0x7f7160fa4ddb in mozilla::PromiseJobRunnable::Run(mozilla::AutoSlowOperation&) /xpcom/base/CycleCollectedJSContext.cpp:213:18
        #42 0x7f7160f912e8 in mozilla::CycleCollectedJSContext::PerformMicroTaskCheckPoint(bool) /xpcom/base/CycleCollectedJSContext.cpp:674:17
        #43 0x7f7160f9204c in mozilla::CycleCollectedJSContext::AfterProcessTask(unsigned int) /xpcom/base/CycleCollectedJSContext.cpp:463:3
        #44 0x7f71623386d5 in XPCJSContext::AfterProcessTask(unsigned int) /js/xpconnect/src/XPCJSContext.cpp:1491:28
        #45 0x7f71610b8c6c in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1185:24
        #46 0x7f71610bf5fa in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:466:10
        #47 0x7f7161b1dc96 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:85:21
        #48 0x7f7161a3e3a7 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:331:10
        #49 0x7f7161a3e2b2 in RunHandler /ipc/chromium/src/base/message_loop.cc:324:3
        #50 0x7f7161a3e2b2 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:306:3
        #51 0x7f716599f148 in nsBaseAppShell::Run() /widget/nsBaseAppShell.cpp:137:27
        #52 0x7f716782ac23 in XRE_RunAppShell() /toolkit/xre/nsEmbedFunctions.cpp:917:20
        #53 0x7f7161b1eb8a in mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:235:9
        #54 0x7f7161a3e3a7 in MessageLoop::RunInternal() /ipc/chromium/src/base/message_loop.cc:331:10
        #55 0x7f7161a3e2b2 in RunHandler /ipc/chromium/src/base/message_loop.cc:324:3
        #56 0x7f7161a3e2b2 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:306:3
        #57 0x7f716782a25e in XRE_InitChildProcess(int, char**, XREChildData const*) /toolkit/xre/nsEmbedFunctions.cpp:749:34
        #58 0x5565205feb46 in content_process_main /browser/app/../../ipc/contentproc/plugin-container.cpp:57:28
        #59 0x5565205feb46 in main /browser/app/nsBrowserApp.cpp:327:18
        #60 0x7f71770ef0b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
        #61 0x5565205db94c in _start (/home/jkratzer/builds/mc-debug/firefox-bin+0x1594c)
    
    UndefinedBehaviorSanitizer can not provide additional info.
    SUMMARY: UndefinedBehaviorSanitizer: SEGV /builds/worker/workspace/obj-build/dist/include/mozilla/Assertions.h:256:3 in MOZ_Crash
    ==1905155==ABORTING
Attached file Testcase

Bugmon Analysis
Verified bug as reproducible on mozilla-central 20210920102201-29d6504debf5.
The bug appears to have been introduced in the following build range:

Start: 60c6b98b954e8d31353f9934e4b7c1581fd07d37 (20210903164901)
End: ef5dc3e04e5f271eea0636ab3a495e95cc912f1d (20210903165630)
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=60c6b98b954e8d31353f9934e4b7c1581fd07d37&tochange=ef5dc3e04e5f271eea0636ab3a495e95cc912f1d

Whiteboard: [bugmon:confirm] → [bugmon:bisected,confirmed]
Crash Signature: [@ arrayvec::arrayvec::extend_panic ]

To be addressed with the next wgpu update.

Assignee: nobody → dmalyshau
Crash Signature: [@ arrayvec::arrayvec::extend_panic ]

:kvark, since this bug contains a bisection range, could you fill (if possible) the regressed_by field?
For more information, please visit auto_nag documentation.

Flags: needinfo?(dmalyshau)

Not confident that the bisection got this right. The panicking code is the same, it was just moved around - https://hg.mozilla.org/integration/autoland/diff/ef5dc3e04e5f271eea0636ab3a495e95cc912f1d/gfx/wgpu/wgpu-core/src/command/bundle.rs#l1.103
The code came with bug 1710679, so this is what I'm putting here.

Flags: needinfo?(dmalyshau)
Regressed by: 1710679
Has Regression Range: --- → yes

Set release status flags based on info from the regressing bug 1710679

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

For more information, please visit auto_nag documentation.

Flags: needinfo?(dmalyshau)

Marking S3 because not enabled by default, and Nightly-only so far.

Severity: -- → S3
Flags: needinfo?(dmalyshau)

The fuzzers have been tripping over this for a while and it is triggered frequently. Marking as fuzzblocker.

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

Testcase is still a crasher, will look at it.

The original crash was fixed by https://github.com/gfx-rs/wgpu/pull/2004, which made it into Gecko. However, the crash wasn't handled by Gecko properly and turned into bug 1746312. The fix for this one is coming.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
See Also: → 1746312

Bugmon Analysis
Bug marked as FIXED but still reproduces on mozilla-central 20220104214425-3762abb6ee06.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → FIXED

Bugmon Analysis
Verified bug as fixed on rev mozilla-central 20220106034727-3321b8f93cb1.
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.

Status: RESOLVED → VERIFIED
Keywords: bugmon
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: