Closed Bug 1771507 Opened 2 years ago Closed 2 years ago

Assertion failure: nbytes > 0, at /js/src/vm/ArrayBufferObject.cpp:1899

Categories

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

x86_64
Linux
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: jkratzer, Unassigned)

References

(Blocks 2 open bugs)

Details

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

Attachments

(1 file)

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

Testcase can be reproduced using the following commands:

$ pip install fuzzfetch grizzly-framework
$ python -m fuzzfetch --build 914ead848de4 --debug --fuzzing -n firefox
$ python -m grizzly.replay ./firefox/firefox testcase.html
Assertion failure: nbytes > 0, at /js/src/vm/ArrayBufferObject.cpp:1899

    ==3043074==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f9e9f8ab5e0 bp 0x7ffd061b58e0 sp 0x7ffd061b5870 T3043074)
    ==3043074==The signal is caused by a WRITE memory access.
    ==3043074==Hint: address points to the zero page.
        #0 0x7f9e9f8ab5e0 in JS::NewExternalArrayBuffer(JSContext*, unsigned long, void*, void (*)(void*, void*), void*) /js/src/vm/ArrayBufferObject.cpp:1899:3
        #1 0x7f9e9b7570ef in mozilla::webgpu::Buffer::GetMappedRange(JSContext*, unsigned long, mozilla::dom::Optional<unsigned long> const&, JS::Rooted<JSObject*>*, mozilla::ErrorResult&) /dom/webgpu/Buffer.cpp:161:29
        #2 0x7f9e9acc148f in mozilla::dom::GPUBuffer_Binding::getMappedRange(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/WebGPUBinding.cpp:11846:24
        #3 0x7f9e9b3203ec 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:3271:13
        #4 0x7f9ea07b4b80 in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /js/src/vm/Interpreter.cpp:420:13
        #5 0x7f9ea07b438a in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:507:12
        #6 0x7f9e9fdace6f in js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICFallbackStub*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) /js/src/jit/BaselineIC.cpp:1582:10
        #7 0x1cf43f2d3212  (<unknown module>)
    
    UndefinedBehaviorSanitizer can not provide additional info.
    SUMMARY: UndefinedBehaviorSanitizer: SEGV /js/src/vm/ArrayBufferObject.cpp:1899:3 in JS::NewExternalArrayBuffer(JSContext*, unsigned long, void*, void (*)(void*, void*), void*)
    ==3043074==ABORTING
Attached file Testcase

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

Start: 6adf3e04d40e2a9a1a69dc06fe101dc5a54ef615 (20210528214803)
End: 914ead848de431dcd0f42c2fda013018704b29b9 (20220527092603)
BuildFlags: BuildFlags(asan=False, tsan=False, debug=True, fuzzing=True, coverage=False, valgrind=False, no_opt=False, fuzzilli=False)

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

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)

I can reproduce this in today's M-C (8e5247451c9a) in an --enable-debug build.

Flags: needinfo?(jimb)
Severity: -- → S3
Priority: -- → P2
Depends on: 1777413

Actually, fixing bug 1777413 is all it will take to fix this.

Jason, could we verify that this is fixed?

Flags: needinfo?(jkratzer)
Flags: needinfo?(jkratzer)
Whiteboard: [bugmon:bisected,confirmed] → [bugmon:bisected,confirmed,verify]

Bugmon Analysis
Verified bug as fixed on rev mozilla-central 20220707153100-68ec3d16cb3f.

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

Bugmon Analysis
Testcase crashes using the initial build (mozilla-central 20220527092603-914ead848de4) but not with tip (mozilla-central 20220708214204-74604ee44d4f.)

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

Start: 8d6b4f11ecdfef4b60fbd77291321fc784bb2630 (20220705212856)
End: 90c1ee100fc193dd04cae15994ccaf7d5b164cb5 (20220705202301)
Pushlog: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=8d6b4f11ecdfef4b60fbd77291321fc784bb2630&tochange=90c1ee100fc193dd04cae15994ccaf7d5b164cb5

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

As per comment 5, I think we can go ahead and close this.

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

Attachment

General

Created:
Updated:
Size: