Closed Bug 1772170 Opened 4 years ago Closed 4 years ago

Crash in [@ mozilla::a11y::TextRange::CommonParent]

Categories

(Core :: Disability Access APIs, defect)

Unspecified
Android
defect

Tracking

()

RESOLVED FIXED
103 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox101 --- unaffected
firefox102 + disabled
firefox103 + fixed

People

(Reporter: kbrosnan, Assigned: Jamie)

References

Details

(Keywords: crash, Whiteboard: [ctw-m1])

Crash Data

Attachments

(1 external file)

[Tracking Requested - why for this release]: New crash regression with possible STR

Crash report: https://crash-stats.mozilla.org/report/index/496aeab6-28cf-4c7c-853a-f3d790220531

Reason: SIGSEGV / SEGV_MAPERR

Top 10 frames of crashing thread:

0 libxul.so mozilla::a11y::TextRange::CommonParent const accessible/base/TextRange.cpp:517
1 libxul.so mozilla::a11y::TextRange::Crop accessible/base/TextRange.cpp:194
2 libxul.so mozilla::a11y::HyperTextAccessibleBase::CroppedSelectionRanges const accessible/basetypes/HyperTextAccessibleBase.cpp:635
3 libxul.so mozilla::a11y::HyperTextAccessibleBase::SelectionBoundsAt accessible/basetypes/HyperTextAccessibleBase.cpp:659
4 libxul.so mozilla::a11y::SessionAccessibility::SendTextSelectionChangedEvent accessible/android/SessionAccessibility.cpp:406
5 libxul.so mozilla::a11y::ProxyCaretMoveEvent accessible/android/Platform.cpp:147
6 libxul.so mozilla::a11y::DocAccessibleParent::RecvCaretMoveEvent accessible/ipc/DocAccessibleParent.cpp:395
7 libxul.so {virtual override thunk} 
8 libxul.so mozilla::a11y::PDocAccessibleParent::OnMessageReceived ipc/ipdl/PDocAccessibleParent.cpp:9130
9 libxul.so mozilla::dom::PContentParent::OnMessageReceived ipc/ipdl/PContentParent.cpp:6618

From https://github.com/mozilla-mobile/fenix/issues/25480

Steps to reproduce

  1. Go to https://news.ycombinator.com/item?id=31547876
  2. Select text of a post
  3. Add the header of the post to the selection

Expected behaviour

Text should be selected

Actual behaviour

Application crashes

Component: General → Disability Access APIs
Product: GeckoView → Core
Whiteboard: [ctw-m1]

From what I can determine from the stack, GetChildAtOffset must be returning null. I guess the cached selection ranges must be out of sync with the tree, but I don't know why that would be. We're responding to a caret event here. A caret event is always fired after a selection event and both of these should always be fired after we've sent any text cache updates and tree mutations. A selection event isn't fired for a collapsed caret, but in that case, we clear the cached selection when we receive the caret event.

For now, I'm inclined to add an assertion and a graceful failure.

I guess the tree/text and selection could be out of sync if the selection query arrived between the tree/text updates and the selection update. I think the only way to truly fix that would be to have all updates and events arrive as a single IPDL call, which isn't great. I'll try to work around it as best I can.

I hit a similar crash on Windows while selecting a huge block of text in Google Docs, bp-4b22fab8-e63c-414e-a793-9c7b50220608. This one is a little different in that we crash in Crop before we get to CommonParent, but I think the underlying cause is the same.

Crash Signature: [@ mozilla::a11y::TextRange::CommonParent] → [@ mozilla::a11y::TextRange::CommonParent] [@ mozilla::a11y::TextRange::Crop ]
Assignee: nobody → jteh
Status: NEW → ASSIGNED
Pushed by jteh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3a5c73f416b2 Ensure cached Accessibles and offsets are valid before returning them in DocAccessibleParent::SelectionRanges. r=eeejay
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch

The patch landed in nightly and beta is affected.
:Jamie, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox102 to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(jteh)
Flags: needinfo?(jteh)

This code was disabled on beta via bug 1772165.

Removing the qe+ flag as the crash affects android.

Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: