Crash [@ js::NativeObject::setDenseInitializedLengthInternal]
Categories
(Core :: JavaScript Engine: JIT, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox123 | --- | wontfix |
firefox124 | --- | wontfix |
firefox125 | --- | fixed |
People
(Reporter: gkw, Assigned: jonco)
References
(Blocks 1 open bug, Regression)
Details
(4 keywords, Whiteboard: [adv-main125+])
Attachments
(3 files)
for (let x = 0; x < 2; (function() { x++; })()) {};
function f() {
var y = new (function () {})();
(function () {
Reflect.apply(y.toString, [], [0]);
})();
}
f();
var z = [];
z.keepFailing = [];
oomTest(f, z);
dumpHeap();
(gdb) bt
#0 js::NativeObject::setDenseInitializedLengthInternal (this=0x8ce34b412f8, length=0) at /home/yksubu/trees/mozilla-central/js/src/vm/NativeObject.h:1477
#1 0x0000555557ee776a in js::NativeObject::setDenseInitializedLength (this=0x8ce34b412f8, length=0) at /home/yksubu/trees/mozilla-central/js/src/vm/NativeObject.h:1483
#2 js::jit::ShapeListObject::traceWeak (this=0x8ce34b412f8, trc=<optimized out>) at /home/yksubu/trees/mozilla-central/js/src/jit/BaselineCacheIRCompiler.cpp:2188
#3 0x000055555752369e in JSClass::doTrace (trc=0x7fffffffc780, obj=0x8ce34b412f8, this=<optimized out>) at /home/yksubu/shell-cache/js-dbg-64-linux-x86_64-f8dd4015fa59/objdir-js/dist/include/js/Class.h:653
#4 JSObject::traceChildren (this=0x8ce34b412f8, trc=0x7fffffffc780) at /home/yksubu/trees/mozilla-central/js/src/vm/JSObject.cpp:3343
#5 0x0000555557d687fb in JS::TraceChildren(JSTracer*, JS::GCCellPtr)::$_0::operator()<JSObject*>(JSObject*) const (t=0x8ce34b412f8, this=<optimized out>) at /home/yksubu/trees/mozilla-central/js/src/gc/Tracer.cpp:62
#6 JS::MapGCThingTyped<JS::TraceChildren(JSTracer*, JS::GCCellPtr)::$_0>(void*, JS::TraceKind, JS::TraceChildren(JSTracer*, JS::GCCellPtr)::$_0&&) (thing=0x8ce34b412f8, traceKind=<optimized out>, f=...) at /home/yksubu/shell-cache/js-dbg-64-linux-x86_64-f8dd4015fa59/objdir-js/dist/include/js/TraceKind.h:253
#7 JS::ApplyGCThingTyped<JS::TraceChildren(JSTracer*, JS::GCCellPtr)::$_0>(void*, JS::TraceKind, JS::TraceChildren(JSTracer*, JS::GCCellPtr)::$_0&&) (thing=0x8ce34b412f8, traceKind=<optimized out>, f=...) at /home/yksubu/shell-cache/js-dbg-64-linux-x86_64-f8dd4015fa59/objdir-js/dist/include/js/TraceKind.h:268
#8 JS::TraceChildren (trc=trc@entry=0x7fffffffc780, thing=...) at /home/yksubu/trees/mozilla-central/js/src/gc/Tracer.cpp:59
/snip
(Edit: see comment 2 for the real regressor)
Run with --fuzzing-safe --no-threads --ion-eager
, compile with AR=ar sh ../configure --enable-debug --enable-debug-symbols --with-ccache --enable-nspr-build --enable-ctypes --enable-gczeal --enable-rust-simd --disable-tests
, tested on m-c rev f8dd4015fa59.
Setting s-s to be safe. I'll set needinfo? from Jan as a start.
Reporter | ||
Comment 1•7 months ago
|
||
(Also not sure if this is a JIT or a GC issue, but I'll let Jan decide)
Reporter | ||
Comment 2•7 months ago
|
||
I've got something clearer now.
The first bad revision is:
changeset: https://hg.mozilla.org/mozilla-central/rev/9882c0d924b8
user: Jon Coppeard
date: Fri Jul 07 17:05:44 2023 +0000
summary: Bug 1837620 - Part 6: Make edges for multiple shape guard weak too r=sfink
Jon, is bug 1837620 a likely regressor?
Comment 3•7 months ago
|
||
Set release status flags based on info from the regressing bug 1837620
Updated•7 months ago
|
Updated•7 months ago
|
Assignee | ||
Comment 4•7 months ago
|
||
I haven't had a change to look into this yet, but it probably depends on dumpHeap() touching otherwise unreachable objects.
Assignee | ||
Comment 5•7 months ago
|
||
This crash requires dumping the heap. The testcase does this with the dumpHeap() function that's not present in release builds but it could probably also be done using the facilitles present in about:memory. I'm therefore marking this as sec-moderate.
Assignee | ||
Comment 6•7 months ago
|
||
The crash happens because we try to set the dense elements length of an object
that's using the empty elements header. We can skip tracing if there are no
elements.
Normally there we wouldn't create an empty shape list but this can happen due
to OOM as these are being initialized.
Comment 8•7 months ago
|
||
Updated•7 months ago
|
Comment 9•7 months ago
|
||
The patch landed in nightly and beta is affected.
:jonco, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox124
towontfix
.
For more information, please visit BugBot documentation.
Updated•7 months ago
|
Assignee | ||
Comment 10•7 months ago
|
||
Comment on attachment 9382249 [details]
Bug 1881417 - Skip tracing empty shape lists that may be present due to OOM r?jandem
Beta/Release Uplift Approval Request
- User impact if declined: Possible crash / security vulnerability.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): This is a very simple change and has been on nightly for a week.
- String changes made/needed: None
- Is Android affected?: Yes
Comment hidden (obsolete) |
Comment 12•7 months ago
|
||
uplift |
Updated•7 months ago
|
Comment 13•7 months ago
|
||
Backing out of beta (for 124.0b8) for causing test failures
ReferenceError: oomTest is not defined
Failure log
Backout push
Updated•7 months ago
|
Updated•7 months ago
|
Assignee | ||
Comment 14•7 months ago
|
||
Comment on attachment 9382249 [details]
Bug 1881417 - Skip tracing empty shape lists that may be present due to OOM r?jandem
TBH this is not super important to uplift and the end of the train is close anyway. Cancelling uplift request.
Assignee | ||
Updated•7 months ago
|
Updated•6 months ago
|
Reporter | ||
Updated•6 months ago
|
Updated•6 months ago
|
Comment 15•5 months ago
|
||
Updated•5 months ago
|
Updated•4 months ago
|
Updated•7 days ago
|
Description
•