Assertion failure: !newBase->isInline(), at /builds/worker/checkouts/gecko/js/src/vm/StringType.h:2361
Categories
(Core :: JavaScript: GC, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr128 | --- | unaffected |
| firefox138 | --- | unaffected |
| firefox139 | --- | unaffected |
| firefox140 | + | fixed |
People
(Reporter: tsmith, Assigned: sfink)
References
(Blocks 2 open bugs, Regression, )
Details
(4 keywords)
Attachments
(1 external file)
Found with m-c 20250502-5b5bd7e73009 (--enable-debug)
This was found by visiting a live website with a debug build.
STR:
- Launch browser and visit site
This issue was triggered by visiting http://www.tractorsupply.com/. A Pernosco session is available here: https://pernos.co/debug/0Qan0NtYMyU3hVDzJMrW5Q/index.html
Assertion failure: !newBase->isInline(), at /builds/worker/checkouts/gecko/js/src/vm/StringType.h:2361
0|0|xul.dll|js::gc::TenuringTracer::traceBufferedCells<JSString>(js::gc::Arena*, js::gc::ArenaCellSet*)|hg:hg.mozilla.org/mozilla-central:js/src/gc/Tenuring.cpp:5b5bd7e730096ef3867efe107dc97fb4a38a489a|413|0x418
0|1|xul.dll|js::gc::StoreBuffer::WholeCellBuffer::trace(js::gc::TenuringTracer&, js::gc::StoreBuffer*)|hg:hg.mozilla.org/mozilla-central:js/src/gc/Tenuring.cpp:5b5bd7e730096ef3867efe107dc97fb4a38a489a|456|0xa9
0|2|xul.dll|js::Nursery::traceRoots(js::gc::AutoGCSession&, js::gc::TenuringTracer&)|hg:hg.mozilla.org/mozilla-central:js/src/gc/Nursery.cpp:5b5bd7e730096ef3867efe107dc97fb4a38a489a|1796|0x238
0|3|xul.dll|js::Nursery::doCollection(js::gc::AutoGCSession&, JS::GCOptions, JS::GCReason)|hg:hg.mozilla.org/mozilla-central:js/src/gc/Nursery.cpp:5b5bd7e730096ef3867efe107dc97fb4a38a489a|1670|0x28b
0|4|xul.dll|js::Nursery::collect(JS::GCOptions, JS::GCReason)|hg:hg.mozilla.org/mozilla-central:js/src/gc/Nursery.cpp:5b5bd7e730096ef3867efe107dc97fb4a38a489a|1427|0x431
0|5|xul.dll|js::gc::GCRuntime::collectNursery(JS::GCOptions, JS::GCReason, js::gcstats::PhaseKind)|hg:hg.mozilla.org/mozilla-central:js/src/gc/GC.cpp:5b5bd7e730096ef3867efe107dc97fb4a38a489a|4989|0x181
0|6|xul.dll|js::gc::GCRuntime::minorGC(JS::GCReason, js::gcstats::PhaseKind)|hg:hg.mozilla.org/mozilla-central:js/src/gc/GC.cpp:5b5bd7e730096ef3867efe107dc97fb4a38a489a|4960|0x1d3
0|7|xul.dll|js::gc::GCRuntime::gcIfRequestedImpl(bool)|hg:hg.mozilla.org/mozilla-central:js/src/gc/GC.cpp:5b5bd7e730096ef3867efe107dc97fb4a38a489a|5040|0x6b
0|8|xul.dll|JSContext::handleInterrupt()|hg:hg.mozilla.org/mozilla-central:js/src/vm/Runtime.cpp:5b5bd7e730096ef3867efe107dc97fb4a38a489a|502|0xdf
0|9|xul.dll|js::GetAndClearException(JSContext*, JS::MutableHandle<JS::Value>)|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:5b5bd7e730096ef3867efe107dc97fb4a38a489a|4707|0x41
0|10|||||
0|11|xul.dll|js::CheckContextLocal::check() const|hg:hg.mozilla.org/mozilla-central:js/src/threading/ProtectedData.cpp:5b5bd7e730096ef3867efe107dc97fb4a38a489a|53|0x67
0|12|||||
Comment 1•1 year ago
|
||
Probably related to the recent string deduplication changes.
| Assignee | ||
Updated•1 year ago
|
Comment 2•1 year ago
|
||
Set release status flags based on info from the regressing bug 1959310
:sfink, since you are the author of the regressor, bug 1959310, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
Updated•1 year ago
|
| Assignee | ||
Comment 3•1 year ago
•
|
||
Note: thank you very much for the Pernosco traces. They make things so much easier.
The base is indeed inline, which I thought should never happen -- except that AtomRefs are also considered dependent strings, and it is possible (though highly unusual) to create an AtomRef that points to an inline atom. Normally, JSString::tryReplaceWithAtomRef would skip an inline string, but it is possible to set it up so that the original string is not inline even though its chars would fit inline, by playing games with latin1 vs twoByte. As in, if a string that would fit inline if stored as latin1 is created as a twoByte string, then it can turn into a deflated latin1 inline atom. So the input string to tryReplaceWithAtomRef is not inline, but the atom it ends up pointing to is. That's what happened here.
Two options: (1) replace isDependent() checks with isDependent() && !isAtomRef(), or (2) remove all assertions that fail when the base is inline (since it turns out to be a valid case). I guess for the latter, we might still want to assert that nursery bases cannot be inline, since promotion would orphan the dependent string's chars.
Option (1) would be a little faster, since the chars fixup code never needs to run for AtomRefs. Though I don't think it matters, since the atomref has to trace its base anyway, which does nearly exactly the same thing as for other dependent strings.
Anyway, I'll do both: skip the dependent string path for atomrefs, and adjust the assertions to not insist that bases can't be inline.
| Assignee | ||
Comment 4•1 year ago
|
||
Updated•1 year ago
|
| Assignee | ||
Comment 5•1 year ago
|
||
This is unlikely to be a security issue, but it does follow a different code path and I'm not confident that it's completely harmless in the atomref case. I think it ends up interpreting string data as a pointer for the purpose of updating the dependent string's chars, which sounds bad except that I believe it subtracts out the same misinterpreted pointer and so is guaranteed to update by zero. It's weird enough that I'll leave it marked as a security bug for now.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 9•1 year ago
|
||
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
Updated•11 months ago
|
Description
•