Crash in [@ NewArrayBufferObject<T>]
Categories
(Core :: DOM: Bindings (WebIDL), defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox128 | --- | affected |
People
(Reporter: release-mgmt-account-bot, Unassigned)
References
(Blocks 2 open bugs)
Details
(Keywords: crash)
Crash Data
Crash report: https://crash-stats.mozilla.org/report/index/7b442581-40f8-45a7-b9a5-526fb0240518
MOZ_CRASH Reason: MOZ_DIAGNOSTIC_ASSERT(!cx->brittleMode) (create NativeObject failed)
Top 10 frames of crashing thread:
0 xul.dll NewArrayBufferObject<js::FixedLengthArrayBufferObject> js/src/vm/ArrayBufferObject.cpp:1788
1 xul.dll js::ArrayBufferObject::createUninitializedBufferAndData js/src/vm/ArrayBufferObject.cpp:1916
1 xul.dll js::ArrayBufferObject::createBufferAndData<0> js/src/vm/ArrayBufferObject.cpp:1943
2 xul.dll js::ArrayBufferObject::createZeroed js/src/vm/ArrayBufferObject.cpp:2273
3 xul.dll js::TypedArrayObject::ensureHasBuffer js/src/vm/TypedArrayObject.cpp:149
4 xul.dll js::ArrayBufferViewObject::ensureBufferObject js/src/vm/ArrayBufferViewObject.cpp:112
5 xul.dll js::ArrayBufferViewObject::ensureNonInline js/src/vm/ArrayBufferViewObject.cpp:97
6 xul.dll JS::EnsureNonInlineArrayBufferOrView js/src/vm/ArrayBufferViewObject.cpp:620
7 xul.dll mozilla::dom::TypedArray_base<JS::ArrayBufferView>::ProcessFixedData const dom/bindings/TypedArray.h:678
7 xul.dll mozilla::dom::Crypto::GetRandomValues dom/base/Crypto.cpp:90
By querying Nightly crashes reported within the last 2 months, here are some insights about the signature:
- First crash report: 2024-05-18
- Process type: Content
- Is startup crash: No
- Has user comments: No
- Is null crash: No
By analyzing the backtrace, the regression may have been introduced by a patch [1] to fix Bug 1891118.
[1] https://hg.mozilla.org/mozilla-central/rev?node=f90cb77b7d69
:sfink, since you are the author of the potential regressor, could you please take a look?
Updated•2 years ago
|
Comment 1•2 years ago
|
||
This is not a regression. We're adding diagnostics code for bug 1856672, and that's just changing the crash signatures for those crashes. I'll leave this open for now, until we verify what this shows us about bug 1856672.
Comment 2•2 years ago
|
||
Steve, looks like we're running out of memory allocating the array buffer object? AFAICT in the non-Android crashes there should still be enough memory available though.
| Reporter | ||
Comment 4•2 years ago
|
||
Copying crash signatures from duplicate bugs.
| Reporter | ||
Comment 5•2 years ago
|
||
The bug is linked to a topcrash signature, which matches the following criteria:
- Top 20 desktop browser crashes on beta
- Top 10 content process crashes on beta
For more information, please visit BugBot documentation.
| Reporter | ||
Comment 6•2 years ago
|
||
Based on the topcrash criteria, the crash signatures linked to this bug are not in the topcrash signatures anymore.
For more information, please visit BugBot documentation.
Updated•1 year ago
|
Comment 7•3 months ago
|
||
Crash report: https://crash-stats.mozilla.org/report/index/1a02e8aa-01ae-43e0-837e-d1b850260813
MOZ_CRASH Reason:
MOZ_DIAGNOSTIC_ASSERT(!cx->brittleMode) (create NativeObject failed)
Top 10 frames:
0 XUL NewArrayBufferObject<js::FixedLengthArrayBufferObject>(JSContext*, JS::Handle<JS... js/src/vm/ArrayBufferObject.cpp:2250
1 XUL js::ArrayBufferObject::createBufferAndData<js::FixedLengthArrayBufferObject, (js... js/src/vm/ArrayBufferObject.cpp:2459
2 XUL js::ArrayBufferObject::createZeroed(JSContext*, unsigned long, JS::Handle<JSObje... js/src/vm/ArrayBufferObject.cpp:2805
3 XUL js::TypedArrayObject::ensureHasBuffer(JSContext*, JS::Handle<js::TypedArrayObjec... js/src/vm/TypedArrayObject.cpp:158
4 XUL js::ArrayBufferViewObject::ensureNonInline(JSContext*, JS::Handle<js::ArrayBuffe... js/src/vm/ArrayBufferViewObject.cpp:101
5 XUL JS::EnsureNonInlineArrayBufferOrView(JSContext*, JSObject*) js/src/vm/ArrayBufferViewObject.cpp:615
6 XUL mozilla::dom::Crypto::GetRandomValues(JSContext*, mozilla::dom::ArrayBufferView_... dom/base/Crypto.cpp:66
7 XUL mozilla::dom::Crypto_Binding::getRandomValues(JSContext*, JS::Handle<JSObject*>,... dom/bindings/CryptoBinding.cpp:113
8 XUL mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::Normal... dom/bindings/BindingUtils.cpp:3216
9 XUL js::Interpret(JSContext*, js::RunState&) js/src/vm/Interpreter.cpp:3300
There are 6 crashes (from 4 installations) in nightly 155 starting with buildid 20260809214638.
Clouseau analysis (automated, 97% worth investigating — a calibrated estimate that this is worth someone's time, not that the changeset below caused it). The mechanism below fits the evidence but is not proven end-to-end:
The crash is a deliberate MOZ_DIAGNOSTIC_ASSERT(!cx->brittleMode, "create NativeObject failed") trap (added in bug 1891118) that TypedArray_base::ProcessFixedData arms via JS::AutoBrittleMode specifically to convert crypto.getRandomValues()'s underlying ArrayBuffer allocation failures into diagnosable crashes instead of silent JS exceptions.
The same engineer (Steve Fink) actively touched this exact dom/bindings/TypedArray.h / ArrayBuffer brittle-mode diagnostic path twice in the ~3 weeks before this build (bug 2044843 on 2026-07-20, bug 2052472 on 2026-07-21), indicating an ongoing, live investigation into precisely this failure family — a strong domain link, though not proof of a specific new regressor.
Starting point — NOT a suspected cause: f90cb77b7d69 (bug 1891118) by Steve Fink.
This changeset did not land in this build's pushlog window, so there is no evidence here that the crash is a recent regression from it; it is named only as the closest thing found on the crash path. If you know where this actually comes from, that correction is the most useful thing you could leave on this bug.
Code references:
What the automated skeptic pass checked (its own words — a pass means the check succeeded, which is not always support for the conclusion):
- unverifiable candidate — This is not a claim that bug 1891118 (2024) or the recent 2044843/2052472 follow-ups caused a regression — they are cited as the origin/owner of the diagnostic mechanism itself, which is the most useful pointer for a human, but the true root cause (why the allocation actually failed) remains unproven.
- pass seed-candidates-are-noise — Bug 2061751 touches only
xpcom/base/CycleCollectedJSContext.cpp(profiler flow-marker reindent); bug 2056804 touches only layout content-visibility bookkeeping. Neither has a mechanism to reach GC/allocator/ArrayBuffer state. - pass mechanism — Re-derived independently: ProcessFixedData sets AutoBrittleMode, calls EnsureNonInlineArrayBufferOrView, which reaches ArrayBufferViewObject::ensureNonInline/ensureBufferObject matching stack frames #4/#5 exactly; the assert at line 2250 only trips when NativeObject::create fails.
:sfink, can you have a look please?
Filed automatically by Clouseau, which analyses nightly crashes with an LLM. Nothing above was written or checked by a human. Please close it as INVALID if it is wrong — that is useful feedback, not a nuisance.
Updated•3 months ago
|
Comment 8•2 months ago
|
||
This is a failure to allocate a small ArrayBuffer object, which is a tenured-only allocation. That's an OOM from either trying to allocate a new 1MB chunk of memory, or from hitting our max GC heap size. There are 12GB of RAM available on a 64GB system according to the crash report, so the actual OOM seems unlikely.
The crash report has the JSOutOfMemory annotation, documented as "we crashed after having tried to free some memory". Or in more detail:
// If a crash report contains "JSOutOfMemory: Reported", that means a small
// allocation failed, and then we crashed, probably due to buggy
// error-handling code that ran after allocation returned null.
which is kind of what's going on here; ProcessFixedData has no error-reporting mechanism. So arguably it would be useful to make this fallible. (The reason why it might not be useful is if we're going to OOM soon anyway, then recovering here wouldn't do any good.)
My main conclusion from this bug is that we should have the GC heap size in the crash report somewhere. Though it's per-runtime, so perhaps the largest heap? Or just a "failed due to hitting Zone or JSRuntime heap size limit" boolean canary. Making things fallible and trying to handle failure isn't going to help much. In fact, it might be better to crash the content process right now, to avoid thrashing and slowing down the whole system. Optimally, we would have a doorhanger "this tab is feeling bloated. Put it out of its misery? (y/n)" dialog, to allow a controlled tab crash.
I would rather watch for the frequency of this bug to rise than do the fallible thing. It'd make a messy interface messier, and the overhead of handling failure isn't worth the probably momentary benefit.
Description
•