Closed Bug 1564542 Opened 5 years ago Closed 5 years ago

Firefox crashes when using the Accessibility Inspector on the browser mozilla::a11y::Accessible::Bounds()

Categories

(Core :: Disability Access APIs, defect, P1)

All
Windows
defect

Tracking

()

VERIFIED FIXED
mozilla70
Tracking Status
firefox-esr60 --- unaffected
firefox-esr68 --- wontfix
firefox68 --- wontfix
firefox69 --- verified
firefox70 + verified

People

(Reporter: asa, Assigned: Jamie)

References

Details

(Keywords: crash, regression)

Crash Data

Attachments

(1 file)

Tested on:
Windows 10, 64-bit
Firefox Nightly 70.0a1 (2019-07-09) (64-bit)

Steps to reproduce:

  1. Launch Firefox
  2. Enable the browser toolbox https://developer.mozilla.org/en-US/docs/Tools/Browser_Toolbox
  3. Open the browser toolbox
  4. Select Accessibility in the toolbar
  5. Select the Accessibility Inspector
  6. Move the pointer over Firefox

Results:
Crash at mozilla::a11y::Accessible::Bounds() report at https://crash-stats.mozilla.org/report/index/4aebc748-07ec-4927-b986-6f6bd0190709

Expected results:
No crash

This looks to be the same crash as Bug 1512568 which was filed a while back.

Crash Signature: mozilla::a11y::Accessible::Bounds() → [@ mozilla::a11y::Accessible::Bounds ]
Keywords: crash, regression

I took a look at the crash dump. In the Bounds() call, this->mDoc is null. Furthermore, this->mType is 0x1f (eProxyType).

I think this is because on Windows, calling GetChildAt(0) on an OuterDocAccessible for a remote document returns a ProxyAccessibleWrap. That wrapper is only capable of returning a native COM interface; most calls (including Bounds) will fail.

I'd like to deal with this in OuterDocAccessible::ChildAtPoint, but we can't because Accessible::ChildAtPoint fetches grandchildren (children of the found direct child). Thus, OuterDocAccessible's ChildAtPoint doesn't get called. I can think of two possible solutions:

  1. Have a Windows specific override of Bounds in DocAccessible which returns a 0 rectangle if IsProxy() is true. The 0 rectangle thing is kinda ugly though.
  2. Have Windows specific code in Accessible::ChildAtPoint which checks if the child IsProxy(), and if so, skips it. The disadvantage of this is that we'd be calling IsProxy on every child it checks, even if it's not a document.
Priority: -- → P1
OS: Unspecified → Windows
Hardware: Unspecified → All

(In reply to James Teh [:Jamie] from comment #2)

  1. Have a Windows specific override of Bounds in DocAccessible which returns a 0 rectangle if IsProxy() is true. The 0 rectangle thing is kinda ugly though.

We'd probably do this in DocProxyAccessiblewrap and RemoteIframeDocProxyAccessibleWrap.

I'm not going to be so useful at testing with a mouse. Asa, would you mind giving this try build a spin to see if it fixes the issue?
https://treeherder.mozilla.org/#/jobs?repo=try&revision=de1f28000048137ba482338c7b921d66b35419d4

Flags: needinfo?(asa)
Assignee: yzenevich → jteh

(In reply to James Teh [:Jamie] from comment #5)

I'm not going to be so useful at testing with a mouse. Asa, would you mind giving this try build a spin to see if it fixes the issue?
https://treeherder.mozilla.org/#/jobs?repo=try&revision=de1f28000048137ba482338c7b921d66b35419d4

I've tested the try build and it does not crash. The Accessibility Inspector works on browser chrome. Yay!

Flags: needinfo?(asa)

OuterDocAccessible can return a DocProxyAccessibleWrap or RemoteIframeDocProxyAccessibleWrap as a child.
Accessible::ChildAtPoint on an ancestor might retrieve this proxy and call Bounds() on it.
This will crash on a proxy, so we override it on these document proxies to do nothing.

Pushed by mzehe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bf6d08f93d8d
Add a dummy implementation of Bounds() on DocProxyAccessibleWrap/RemoteIframeDocProxyAccessibleWrap to prevent crashes when hit testing via XPCOM. r=yzen
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70

Is this something we should consider uplifting to Beta or can this ride the trains?

Comment on attachment 9078565 [details]
Bug 1564542: Add a dummy implementation of Bounds() on DocProxyAccessibleWrap/RemoteIframeDocProxyAccessibleWrap to prevent crashes when hit testing via XPCOM.

Beta/Release Uplift Approval Request

  • User impact if declined: Crashes on Windows when moving the mouse over the browser after enabling the Accessibility Inspector in the Browser Toolbox.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Trivial fix which affects a very specific code path only engaged (outside of tests) when using the Accessibility Inspector in the Browser Toolbox on Windows.
  • String changes made/needed: None.
Flags: needinfo?(jteh)
Attachment #9078565 - Flags: approval-mozilla-beta?

Comment on attachment 9078565 [details]
Bug 1564542: Add a dummy implementation of Bounds() on DocProxyAccessibleWrap/RemoteIframeDocProxyAccessibleWrap to prevent crashes when hit testing via XPCOM.

Fixes a crash on Windows when using the Accessibility Inspector. Approved for 69.0b7.

Attachment #9078565 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

Hello!

Reproduced the issue using Firefox 70.0a1 (20190709153742) on Windows 10x64.

Although while verifying this using Firefox 69.0b7 (20190722201635) and Firefox 70.0a1 (20190722214346) on Windows 10 I encountered bug 1568163, another crash with a different signature.
It is safe to close this bug as verified?

Flags: needinfo?(jteh)

Ug. Thanks for catching; not sure why that one doesn't seem to show up as easily. Yes, let's mark this as verified and deal with the other crash in bug 1568163.

Flags: needinfo?(jteh)

Thank you James!
As per comment 14 and comment 15 this issue is verified fixed. Removing the qe+ flag accordingly.

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

Attachment

General

Created:
Updated:
Size: