Assertion failure: WeakMapBase::checkMarkingForZone(zone), at js/src/gc/Sweeping.cpp:1236 with Debugger
Categories
(Core :: JavaScript Engine, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr128 | --- | unaffected |
| firefox-esr140 | --- | wontfix |
| firefox138 | --- | unaffected |
| firefox139 | --- | unaffected |
| firefox140 | --- | wontfix |
| firefox141 | --- | wontfix |
| firefox142 | --- | wontfix |
| firefox143 | --- | wontfix |
| firefox144 | --- | fixed |
People
(Reporter: decoder, Assigned: sfink)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: assertion, regression, testcase, Whiteboard: [bugmon:update,bisected,confirmed])
Attachments
(2 files, 1 external file, 1 obsolete file)
The following testcase crashes on mozilla-central revision 20250511-e473aa82ffe1 (debug build, run with --fuzzing-safe --ion-offthread-compile=off --more-compartments):
enqueueMark('set-color-gray');
setMarkStackLimit(1);
a = newGlobal();
b = new Debugger;
b.addDebuggee(a)
gczeal(11);
gczeal(9, 6) = c;
Backtrace:
received signal SIGSEGV, Segmentation fault.
#0 0x00005555579e3a37 in js::gc::GCRuntime::endMarkingSweepGroup(JS::GCContext*, JS::SliceBudget&) ()
#1 0x0000555557a1dcc5 in sweepaction::SweepActionSequence::run(js::gc::SweepAction::Args&) ()
#2 0x0000555557a08b52 in sweepaction::SweepActionForEach<js::gc::SweepGroupsIter, JSRuntime*>::run(js::gc::SweepAction::Args&) ()
#3 0x00005555579efec2 in js::gc::GCRuntime::performSweepActions(JS::SliceBudget&) ()
#4 0x0000555557955bf7 in js::gc::GCRuntime::incrementalSlice(JS::SliceBudget&, JS::GCReason, bool) ()
#5 0x0000555557959593 in js::gc::GCRuntime::gcCycle(bool, JS::SliceBudget const&, JS::GCReason) ()
#6 0x000055555795ae04 in js::gc::GCRuntime::collect(bool, JS::SliceBudget const&, JS::GCReason) ()
#7 0x000055555795e1f2 in js::gc::GCRuntime::runDebugGC() ()
#8 0x0000555556fed053 in void* js::gc::CellAllocator::AllocNurseryOrTenuredCell<(JS::TraceKind)0, (js::AllowGC)1>(JSContext*, js::gc::AllocKind, unsigned long, js::gc::Heap, js::gc::AllocSite*) ()
#9 0x0000555556fece47 in js::NativeObject* js::gc::CellAllocator::NewObject<js::NativeObject, (js::AllowGC)1>(JSContext*, js::gc::AllocKind, js::gc::Heap, JSClass const*, js::gc::AllocSite*) ()
#10 0x000055555724996b in JSFunction::create(JSContext*, js::gc::AllocKind, js::gc::Heap, JS::Handle<js::SharedShape*>, js::gc::AllocSite*) ()
#11 0x00005555572491de in js::NewFunctionWithProto(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), unsigned int, js::FunctionFlags, JS::Handle<JSObject*>, JS::Handle<JSAtom*>, JS::Handle<JSObject*>, js::gc::AllocKind, js::NewObjectKind) ()
#12 0x00005555573705c9 in DefineAccessorPropertyById(JSContext*, JS::Handle<JSObject*>, JS::Handle<JS::PropertyKey>, JSNativeWrapper const&, JSNativeWrapper const&, unsigned int) ()
#13 0x00005555573761c0 in JS_DefineProperties(JSContext*, JS::Handle<JSObject*>, JSPropertySpec const*) ()
#14 0x00005555571e2892 in js::GlobalObject::resolveConstructor(JSContext*, JS::Handle<js::GlobalObject*>, JSProtoKey, js::GlobalObject::IfClassIsDisabled) ()
#15 0x000055555739a3a4 in js::GlobalObject::getOrCreateSavedFramePrototype(JSContext*, JS::Handle<js::GlobalObject*>) ()
#16 0x000055555739a0c0 in js::SavedFrame::create(JSContext*) ()
#17 0x00005555573a35bc in js::SavedStacks::createFrameFromLookup(JSContext*, JS::Handle<js::SavedFrame::Lookup>) ()
#18 0x00005555573a3252 in js::SavedStacks::getOrCreateSavedFrame(JSContext*, JS::Handle<js::SavedFrame::Lookup>) ()
#19 0x00005555573a0156 in js::SavedStacks::insertFrames(JSContext*, JS::MutableHandle<js::SavedFrame*>, mozilla::Variant<JS::AllFrames, JS::MaxFrames, JS::FirstSubsumedFrame>&&, JS::Handle<JSObject*>) ()
#20 0x000055555739efae in js::SavedStacks::saveCurrentStack(JSContext*, JS::MutableHandle<js::SavedFrame*>, mozilla::Variant<JS::AllFrames, JS::MaxFrames, JS::FirstSubsumedFrame>&&, JS::Handle<JSObject*>) ()
#21 0x0000555557631495 in JS::CaptureCurrentStack(JSContext*, JS::MutableHandle<JSObject*>, mozilla::Variant<JS::AllFrames, JS::MaxFrames, JS::FirstSubsumedFrame>&&, JS::Handle<JSObject*>) ()
#22 0x0000555557636d8b in js::ErrorToException(JSContext*, JSErrorReport*, JSErrorFormatString const* (*)(void*, unsigned int), void*) ()
#23 0x00005555571cfd0b in js::ReportErrorNumberVA(JSContext*, js::IsWarning, JSErrorFormatString const* (*)(void*, unsigned int), void*, unsigned int, js::ErrorArgumentsType, __va_list_tag*) ()
#24 0x0000555557613f9e in JS_ReportErrorNumberASCII(JSContext*, JSErrorFormatString const* (*)(void*, unsigned int), void*, unsigned int, ...) ()
#25 0x000055555705ed07 in js::ThrowMsgOperation(JSContext*, unsigned int) ()
#26 0x0000555557053253 in js::Interpret(JSContext*, js::RunState&) ()
[...]
#35 0x0000555556ebe13e in main ()
rax 0x0 0
rbx 0x0 0
rcx 0x4d4 1236
rdx 0x1 1
rsi 0x0 0
rdi 0x7ffff7bee7d0 140737349871568
rbp 0x7fffffffb6a0 140737488336544
rsp 0x7fffffffb630 140737488336432
r8 0x0 0
r9 0x3 3
r10 0x0 0
r11 0x0 0
r12 0x7ffff46fcc78 140737294355576
r13 0xc 12
r14 0x7ffff4630898 140737293519000
r15 0x7ffff46fc000 140737294352384
rip 0x5555579e3a37 <js::gc::GCRuntime::endMarkingSweepGroup(JS::GCContext*, JS::SliceBudget&)+1447>
=> 0x5555579e3a37 <_ZN2js2gc9GCRuntime20endMarkingSweepGroupEPN2JS9GCContextERNS2_11SliceBudgetE+1447>: mov %rcx,(%rax)
0x5555579e3a3a <_ZN2js2gc9GCRuntime20endMarkingSweepGroupEPN2JS9GCContextERNS2_11SliceBudgetE+1450>: callq 0x555556f58910 <abort>
Involves the debugger, so sec-moderate at most, but marking s-s due to GC issue.
| Reporter | ||
Comment 1•1 year ago
|
||
| Reporter | ||
Comment 2•1 year ago
|
||
Comment 3•1 year ago
|
||
Verified bug as reproducible on mozilla-central 20250511205430-e473aa82ffe1.
The bug appears to have been introduced in the following build range:
Start: 7fdd48624d2c98be08c7abfe6f76796aba39cb27 (20250506003741)
End: 068fac7010fc9f186c9e50132122afbedcb20ce4 (20250506010647)
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=7fdd48624d2c98be08c7abfe6f76796aba39cb27&tochange=068fac7010fc9f186c9e50132122afbedcb20ce4
Comment 4•1 year ago
|
||
Bug 1851579 looks like the only thing in that range that could cause problems, but that's just a verifier change.
Comment 5•1 year ago
|
||
Steve could you take a look given the finger points at your patch (the finger could of course be wrong)
| Assignee | ||
Comment 6•1 year ago
|
||
At first glance, I'm guessing the finger is correct. Though this is almost certainly going to be test-only.
Updated•1 year ago
|
Comment 7•1 year ago
|
||
Set release status flags based on info from the regressing bug 1851579
Updated•1 year ago
|
Comment 8•1 year ago
|
||
(In reply to Steve Fink [:sfink] [:s:] from comment #6)
At first glance, I'm guessing the finger is correct. Though this is almost certainly going to be test-only.
Next week is the final week of beta for Fx140
:sfink will this be addressed in time?
Updated•1 year ago
|
Comment 9•1 year ago
|
||
Testcase crashes using the initial build (mozilla-central 20250511205430-e473aa82ffe1) but not with tip (mozilla-central 20250627160956-c3bc8b9da99f.)
The bug appears to have been fixed in the following build range:
Start: 262215ce9b5579f207c98d8554ee9cf02613f6d3 (20250627092534)
End: c97bb928f6928fe1cf250b4705dda7e5fe78512b (20250627094459)
Pushlog: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=262215ce9b5579f207c98d8554ee9cf02613f6d3&tochange=c97bb928f6928fe1cf250b4705dda7e5fe78512b
decoder, 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.
| Reporter | ||
Comment 10•1 year ago
|
||
I don't see anything sticking out here, restoring original needinfo to figure out if this is really fixed.
Updated•1 year ago
|
| Assignee | ||
Comment 11•1 year ago
|
||
(looking at this now)
| Assignee | ||
Comment 12•1 year ago
|
||
fwiw, I see the same crash with the current f-m tip (6c6b1981) as well as any other revision I've tried after the one reported here. I did modify the test case very slightly to avoid the need for passing any command-line flags:
enqueueMark('set-color-gray');
setMarkStackLimit(1);
a = newGlobal({ newCompartment: true });
b = new Debugger;
b.addDebuggee(a)
gczeal(11);
gczeal(9, 6) = c;
The problem is that we're validating incremental mark bits against a nonincremental marking pass, except that the incremental pass hasn't made it to the place where it would finish up marking WeakMaps. I'm not sure why this doesn't fail all the time, easily. Looking into it.
Updated•1 year ago
|
| Assignee | ||
Comment 13•1 year ago
|
||
Wow, I totally went barking up the wrong tree on this one. The problem is simple: when doing the non-incremental mark pass, we first save off the mark bits and clear them. In bug 1851579, I added a check that skips the verification if the test mark queue is nonempty. But it does this after the mark bits have been cleared. So the main incremental marking is missing some bits (ephemeron bits, to be precise).
This is not a security issue. It does produce UAFs, but only when using a test function that is not exposed anywhere.
| Assignee | ||
Comment 14•1 year ago
|
||
Updated•1 year ago
|
Comment 15•1 year ago
|
||
Comment 16•1 year ago
|
||
Comment 17•1 year ago
|
||
Backed out for causing build bustages @bug1965748.js.
| Assignee | ||
Comment 18•1 year ago
|
||
Gah. I do this every time. The test case originally crashed, I made it just fail, I didn't tell jit-test.
Comment 19•1 year ago
|
||
Comment 20•1 year ago
|
||
| bugherder | ||
Comment 21•1 year ago
|
||
The patch landed in nightly and beta is affected.
:sfink, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox143towontfix.
For more information, please visit BugBot documentation.
Updated•1 year ago
|
| Assignee | ||
Comment 23•1 year ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D261150
Updated•1 year ago
|
Description
•