Closed Bug 2089071 Opened 15 days ago Closed 10 days ago

Assertion failure: mState != State::Dirty (mElements should've been cleared if dirty), at checkouts/gecko/dom/base/ContentList.cpp:361

Categories

(Core :: DOM: Core & HTML, defect)

defect

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox-esr153 --- wontfix
firefox160 --- wontfix
firefox161 --- wontfix
firefox162 --- fixed

People

(Reporter: tsmith, Assigned: vhilla)

References

(Blocks 1 open bug, Regression)

Details

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

Attachments

(1 file, 1 external file)

Attached file testcase.html —

Found while fuzzing m-c 20261029-0d3cae2fecc4 (--enable-debug --enable-fuzzing)

To reproduce via Grizzly Replay:

$ pip install fuzzfetch grizzly-framework --upgrade
$ python -m fuzzfetch -d --fuzzing -n firefox
$ python -m grizzly.replay.bugzilla ./firefox/firefox <bugid>

Assertion failure: mState != State::Dirty (mElements should've been cleared if dirty), at checkouts/gecko/dom/base/ContentList.cpp:361

#0 0x7fffe6e2d216 in MOZ_CrashSequence /builds/worker/workspace/obj-build/dist/include/mozilla/Assertions.h:261:3
#1 0x7fffe6e2d216 in mozilla::dom::ContentList::Item(unsigned int) /builds/worker/workspace/obj-build/dom/base/./../../../../checkouts/gecko/dom/base/ContentList.cpp:360:3
#2 0x7fffe7781714 in IndexedGetter /builds/worker/workspace/obj-build/dist/include/mozilla/dom/NodeList.h:36:24
#3 0x7fffe7781714 in mozilla::dom::NodeList_Binding::DOMProxyHandler::getOwnPropDescriptor(JSContext*, JS::Handle<JSObject*>, JS::Handle<JS::PropertyKey>, bool, JS::MutableHandle<mozilla::Maybe<JS::PropertyDescriptor>>) const /builds/worker/workspace/obj-build/dom/bindings/./NodeListBinding.cpp:298:62
#4 0x7fffe840a078 in mozilla::dom::XrayResolveOwnProperty(JSContext*, JS::Handle<JSObject*>, JS::Handle<JSObject*>, JS::Handle<JS::PropertyKey>, JS::MutableHandle<mozilla::Maybe<JS::PropertyDescriptor>>, bool&) /builds/worker/workspace/obj-build/dom/bindings/./../../../../checkouts/gecko/dom/bindings/BindingUtils.cpp:1919:12
#5 0x7fffe5a86bf5 in xpc::DOMXrayTraits::resolveOwnProperty(JSContext*, JS::Handle<JSObject*>, JS::Handle<JSObject*>, JS::Handle<JSObject*>, JS::Handle<JS::PropertyKey>, JS::MutableHandle<mozilla::Maybe<JS::PropertyDescriptor>>) /builds/worker/checkouts/gecko/js/xpconnect/wrappers/XrayWrapper.cpp:1692:8
#6 0x7fffe5a866ca in xpc::XrayWrapper<js::CrossCompartmentWrapper, xpc::DOMXrayTraits>::getOwnPropertyDescriptor(JSContext*, JS::Handle<JSObject*>, JS::Handle<JS::PropertyKey>, JS::MutableHandle<mozilla::Maybe<JS::PropertyDescriptor>>) const /builds/worker/checkouts/gecko/js/xpconnect/wrappers/XrayWrapper.cpp:1885:28
#7 0x7fffed474330 in js::BaseProxyHandler::hasOwn(JSContext*, JS::Handle<JSObject*>, JS::Handle<JS::PropertyKey>, bool*) const /builds/worker/workspace/obj-build/js/src/proxy/./../../../../../checkouts/gecko/js/src/proxy/BaseProxyHandler.cpp:70:8
#8 0x7fffed47f541 in js::Proxy::getInternal(JSContext*, JS::Handle<JSObject*>, JS::Handle<JS::Value>, JS::Handle<JS::PropertyKey>, JS::MutableHandle<JS::Value>) /builds/worker/workspace/obj-build/js/src/proxy/./../../../../../checkouts/gecko/js/src/proxy/Proxy.cpp:526:19
#9 0x7fffed47f1da in js::Proxy::get(JSContext*, JS::Handle<JSObject*>, JS::Handle<JS::Value>, JS::Handle<JS::PropertyKey>, JS::MutableHandle<JS::Value>) /builds/worker/workspace/obj-build/js/src/proxy/./../../../../../checkouts/gecko/js/src/proxy/Proxy.cpp:549:10
#10 0x7fffeca02b94 in GetElement /builds/worker/checkouts/gecko/js/src/vm/ObjectOperations-inl.h:143:10
#11 0x7fffeca02b94 in js::GetObjectElementOperation(JSContext*, JSOp, JS::Handle<JSObject*>, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::MutableHandle<JS::Value>) /builds/worker/checkouts/gecko/js/src/vm/Interpreter-inl.h:376:12
#12 0x7fffeca0112f in GetElementOperationWithStackIndex /builds/worker/checkouts/gecko/js/src/vm/Interpreter-inl.h:486:10
#13 0x7fffeca0112f in GetElementOperation /builds/worker/checkouts/gecko/js/src/vm/Interpreter-inl.h:494:10
#14 0x7fffeca0112f in js::jit::DoGetElemFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICFallbackStub*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::MutableHandle<JS::Value>) /builds/worker/workspace/obj-build/js/src/jit/./../../../../../checkouts/gecko/js/src/jit/BaselineIC.cpp:752:8
#15 0x21d7b245bbde  ([anon:js-executable-memory]+0x1cbde)

Testcase crashes using the initial build (mozilla-central 20261029212358-0d3cae2fecc4) but not with tip (mozilla-central 20261105050539-c4c42dae1d0d.)

Unable to bisect testcase (Start build didn't crash!):

Start: 0d3cae2fecc47097a51629b29675099ceed72c5f (20261029212358)
End: c4c42dae1d0d3b75e92b93fad45620c86b26878f (20261105050539)
BuildFlags: BuildFlags(asan=False, tsan=False, debug=True, fuzzing=True, coverage=False, valgrind=False, no_opt=False, fuzzilli=False, nyx=False, searchfox=False, afl=False)

Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.

Keywords: bugmon
Whiteboard: [bugmon:bisected,confirmed]

This assertion was added by bug 2082419, which landed on 2026-10-27, two days before the fuzzed build. Bugmon's start build didn't crash either, so the testcase seems intermittent rather than fixed on tip.

Vincent, could you take a look?

(AI-assisted triage, with review.)

Severity: -- → S3
Flags: needinfo?(vhilla)
Keywords: regression
Regressed by: 2082419

PopulateSelf can leave the state dirty when !mRootNode and I think the following would be better but it doesn't fix the issue.

 Element* ContentList::Item(uint32_t aIndex) {
   uint32_t count = mElements.Length();
+  MOZ_ASSERT_IF(mState == State::Dirty, count == 0);
   if (aIndex >= count && mState != State::UpToDate) {
     // Prefetch progressively more elements if access is sequential
     uint32_t prefetch = aIndex == count ? std::min(count, 64u) : 0;
     PopulateSelf(std::min(aIndex, UINT32_MAX - 1 - prefetch) + prefetch + 1);
   }
-  MOZ_ASSERT(mState != State::Dirty,
-             "mElements should've been cleared if dirty");

This still fails if I revert bug 2082419, it then hits the NS_ASSERTION.

Flags: needinfo?(vhilla)
No longer regressed by: 2082419

I guess this was there from the beginning in bug 556743. Maybe fuzzers don't care about NS_ASSERTION? Or it's hard to trigger.

See Also: → 556743
Assignee: nobody → vhilla
Attachment #9674995 - Attachment description: WIP: Bug 2089071 - Don't leave ContentList dirty when PopulateSelf already has enough elements. r=#dom-core → Bug 2089071 - Don't leave ContentList dirty when PopulateSelf already has enough elements. r=#dom-core
Status: NEW → ASSIGNED
Assignee: nobody → vhilla

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

Keywords: regression
Pushed by vhilla@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/98d3a5e81959 https://hg.mozilla.org/integration/autoland/rev/f8e731514f9f Don't leave ContentList dirty when PopulateSelf already has enough elements. r=dom-core-reviewers,smaug
Status: ASSIGNED → RESOLVED
Closed: 10 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch

The patch landed in nightly and beta is affected.

:vhilla, please make an uplift decision for beta:

  • For beta, nominate the patch for beta uplift approval if the fix should be included in this release, or set status-firefox161 to wontfix if the fix can wait for the next release.

Uplift requests can be submitted from Lando: D340031.

See Requesting an Uplift for documentation on how to request an uplift.

For more information, please visit BugBot documentation.

Flags: needinfo?(vhilla)

This has been around since 56 and isn't too important.

Flags: needinfo?(vhilla)
Flags: in-testsuite+
Keywords: regression
Regressed by: 2082419
Regressed by: 556743
No longer regressed by: 2082419
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: