nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
https://www.nvaccess.org/
Other
2.1k stars 634 forks source link

QT5 TextEdit Results in Crash in NVDA #4826

Closed nvaccessAuto closed 5 years ago

nvaccessAuto commented 9 years ago

Reported by trumpton on 2015-01-18 19:54 Windows XP or Windows 8.1, with Latest NVDA. Simple Application build with QT5.4.1. Tab into a plaintext edit, and hold down enter. Application (and NVDA) lock up. Once application killed, NVDA Log reads as shown below. Note that the program does not crash if WindowsEyes is used instead of NVDA.


NVDA Log File

NVDA initialized IO - speech.speak (19:36:48): Speaking ('en_GB'), u'Visual Studio Command Prompt (2010) terminal' IO - speech.speak (19:36:48): Speaking ('en_GB'), u'E:\Release> ' IO - inputCore.InputManager.executeGesture (19:36:53): Input: kb(desktop):upArrow IO - speech.speak (19:36:53): Speaking ('en_GB'), u'E:\Release>texteditcrash ' IO - speech.speak (19:36:53): Speaking ('en_GB'), u'texteditcrash' IO - inputCore.InputManager.executeGesture (19:36:53): Input: kb(desktop):enter IO - speech.speak (19:36:53): Speaking ('en_GB'), u'E:\Release> ' IO - speech.speak (19:36:59): Speaking ('en_GB'), u'MainWindow window' IO - speech.speak (19:36:59): Speaking ('en_GB'), u'edit multi line' IO - speech.speak (19:36:59): Speaking ('en_GB'), u'blank' IO - inputCore.InputManager.executeGesture (19:37:01): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:01): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:02): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:03): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:03): Input: kb(desktop):enter IO - inputCore.InputManager.executeGesture (19:37:03): Input: kb(desktop):enter DEBUGWARNING - watchdog._watcher (19:37:08): Trying to recover from freeze, core stack: File "nvda.pyw", line 166, in File "core.pyo", line 357, in main File "wx_core.pyo", line 8010, in MainLoop File "wx_core.pyo", line 7306, in MainLoop File "core.pyo", line 328, in Notify File "queueHandler.pyo", line 83, in pumpAll File "queueHandler.pyo", line 50, in flushQueue File "scriptHandler.pyo", line 136, in _queueScriptCallback File "scriptHandler.pyo", line 174, in executeScript File "editableText.pyo", line 128, in script_caret_newLine File "speech.pyo", line 611, in speakTextInfo File "textInfos\offsets.pyo", line 394, in getTextWithFields File "NVDAObjects\IAccessibleinit.pyo", line 197, in _getFormatFieldAndOffsets File "comtypesinit.pyo", line 795, in call

DEBUGWARNING - scriptHandler.executeScript (19:37:08): error executing script: <bound method Dynamic_EditableTextWithAutoSelectDetectionIAccessible.script_caret_newLine of <NVDAObjects.Dynamic_EditableTextWithAutoSelectDetectionIAccessible object at 0x03D02AB0>> with gesture u'enter' Traceback (most recent call last): File "scriptHandler.pyo", line 174, in executeScript File "editableText.pyo", line 128, in script_caret_newLine File "speech.pyo", line 611, in speakTextInfo File "textInfos\offsets.pyo", line 394, in getTextWithFields File "watchdog.pyo", line 191, in _COMError_init CallCancelled DEBUGWARNING - watchdog._watcher (19:37:09): Trying to recover from freeze, core stack: File "nvda.pyw", line 166, in File "core.pyo", line 357, in main File "wx_core.pyo", line 8010, in MainLoop File "wx_core.pyo", line 7306, in MainLoop File "core.pyo", line 328, in Notify File "queueHandler.pyo", line 83, in pumpAll File "queueHandler.pyo", line 50, in flushQueue File "eventHandler.pyo", line 59, in _queueEventCallback File "eventHandler.pyo", line 141, in executeEvent File "eventHandler.pyo", line 89, in init File "eventHandler.pyo", line 96, in next File "NVDAObjectsinit.pyo", line 807, in event_typedCharacter File "speech.pyo", line 539, in speakTypedCharacters File "api.pyo", line 235, in isTypingProtected File "baseObject.pyo", line 34, in get File "baseObject.pyo", line 110, in _getPropertyViaCache File "NVDAObjects\IAccessibleinit.pyo", line 802, in _get_states File "baseObject.pyo", line 34, in get File "baseObject.pyo", line 110, in _getPropertyViaCache File "NVDAObjects\IAccessibleinit.pyo", line 792, in _get_IAccessibleStates File "comtypesinit.pyo", line 795, in call

DEBUGWARNING - eventHandler.executeEvent (19:37:09): error executing event: typedCharacter on <NVDAObjects.Dynamic_EditableTextWithAutoSelectDetectionIAccessible object at 0x03D02AB0> with extra args of {'ch': u'\r'} Traceback (most recent call last): File "eventHandler.pyo", line 141, in executeEvent File "eventHandler.pyo", line 89, in init File "eventHandler.pyo", line 96, in next File "NVDAObjectsinit.pyo", line 807, in event_typedCharacter File "speech.pyo", line 539, in speakTypedCharacters File "api.pyo", line 235, in isTypingProtected File "baseObject.pyo", line 34, in get File "baseObject.pyo", line 110, in _getPropertyViaCache File "NVDAObjects\IAccessibleinit.pyo", line 802, in _get_states File "baseObject.pyo", line 34, in get File "baseObject.pyo", line 110, in _getPropertyViaCache File "watchdog.pyo", line 191, in _COMError_init CallCancelled DEBUGWARNING - watchdog._watcher (19:37:09): Trying to recover from freeze, core stack: File "nvda.pyw", line 166, in File "core.pyo", line 357, in main File "wx_core.pyo", line 8010, in MainLoop File "wx_core.pyo", line 7306, in MainLoop File "core.pyo", line 327, in Notify File "IAccessibleHandler.pyo", line 858, in pumpAll File "IAccessibleHandler.pyo", line 605, in processGenericWinEvent File "IAccessibleHandler.pyo", line 523, in winEventToNVDAEvent File "NVDAObjects\IAccessibleinit.pyo", line 37, in getNVDAObjectFromEvent File "IAccessibleHandler.pyo", line 338, in accessibleObjectFromEvent File "oleacc.pyo", line 240, in AccessibleObjectFromEvent

DEBUGWARNING - IAccessibleHandler.accessibleObjectFromEvent (19:37:10): oleacc.AccessibleObjectFromEvent with window 262450, objectID -4 and childID 0: DEBUGWARNING - watchdog._watcher (19:37:12): Trying to recover from freeze, core stack: File "nvda.pyw", line 166, in File "core.pyo", line 357, in main File "wx_core.pyo", line 8010, in MainLoop File "wx_core.pyo", line 7306, in MainLoop File "core.pyo", line 328, in Notify File "queueHandler.pyo", line 83, in pumpAll File "queueHandler.pyo", line 50, in flushQueue File "scriptHandler.pyo", line 136, in _queueScriptCallback File "scriptHandler.pyo", line 174, in executeScript File "editableText.pyo", line 107, in script_caret_newLine File "NVDAObjectsinit.pyo", line 926, in makeTextInfo File "textInfos\offsets.pyo", line 296, in init File "NVDAObjects\IAccessibleinit.pyo", line 151, in _getCaretOffset

nvaccessAuto commented 9 years ago

Attachment TextEditCrash.tar.gz added by trumpton on 2015-01-18 19:55 Description: QT Source Code to Demonstrate Problem

nvaccessAuto commented 9 years ago

Comment 1 by jteh on 2015-01-19 01:12 According to the log, the application simply stops responding when NVDA asks for formatting information (text attributes). As to why it doesn't crash with Window-Eyes, there could be many reasons, even down to timing. Given QT's history concerning accessibility issues (and the fact that this same code works correctly in Mozilla and OpenOffice), I'd say this is almost certainly a QT bug. (Also, the application should never stop responding when queried for information.)

nvaccessAuto commented 9 years ago

Comment 2 by briang1 on 2015-01-19 10:39 Hi, I notice that the latest version of Dropbox uses QT5, and although the tray icon now works, when you open the preferences option. Things lock up for a while, then Dropbox triggers a Windows crash and exits with errors. I think nvda momentarily freezes, but have not checked that. They have been informed at Dropbox, but if its a QT issue, they may not be able to solve this either.

nvaccessAuto commented 9 years ago

Comment 3 by trumpton on 2015-01-19 13:01 I raised a log with QT many moons ago, which records some of the different ways different screen readers respond in the QWindowsIA2Accessible code. This shows a different way different screen readers respond, and what features they expect from QT.

The bug report is here - https://bugreports.qt.io/i#browse/QTBUG-39522

Not understanding the deepest mysteries of the interface between an application and screen-reader, I can only identify differences - do you think differences here could be the cause?

Could you also recommend / suggest any of the other unsupported functions that would need fixing to improve compatibility with NVDA.

The QT team have lots of different interfaces to support (including Mac, Android etc.), but on the PC, they have had little success with technical interfaces to Jaws and Windows Eyes, so are concentrating their effort on NVDA, which is great, but there is much work to do!

Steve

nvaccessAuto commented 9 years ago

Comment 4 by jteh on 2015-01-19 23:51 These almost certainly aren't the cause. NVDA will gracefully handle interfaces that aren't supported, and as noted in the bug, they don't need to support all the interfaces unless they need functionality from said interfaces. Certainly, this wouldn't cause freezes or crashes; that's a bug elsewhere.

How responsive are QT to fixing accessibility issues now? I gave up trying with QT a few years ago because no one seemed to care, but if they are more responsive now, we could consider trying to investigate and file major technical bugs.

nvaccessAuto commented 9 years ago

Comment 5 by trumpton on 2015-01-20 13:04 I've found a workaround - for some reason the program does not crash if I use NVDA 2014.2 - I guess that version was a bit more forgiving. The log file still contains errors though:

IO - inputCore.InputManager.executeGesture (23:31:12): Input: kb(laptop):enter IO - inputCore.InputManager.executeGesture (23:31:12): Input: kb(laptop):enter IO - inputCore.InputManager.executeGesture (23:31:12): Input: kb(laptop):enter IO - inputCore.InputManager.executeGesture (23:31:12): Input: kb(laptop):enter IO - braille.BrailleBuffer.update (23:31:12): Braille regions text: ' IO - braille.BrailleHandler.update (23:31:12): Braille window dots: - IO - braille.BrailleHandler.update (23:31:12): Braille window dots: - DEBUGWARNING - IAccessibleHandler.accessibleObjectFromEvent (23:31:12): oleacc.AccessibleObjectFromEvent with window 66898, objectID 100729469 and childID 0: -2147467259 Unspecified error DEBUGWARNING - IAccessibleHandler.accessibleObjectFromEvent (23:31:12): oleacc.AccessibleObjectFromEvent with window 66898, objectID 100730449 and childID 0: -2147467259 Unspecified error DEBUGWARNING - IAccessibleHandler.accessibleObjectFromEvent (23:31:12): oleacc.AccessibleObjectFromEvent with window 66898, objectID 100730450 and childID 0: -2147467259 Unspecified error IO - inputCore.InputManager.executeGesture (23:31:12): Input: kb(laptop):enter IO - inputCore.InputManager.executeGesture (23:31:12): Input: kb(laptop):enter

nvaccessAuto commented 9 years ago

Comment 6 by trumpton (in reply to comment 4) on 2015-01-20 13:11 Replying to jteh:

How responsive are QT to fixing accessibility issues now? I gave up trying with QT a few years ago because no one seemed to care, but if they are more responsive now, we could consider trying to investigate and file major technical bugs.

I've found that the QT team have been quite responsive. Frederik Gladhorn is responsible for the accessibility of the software suite. They have a lot on their plate, with Android, Linux, Mac and PC platforms.

They've had little success getting support from Jaws and Windows Eyes, and for Windows, have committed their efforts in supporting NVDA.

One problem they do have is that given the large number of possible platforms / interfaces, they do not have a Braille Display - this means that testing involves a third party (like me) who is not the fastest in reacting. They are limited to reviewing the logfiles in NVDA - can you see a better way to help them? I've looked at brltty, but it only appears to work for the consoles.

Steve

nvaccessAuto commented 9 years ago

Comment 7 by jteh (in reply to comment 6) on 2015-01-21 02:00 Replying to trumpton:

One problem they do have is that given the large number of possible platforms / interfaces, they do not have a Braille Display - this means that testing involves a third party (like me) who is not the fastest in reacting.

This is a bit off-topic here, but I wrote a prototype braille display driver a while ago which can display the dots visually on screen. Someone with sight probably needs to tweak it so it looks decent. If someone wants to try it, just download it and copy it into brailleDisplayDrivers directory inside the user configuration directory; e.g. %appdata%\nvda\brailleDisplayDrivers. Any feedback should be provided on the nvda-devel list for now. We'll move it into a ticket if there's enough interest.

bhavyashah commented 7 years ago

The QT bug cited in one comment present at https://bugreports.qt.io/browse/QTBUG-39522 appears to be closed as invalid. Thoughts?

LeonarddeR commented 5 years ago

As QT now has an entirely new accessibility implementation based on UIA, I"m closing this for now. If the issue still persists in QT 5.11 and above, please file a new issue.