Closed Bug 2052026 Opened 1 month ago Closed 1 month ago

Crash in [@ nsINode::IsMaybeSelected]

Categories

(Core :: DOM: Selection, defect)

defect

Tracking

()

RESOLVED FIXED
154 Branch
Tracking Status
firefox-esr140 --- unaffected
firefox152 --- unaffected
firefox153 --- unaffected
firefox154 blocking fixed

People

(Reporter: diannaS, Assigned: masayuki)

References

(Regression)

Details

(Keywords: crash, regression, topcrash)

Crash Data

Attachments

(2 files)

Crash report: https://crash-stats.mozilla.org/report/index/a59897f3-7d35-4f0d-a41e-654570260701

Reason:

SIGSEGV / SEGV_MAPERR

Top 10 frames:

0  libxul.so  nsINode::IsMaybeSelected() const  dom/base/nsINode.h:2077
0  libxul.so  mozilla::dom::AbstractRange::MarkDescendants(nsINode&)  dom/base/AbstractRange.cpp:143
0  libxul.so  mozilla::dom::AbstractRange::RegisterClosestCommonInclusiveAncestor(nsINode*)  dom/base/AbstractRange.cpp:506
0  libxul.so  mozilla::dom::AbstractRange::RegisterSelection(mozilla::dom::Selection&)  dom/base/AbstractRange.cpp:474
1  libxul.so  mozilla::dom::Selection::StyledRanges::MaybeAddRangeAndTruncateOverlaps(nsRan...  dom/base/Selection.cpp:1454
2  libxul.so  mozilla::dom::Selection::AddRangesForUserSelectableNodes(nsRange*, mozilla::M...  dom/base/Selection.cpp:1352
3  libxul.so  mozilla::dom::Selection::AddRangesForSelectableNodes(nsRange*, mozilla::Maybe...  dom/base/Selection.cpp:1386
4  libxul.so  mozilla::dom::Selection::SetAnchorFocusToRange(nsRange*)  dom/base/Selection.cpp:3123
5  libxul.so  mozilla::dom::Selection::ExtendInternal(nsINode&, unsigned int, mozilla::Erro...  dom/base/Selection.cpp:0
6  libxul.so  mozilla::dom::Selection::Extend(nsINode*, unsigned int)  dom/base/Selection.cpp:3200
Flags: needinfo?(masayuki)

Crash looks like commonAncestor might be null?

Marking S3 because of regressor stack having been backed out. (Otherwise likely S2)

Severity: -- → S3
Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Flags: needinfo?(masayuki)

Okay, I reproduced the crash with a URL reported by a crash report.

fixed by backout of the regressor

Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 154 Branch

:masayuki or would you rather have this leave-open so you can address it separately? feel free to re-open if so

Attached file testcase

Press in the text and drag into the gray box.

I need to append a patch within this bug.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → ASSIGNED

Well, the reason is, we have excluded the shadow of SVG <use> in the DOM APIs.
https://searchfox.org/firefox-main/rev/bac4e9ee6b48aeeba4978df2eefa07bc2081fdc8/dom/base/nsINode.cpp#4460-4462

However, we allow users to extend selection across the shadow DOM boundary. Therefore, the range across the boundary is treated as disconnected. So, we should treat the shadow of <use> as flattened in the flat tree for selection.

The patch is already completed.
https://treeherder.mozilla.org/jobs?repo=try&revision=7907628f3aa7aa0e74a31897f84914a97550b0c5

However, I'm adding some crash annotations for the similar failures.

Currently, we allow extending selection range into a shadow of <use>
even though it's our own closed shadow. Therefore, we need to be
consistent about this in the each DOM API. I.e., we should treat the
shadow for SVG <use> as a part of the flat tree for selection.

Additionally, this corrects the DOM path of the the containers if
they should have connected but disconnected. To avoid to leak the
privacy, this adds an option to the node's debug printer to exclude
class and id attribute values and the data of CharacterData.

The bug is linked to a topcrash signature, which matches the following criterion:

  • Top 10 desktop browser crashes on nightly

:masayuki, could you consider increasing the severity of this top-crash bug?

For more information, please visit BugBot documentation.

Flags: needinfo?(masayuki)
Keywords: topcrash

Looks like this is an alternate signature for the same crash: [@ mozilla::dom::AbstractRange::MarkDescendants ]

Crash Signature: [@ nsINode::IsMaybeSelected] → [@ nsINode::IsMaybeSelected] [@ mozilla::dom::AbstractRange::MarkDescendants ]

The patches have already been backed out.

Flags: needinfo?(masayuki)
Pushed by masayuki@d-toybox.com: https://github.com/mozilla-firefox/firefox/commit/deec723b5a20 https://hg.mozilla.org/integration/autoland/rev/c71e2e219208 Treat the UA shadow for SVG `<use>` as a part of the flat tree for selection r=smaug,webidl
Status: ASSIGNED → RESOLVED
Closed: 1 month ago1 month ago
Resolution: --- → FIXED
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: