Closed Bug 1908306 Opened 1 year ago Closed 1 year ago

null ptr crash in [@ nsRange::ResetCrossShadowBoundaryRange]

Categories

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

defect

Tracking

()

RESOLVED FIXED
130 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox128 --- unaffected
firefox129 --- unaffected
firefox130 --- fixed

People

(Reporter: freddy, Assigned: sefeng211)

References

(Regression)

Details

(Keywords: crash, regression)

Crash Data

Attachments

(1 file, 2 obsolete files)

Crash report: https://crash-stats.mozilla.org/report/index/981b53fe-aa6b-4c67-b395-bec390240717

Reason: EXC_BAD_ACCESS / KERN_INVALID_ADDRESS

Top 10 frames:

0  XUL  RefPtr<mozilla::dom::CrossShadowBoundaryRange>::assign_assuming_AddRef(mozill...  mfbt/RefPtr.h:65
0  XUL  RefPtr<mozilla::dom::CrossShadowBoundaryRange>::operator=(std::nullptr_t)  mfbt/RefPtr.h:180
0  XUL  nsRange::ResetCrossShadowBoundaryRange()  dom/base/nsRange.h:417
0  XUL  mozilla::dom::CrossShadowBoundaryRange::ParentChainChanged(nsIContent*)  dom/base/CrossShadowBoundaryRange.cpp:253
0  XUL  {virtual override thunk({offset(-184)}, mozilla::dom::CrossShadowBoundaryRang...  dom/base/CrossShadowBoundaryRange.cpp:0
1  XUL  mozilla::dom::MutationObservers::NotifyParentChainChanged(nsIContent*)  dom/base/MutationObservers.h:117
1  XUL  mozilla::dom::Element::UnbindFromTree(mozilla::dom::UnbindContext&)  dom/base/Element.cpp:2175
2  XUL  nsGenericHTMLElement::UnbindFromTree(mozilla::dom::UnbindContext&)  dom/html/nsGenericHTMLElement.cpp:556
2  XUL  nsGenericHTMLFormElement::UnbindFromTree(mozilla::dom::UnbindContext&)  dom/html/nsGenericHTMLElement.cpp:1876
2  XUL  mozilla::dom::HTMLInputElement::UnbindFromTree(mozilla::dom::UnbindContext&)  dom/html/HTMLInputElement.cpp:4491

I believe this is a safe null crash, but I have not looked further, so I am marking this as a security bug just to be sure.

The issue happened for me on https://github.com/notifications and there are some other reports with the same signature from the (roughly) same date range. Likely a recent regression.

Could be bug 1907464. CCing Sean Feng.

Looks like mOwner is null. Unhiding.

Group: dom-core-security
Severity: -- → S2
Keywords: regression
Regressed by: 1907464

I'm marking this S2 because it looks like a crash regression happening on real sites.

Set release status flags based on info from the regressing bug 1907464

:sefeng, since you are the author of the regressor, bug 1907464, could you take a look?

For more information, please visit BugBot documentation.

Thanks, yeah looking. It should remove the mutation observer when mOwner is becoming null, so I don't see why...I might need to add a few diagnostic assertions.

Also a IsInList() method is added to DoublyLinkedListElement.

Assignee: nobody → sefeng
Status: NEW → ASSIGNED
Attachment #9413649 - Attachment is obsolete: true
Attachment #9413648 - Attachment is obsolete: true
Attachment #9413674 - Attachment description: Bug 1908306 - Ensure CrossShadowBoundaryRange stops observing any instances when the common ancestor is unlinked → Bug 1908306 - Ensure CrossShadowBoundaryRange stops observing any instances when the common ancestor is unlinked r=jjaschke
Pushed by sefeng@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e5394284e485 Ensure CrossShadowBoundaryRange stops observing any instances when the common ancestor is unlinked r=jjaschke,dom-core
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 130 Branch

The last occurrence of this crash was from build 20240719162139. Looks like my patch has fixed it, so I am clearing my NI :)

Flags: needinfo?(sefeng)
Duplicate of this bug: 1900506

Copying crash signatures from duplicate bugs.

Crash Signature: [@ nsRange::ResetCrossShadowBoundaryRange] → [@ nsRange::ResetCrossShadowBoundaryRange] [@ mozilla::dom::CrossShadowBoundaryRange::ContentRemoved]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: