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

NVDA plays error sounds and stays silent when using table navigation commands in Firefox after some time #15862

Open Neurrone opened 10 months ago

Neurrone commented 10 months ago

Cc @jcsteh

Steps to reproduce:

This only seems to happen for me when NVDA has been running for some time, as restarting NVDA fixes the problem for a while.

  1. Try to use table navigation commands in a table in Firefox. I've seen this in numerous webpages with tables, so this isn't website specific.

Actual behavior:

An error sound is played and the command fails with the following error:

ERROR - scriptHandler.executeScript (17:15:06.257) - MainThread (10164):
error executing script: <bound method DocumentWithTableNavigation.script_nextRow of <virtualBuffers.gecko_ia2.Gecko_ia2 object at 0x045CCED0>> with gesture 'alt+ctrl+down arrow'
Traceback (most recent call last):
  File "documentBase.pyc", line 358, in _tableFindNewCell
  File "virtualBuffers\gecko_ia2.pyc", line 566, in _getNearestTableCell
  File "documentBase.pyc", line 285, in _getNearestTableCell
LookupError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "virtualBuffers\gecko_ia2.pyc", line 548, in _getTableCellAt
  File "comtypes\_memberspec.pyc", line 482, in __call__
_ctypes.COMError: (-2147023179, 'The interface is unknown.', (None, None, None, 0, None))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "documentBase.pyc", line 384, in _tableFindNewCell
  File "virtualBuffers\gecko_ia2.pyc", line 556, in _getTableCellAt
LookupError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "scriptHandler.pyc", line 295, in executeScript
  File "documentBase.pyc", line 470, in script_nextRow
  File "documentBase.pyc", line 415, in _tableMovementScriptHelper
  File "documentBase.pyc", line 386, in _tableFindNewCell
RuntimeError: ('Unable to find current cell.', LookupError())

Expected behavior:

Table navigation works per usual.

NVDA logs, crash dumps and other attachments:

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

alpha-30120,8052b68f (2024.1.0.30120)

Windows version:

Windows 11 22H2

Name and version of other software in use when reproducing the issue:

Firefox 121.0B4, but observed with older Firefox stable versions too

Other information about your system:

Other questions

Does the issue still occur after restarting your computer?

Yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

Yes, previous snapshots also exhibit this behaviour

If NVDA add-ons are disabled, is your problem still occurring?

Yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

Yes

jcsteh commented 10 months ago

Hmm. I've seen this interface unknown error occasionally with the IAccessibleHyperlink interface, which is used when navigating rich text. That error gets swallowed by NVDA catching the exception, but I can see it if I poke with the Python console. Restarting NVDA also fixes that.

How long do you think you have to be running NVDA before you see this?

I really don't know what is causing this. I did manage to get a debugger onto Firefox at one point when I saw this. From what I recall, Firefox never saw the methods get called. So, something weird seems to be going on with COM marshaling between NVDA and Firefox.

Curiously, querying for the interface succeeds, but any methods you call on that interface fail. And once an interface breaks like this, all methods in that interface fail, even when called on a completely different object.

What I don't understand is why. Particularly since Firefox 113, where Cache the World was introduced, Firefox no longer has any obscure COM interceptor, client side handler, etc. In fact, I removed all of that code completely. It's relatively straightforward COM now like any other MSAA/IA2 server.

So, I'm not convinced this is a Firefox bug, but nor can I think of anything in NVDA that could cause this. It is very, very strange.

Neurrone commented 10 months ago

How long do you think you have to be running NVDA before you see this?

My estimate is sometime within a few minutes to an hour.

jcsteh commented 10 months ago

Oh wow. That's much shorter than for me. Hmm.

seanbudd commented 10 months ago

Does this affect behaviour in any way or is it just error sounds?

Neurrone commented 10 months ago

Table navigation is impossible and there is no speech when attempting to do table navigation once these errors start happening.