Closed Bug 1908232 Opened 2 years ago Closed 2 years ago

Assertion failure: idx < storage_.size(), at /builds/worker/workspace/obj-build/dist/include/mozilla/Span.h:755

Categories

(Core :: Audio/Video: Web Codecs, defect)

x86_64
Linux
defect

Tracking

()

VERIFIED FIXED
130 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox129 --- unaffected
firefox130 --- verified

People

(Reporter: jkratzer, Assigned: padenot)

References

(Blocks 1 open bug)

Details

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

Crash Data

Attachments

(2 files)

Testcase found while fuzzing mozilla-central rev 2ed6b77c66d3 (built with: --enable-address-sanitizer --enable-fuzzing).

Testcase can be reproduced using the following commands:

$ pip install fuzzfetch grizzly-framework --upgrade
$ python -m fuzzfetch --build 2ed6b77c66d3 --asan --fuzzing  -n firefox
$ python -m grizzly.replay.bugzilla ./firefox/firefox <bugid>
Assertion failure: idx < storage_.size(), at /builds/worker/workspace/obj-build/dist/include/mozilla/Span.h:755

    =================================================================
    ==254108==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000001 (pc 0x7ca46cc57ac3 bp 0x7ffee7943220 sp 0x7ffee79431c0 T0)
    ==254108==The signal is caused by a WRITE memory access.
    ==254108==Hint: address points to the zero page.
        #0 0x7ca46cc57ac3 in operator[] /builds/worker/workspace/obj-build/dist/include/mozilla/Span.h:755:5
        #1 0x7ca46cc57ac3 in void mozilla::dom::CopySamples<unsigned char, float>(mozilla::Span<unsigned char, 18446744073709551615ul>, mozilla::Span<float, 18446744073709551615ul>, unsigned int, mozilla::dom::AudioSampleFormat, mozilla::dom::CopyToSpec const&) /dom/media/webcodecs/AudioData.cpp:453:9
        #2 0x7ca46cbd5db9 in operator()<mozilla::Span<float, 18446744073709551615UL> > /dom/media/webcodecs/AudioData.cpp:527:7
        #3 0x7ca46cbd5db9 in match<(lambda at /dom/media/webcodecs/AudioData.cpp:526:17), mozilla::Variant<mozilla::Span<unsigned char, 18446744073709551615UL>, mozilla::Span<short, 18446744073709551615UL>, mozilla::Span<int, 18446744073709551615UL>, mozilla::Span<float, 18446744073709551615UL> > &> /builds/worker/workspace/obj-build/dist/include/mozilla/Variant.h:189:14
        #4 0x7ca46cbd5db9 in match<(lambda at /dom/media/webcodecs/AudioData.cpp:526:17), mozilla::Variant<mozilla::Span<unsigned char, 18446744073709551615UL>, mozilla::Span<short, 18446744073709551615UL>, mozilla::Span<int, 18446744073709551615UL>, mozilla::Span<float, 18446744073709551615UL> > &> /builds/worker/workspace/obj-build/dist/include/mozilla/Variant.h:279:14
        #5 0x7ca46cbd5db9 in match<(lambda at /dom/media/webcodecs/AudioData.cpp:526:17), mozilla::Variant<mozilla::Span<unsigned char, 18446744073709551615UL>, mozilla::Span<short, 18446744073709551615UL>, mozilla::Span<int, 18446744073709551615UL>, mozilla::Span<float, 18446744073709551615UL> > &> /builds/worker/workspace/obj-build/dist/include/mozilla/Variant.h:279:14
        #6 0x7ca46cbd5db9 in match<(lambda at /dom/media/webcodecs/AudioData.cpp:526:17), mozilla::Variant<mozilla::Span<unsigned char, 18446744073709551615UL>, mozilla::Span<short, 18446744073709551615UL>, mozilla::Span<int, 18446744073709551615UL>, mozilla::Span<float, 18446744073709551615UL> > &> /builds/worker/workspace/obj-build/dist/include/mozilla/Variant.h:279:14
        #7 0x7ca46cbd5db9 in match<(lambda at /dom/media/webcodecs/AudioData.cpp:526:17)> /builds/worker/workspace/obj-build/dist/include/mozilla/Variant.h:852:12
        #8 0x7ca46cbd5db9 in operator()<mozilla::Span<unsigned char, 18446744073709551615UL> > /dom/media/webcodecs/AudioData.cpp:526:11
        #9 0x7ca46cbd5db9 in match<(lambda at /dom/media/webcodecs/AudioData.cpp:525:17), mozilla::Variant<mozilla::Span<unsigned char, 18446744073709551615UL>, mozilla::Span<short, 18446744073709551615UL>, mozilla::Span<int, 18446744073709551615UL>, mozilla::Span<float, 18446744073709551615UL> > &> /builds/worker/workspace/obj-build/dist/include/mozilla/Variant.h:266:16
        #10 0x7ca46cbd5db9 in match<(lambda at /dom/media/webcodecs/AudioData.cpp:525:17)> /builds/worker/workspace/obj-build/dist/include/mozilla/Variant.h:852:12
        #11 0x7ca46cbd5db9 in mozilla::dom::CopySamples(mozilla::Variant<mozilla::Span<unsigned char, 18446744073709551615ul>, mozilla::Span<short, 18446744073709551615ul>, mozilla::Span<int, 18446744073709551615ul>, mozilla::Span<float, 18446744073709551615ul>>&, mozilla::Variant<mozilla::Span<unsigned char, 18446744073709551615ul>, mozilla::Span<short, 18446744073709551615ul>, mozilla::Span<int, 18446744073709551615ul>, mozilla::Span<float, 18446744073709551615ul>>&, unsigned int, mozilla::dom::AudioSampleFormat, mozilla::dom::CopyToSpec const&) /dom/media/webcodecs/AudioData.cpp:525:11
        #12 0x7ca46cbd6712 in mozilla::dom::DoCopy(mozilla::Span<unsigned char, 18446744073709551615ul>, mozilla::Span<unsigned char, 18446744073709551615ul>, unsigned int, mozilla::dom::AudioSampleFormat, mozilla::dom::CopyToSpec const&) /dom/media/webcodecs/AudioData.cpp:538:3
        #13 0x7ca46cbda6da in mozilla::dom::AudioData::ToAudioData() const /dom/media/webcodecs/AudioData.cpp:729:3
        #14 0x7ca46cc23afc in CreateInputInternal /dom/media/webcodecs/AudioEncoder.cpp:365:17
        #15 0x7ca46cc23afc in mozilla::dom::EncoderTemplate<mozilla::dom::AudioEncoderTraits>::EncodeAudioData(mozilla::dom::AudioData&, mozilla::ErrorResult&) /dom/media/webcodecs/EncoderTemplate.cpp:158:7
        #16 0x7ca4692fbaa1 in mozilla::dom::AudioEncoder_Binding::encode(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/./AudioEncoderBinding.cpp:1188:38
        #17 0x7ca46aac6bd4 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:3268:13
        #18 0x7ca470ff1144 in CallJSNative /js/src/vm/Interpreter.cpp:491:13
        #19 0x7ca470ff1144 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:585:12
        #20 0x7ca471f7f610 in js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICFallbackStub*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) /js/src/jit/BaselineIC.cpp:1670:10
        #21 0x7ca3d80f0923  ([anon:js-executable-memory]+0x2923)
    
    AddressSanitizer can not provide additional info.
    SUMMARY: AddressSanitizer: SEGV /builds/worker/workspace/obj-build/dist/include/mozilla/Span.h:755:5 in operator[]
    ==254108==ABORTING
Attached file Testcase

Verified bug as reproducible on mozilla-central 20240716214815-41f5f11a27e6.
The bug appears to have been introduced in the following build range:

Start: ae67a0e098b4518b9760482c91ef32871a0153d7 (20240712095045)
End: 336d18e0fd55f78b598e776eea6a6de597f0392a (20240712090038)
Pushlog: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=ae67a0e098b4518b9760482c91ef32871a0153d7&tochange=336d18e0fd55f78b598e776eea6a6de597f0392a

Keywords: regression
Whiteboard: [bugmon:confirm] → [bugmon:bisected,confirmed]
Crash Signature: [@ mozilla::dom::CopySamples<T> ]
Flags: needinfo?(padenot)
Keywords: crash
See Also: → 1902555
Attachment #9413092 - Attachment mime type: text/plain → text/html
Flags: needinfo?(padenot)
Assignee: nobody → padenot
Status: NEW → ASSIGNED

Based on comment #2, this bug contains a bisection range found by bugmon. However, the Regressed by field is still not filled.

:padenot, if possible, could you fill the Regressed by field and investigate this regression?

For more information, please visit BugBot documentation.

Flags: needinfo?(padenot)

This bug has been marked as a regression. Setting status flag for Nightly to affected.

Pushed by padenot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/dc26c06c7447 Actually use the size of the allocated buffer in bytes when copying samples, remove useless size check. r=chunmin

Backed out for causing bustage on AudioData.cpp and whitespace lint failure on 1908231.html

Backout link

Push with failures

Failure log - bustage
Failure log - lint failure

Pushed by padenot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c59026d847f6 Actually use the size of the allocated buffer in bytes when copying samples, remove useless size check. r=chunmin

Verified bug as fixed on rev mozilla-central 20240726152430-e2a8e98f367a.
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
Flags: needinfo?(padenot)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: