Accessibility: crash on Palette search with Qt 5.9 and NVDA

• Dec 24, 2019 - 22:43
Reported version
3.x-dev
Priority
P1 - High
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project

Typing in the Palette searchbox while the NVDA screenreader is running causes MuseScore to crash. The crash also happens under JAWS, but not Microsoft Narrator.

The crash only happens under Qt 5.9 (which uses the MSAA interface for accessibility). It never happens under Qt 5.12 (which uses UI Automation) regardless of the screenreader being used.


Comments

It appears the crash is caused when you try to modify model data for an item that is not currently visible in the view. The palette search expands all matching palette categories and hides the rest. This involves modifying the properties of items that are currently scrolled out of view.

Unfortunately, if that's the case then there's not much we can do to fix this in MuseScore. Qt 5.9 is only supported until May 2020 so I don't think they will fix it for us in Qt.

> This involves modifying the properties of items that are currently scrolled out of view.
Does that mean that the issue happens because of elements that do not fit to palettes panel height? And does the crash happen if most of palettes are removed (so all expanded palettes always fit to one screen) or if some relatively rare character (like 'q' or '.') is typed in the search box? Or do you mean something else by items that are scrolled out of view?

> Does that mean that the issue happens because of elements that do not fit to palettes panel height?

Yes, that's what I thought anyway.

> does the crash happen if most of palettes are removed (so all expanded palettes always fit to one screen)

The crash is less frequent but still happens, so it seems what I wrote before is true but not the full story.

BTW, I managed to produce the same crash with NVDA using the new Asterisk (*) shortcut to expand or collapse all palettes implemented in PR #5474. I added a console.log to this loop and noticed that the crash always occured after the 4th palette has been expanded (i.e. once the others no longer fit on the screen). I tried repositioning the view before expanding, and this allowed me to expand a few more palettes, but I could never get more than 8 palettes to expand without a crash occuring.

I suspect this is the same as the other crash I occasionally saw with NVDA, where either pressing More or maybe navigating to the next palette after doing that would occasionally crash when near the bottom of the window. I never got completely reproducible steps, but did convince myself it had to do with operations on palette cells that were off-screen.

Status PR created fixed

Fixed in branch master, commit 58b14547bb

_fix #298899: work around palette search crash with NVDA on Qt 5.9

Added a hack to explicitly set visibility of items to be destroyed
to false to avoid changing it to true and triggering accessibility
events on item destruction.

Added an ability to set visible property of Ms::QmlNativeMenu to
avoid special-handling this type in the workaround code._

Fix version
3.5.0