Skip to content

text style navigation: Severe freeze when using UIA in MS Word and no next or previous style has been found #16546

@Adriani90

Description

@Adriani90

Steps to reproduce:

  1. Open NVDA
  2. Assign [ and shift+[ for different style navigation
  3. Assign ] and shift+] for same style navigation
  4. Open an MS Word document with different text styles, see attached document for a test case.
  5. Make sure UIA for MS Word is enabled in NVDA advanced settings
  6. Navigate to a page with some text, e.g. start on page 2 or 3
  7. Press multiple times the assigned commands for navigating to next and previous text styles.

Actual behavior:

NVDA freezes for at least 10 seconds and keyboard is locked when no next or no previous style has been found, following is written to the log:

IO - inputCore.InputManager.executeGesture (07:16:19.270) - winInputHook (25672):
Input: kb(laptop):upArrow
IO - speech.speech.speak (07:16:19.290) - MainThread (25968):
Speaking ['von AV-\r']
DEBUG - UIAHandler.shouldUseUIAInMSWord (07:16:19.334) - MainThread (25968):
Using UIA due to suitable Office version: (16, 0, 17531)
IO - inputCore.InputManager.executeGesture (07:16:20.670) - winInputHook (25672):
Input: kb(laptop):plus
DEBUG - watchdog._waitUntilNormalCoreAliveTimeout (07:16:21.185) - watchdog (29136):
Potential freeze, waiting up to 10 seconds.
IO - inputCore.InputManager.executeGesture (07:16:21.929) - winInputHook (25672):
Input: kb(laptop):upArrow
DEBUG - NVDAObjects.UIA.UIATextInfo._getTextWithFieldsForUIARange (07:16:29.190) - MainThread (25968):
Detected embedded child
INFO - watchdog.waitForFreezeRecovery (07:16:30.696) - watchdog (29136):
Starting freeze recovery after 10.011169499950483 seconds.
DEBUGWARNING - watchdog.waitForFreezeRecovery (07:16:30.696) - watchdog (29136):
Listing stacks for Python threads:
Python stack for thread 10340 (synthDrivers._espeak.BgThread):
  File "threading.pyc", line 1002, in _bootstrap
  File "threading.pyc", line 1045, in _bootstrap_inner
  File "synthDrivers\_espeak.pyc", line 201, in run
  File "queue.pyc", line 171, in get
  File "threading.pyc", line 327, in wait

Python stack for thread 30256 (watchdog.CancellableCallThread.execute(<_FuncPtr object at 0x095433F0>)):
  File "threading.pyc", line 1002, in _bootstrap
  File "threading.pyc", line 1045, in _bootstrap_inner
  File "watchdog.pyc", line 382, in run
  File "threading.pyc", line 629, in wait
  File "threading.pyc", line 327, in wait

Python stack for thread 14712 (visionEnhancementProviders.NVDAHighlighter.NVDAHighlighter):
  File "threading.pyc", line 1002, in _bootstrap
  File "threading.pyc", line 1045, in _bootstrap_inner
  File "threading.pyc", line 982, in run
  File "visionEnhancementProviders\NVDAHighlighter.pyc", line 452, in _run
  File "winUser.pyc", line 460, in getMessage

Python stack for thread 29136 (watchdog):
  File "threading.pyc", line 1002, in _bootstrap
  File "threading.pyc", line 1045, in _bootstrap_inner
  File "threading.pyc", line 982, in run
  File "watchdog.pyc", line 159, in _watcher
  File "watchdog.pyc", line 166, in waitForFreezeRecovery
  File "logHandler.pyc", line 64, in getFormattedStacksForAllThreads

Python stack for thread 25672 (winInputHook):
  File "threading.pyc", line 1002, in _bootstrap
  File "threading.pyc", line 1045, in _bootstrap_inner
  File "threading.pyc", line 982, in run
  File "winInputHook.pyc", line 81, in hookThreadFunc

Python stack for thread 10304 (UIAHandler.UIAHandler.MTAThread):
  File "threading.pyc", line 1002, in _bootstrap
  File "threading.pyc", line 1045, in _bootstrap_inner
  File "threading.pyc", line 982, in run
  File "UIAHandler\__init__.pyc", line 544, in MTAThreadFunc
  File "queue.pyc", line 171, in get
  File "threading.pyc", line 327, in wait

Python stack for thread 23052 (ThreadPoolExecutor-0_0):
  File "threading.pyc", line 1002, in _bootstrap
  File "threading.pyc", line 1045, in _bootstrap_inner
  File "threading.pyc", line 982, in run
  File "concurrent\futures\thread.pyc", line 81, in _worker

Python stack for thread 21128 (hwIo.ioThread.IoThread):
  File "threading.pyc", line 1002, in _bootstrap
  File "threading.pyc", line 1045, in _bootstrap_inner
  File "hwIo\ioThread.pyc", line 258, in run

Python stack for thread 25968 (MainThread):
  File "nvda.pyw", line 415, in <module>
  File "core.pyc", line 919, in main
  File "wx\core.pyc", line 2262, in MainLoop
  File "wx\core.pyc", line 3427, in <lambda>
  File "core.pyc", line 849, in processRequest
  File "core.pyc", line 865, in Notify
  File "queueHandler.pyc", line 97, in pumpAll
  File "queueHandler.pyc", line 64, in flushQueue
  File "scriptHandler.pyc", line 243, in _queueScriptCallback
  File "keyboardHandler.pyc", line 571, in executeScript
  File "inputCore.pyc", line 224, in executeScript
  File "scriptHandler.pyc", line 295, in executeScript
  File "browseMode.pyc", line 558, in <lambda>
  File "browseMode.pyc", line 516, in _quickNavScript
  File "browseMode.pyc", line 2431, in _iterTextStyle
  File "browseMode.pyc", line 2224, in _extractStyles
  File "treeInterceptorHandler.pyc", line 255, in getTextWithFields
  File "NVDAObjects\UIA\wordDocument.pyc", line 315, in getTextWithFields
  File "NVDAObjects\UIA\__init__.pyc", line 877, in getTextWithFields
  File "NVDAObjects\UIA\__init__.pyc", line 865, in _getTextWithFieldsForUIARange
  File "NVDAObjects\UIA\__init__.pyc", line 616, in _getTextWithFields_text
  File "UIAHandler\utils.pyc", line 131, in iterUIARangeByUnit

IO - speech.speech.speak (07:16:33.181) - MainThread (25968):
Speaking ['No next same style text']
IO - speech.speech.speak (07:16:33.200) - MainThread (25968):
Speaking ['42\r']
INFO - watchdog.waitForFreezeRecovery (07:16:33.233) - watchdog (29136):
Recovered from freeze after 12.548535000067204 seconds.
DEBUG - UIAHandler.shouldUseUIAInMSWord (07:16:33.235) - MainThread (25968):
Using UIA due to suitable Office version: (16, 0, 17531)

No previous style:

IO - inputCore.InputManager.executeGesture (07:22:18.409) - winInputHook (25672):
Input: kb(laptop):shift+plus
DEBUGWARNING - RPC process 11884 (WINWORD.EXE) (07:22:23.279) - Dummy-6 (20508):
Thread 4784, build\x86_64\remote\winword.cpp, getSectionBreakType, 830:
error getting section count. There should be exactly 2 sections, count: 1

IO - inputCore.InputManager.executeGesture (07:22:26.254) - winInputHook (25672):
Input: kb(laptop):upArrow
INFO - watchdog.waitForFreezeRecovery (07:22:27.507) - watchdog (29136):
Starting freeze recovery after 10.009615799877793 seconds.
DEBUGWARNING - watchdog.waitForFreezeRecovery (07:22:27.507) - watchdog (29136):
Listing stacks for Python threads:
Python stack for thread 2064 (synthDrivers._espeak.BgThread):
  File "threading.pyc", line 1002, in _bootstrap
  File "threading.pyc", line 1045, in _bootstrap_inner
  File "synthDrivers\_espeak.pyc", line 201, in run
  File "queue.pyc", line 171, in get
  File "threading.pyc", line 327, in wait

Python stack for thread 30256 (watchdog.CancellableCallThread.execute(<CFunctionType object at 0x05F7B300>)):
  File "threading.pyc", line 1002, in _bootstrap
  File "threading.pyc", line 1045, in _bootstrap_inner
  File "watchdog.pyc", line 382, in run
  File "threading.pyc", line 629, in wait
  File "threading.pyc", line 327, in wait

Python stack for thread 14712 (visionEnhancementProviders.NVDAHighlighter.NVDAHighlighter):
  File "threading.pyc", line 1002, in _bootstrap
  File "threading.pyc", line 1045, in _bootstrap_inner
  File "threading.pyc", line 982, in run
  File "visionEnhancementProviders\NVDAHighlighter.pyc", line 452, in _run
  File "winUser.pyc", line 460, in getMessage

Python stack for thread 29136 (watchdog):
  File "threading.pyc", line 1002, in _bootstrap
  File "threading.pyc", line 1045, in _bootstrap_inner
  File "threading.pyc", line 982, in run
  File "watchdog.pyc", line 159, in _watcher
  File "watchdog.pyc", line 166, in waitForFreezeRecovery
  File "logHandler.pyc", line 64, in getFormattedStacksForAllThreads

Python stack for thread 25672 (winInputHook):
  File "threading.pyc", line 1002, in _bootstrap
  File "threading.pyc", line 1045, in _bootstrap_inner
  File "threading.pyc", line 982, in run
  File "winInputHook.pyc", line 81, in hookThreadFunc

Python stack for thread 10304 (UIAHandler.UIAHandler.MTAThread):
  File "threading.pyc", line 1002, in _bootstrap
  File "threading.pyc", line 1045, in _bootstrap_inner
  File "threading.pyc", line 982, in run
  File "UIAHandler\__init__.pyc", line 544, in MTAThreadFunc
  File "queue.pyc", line 171, in get
  File "threading.pyc", line 327, in wait

Python stack for thread 23052 (ThreadPoolExecutor-0_0):
  File "threading.pyc", line 1002, in _bootstrap
  File "threading.pyc", line 1045, in _bootstrap_inner
  File "threading.pyc", line 982, in run
  File "concurrent\futures\thread.pyc", line 81, in _worker

Python stack for thread 21128 (hwIo.ioThread.IoThread):
  File "threading.pyc", line 1002, in _bootstrap
  File "threading.pyc", line 1045, in _bootstrap_inner
  File "hwIo\ioThread.pyc", line 258, in run

Python stack for thread 25968 (MainThread):
  File "nvda.pyw", line 415, in <module>
  File "core.pyc", line 919, in main
  File "wx\core.pyc", line 2262, in MainLoop
  File "wx\core.pyc", line 3427, in <lambda>
  File "core.pyc", line 849, in processRequest
  File "core.pyc", line 865, in Notify
  File "queueHandler.pyc", line 97, in pumpAll
  File "queueHandler.pyc", line 64, in flushQueue
  File "scriptHandler.pyc", line 243, in _queueScriptCallback
  File "keyboardHandler.pyc", line 571, in executeScript
  File "inputCore.pyc", line 224, in executeScript
  File "scriptHandler.pyc", line 295, in executeScript
  File "browseMode.pyc", line 558, in <lambda>
  File "browseMode.pyc", line 516, in _quickNavScript
  File "browseMode.pyc", line 2431, in _iterTextStyle
  File "browseMode.pyc", line 2224, in _extractStyles
  File "treeInterceptorHandler.pyc", line 255, in getTextWithFields
  File "NVDAObjects\window\winword.pyc", line 807, in getTextWithFields

DEBUGWARNING - scriptHandler.executeScript (07:22:27.963) - MainThread (25968):
error executing script: <bound method BrowseModeTreeInterceptor.addQuickNav.<locals>.<lambda> of <NVDAObjects.window.winword.WordDocumentTreeInterceptor object at 0x095CAF50>> with gesture 'plus'
Traceback (most recent call last):
  File "scriptHandler.pyc", line 295, in executeScript
  File "browseMode.pyc", line 558, in <lambda>
  File "browseMode.pyc", line 516, in _quickNavScript
  File "browseMode.pyc", line 2431, in _iterTextStyle
  File "browseMode.pyc", line 2224, in _extractStyles
  File "treeInterceptorHandler.pyc", line 255, in getTextWithFields
  File "NVDAObjects\window\winword.pyc", line 789, in getTextWithFields
  File "baseObject.pyc", line 41, in __get__
  File "NVDAObjects\window\winword.pyc", line 1037, in _get_isCollapsed
  File "monkeyPatches\comtypesMonkeyPatches.pyc", line 86, in new__getattr__
  File "comtypes\client\lazybind.pyc", line 168, in __getattr__
  File "comtypes\automation.pyc", line 807, in _invoke
  File "monkeyPatches\comtypesMonkeyPatches.pyc", line 38, in __call__
exceptions.CallCancelled: COM call cancelled
DEBUG - UIAHandler.shouldUseUIAInMSWord (07:22:27.966) - MainThread (25968):
Using UIA due to suitable Office version: (16, 0, 17531)
INFO - watchdog.waitForFreezeRecovery (07:22:28.013) - watchdog (29136):
Recovered from freeze after 10.515615799929947 seconds.
DEBUG - watchdog._waitUntilNormalCoreAliveTimeout (07:22:28.479) - watchdog (29136):
Potential freeze, waiting up to 10 seconds.
IO - speech.speech.speak (07:22:30.389) - MainThread (25968):
Speaking ['No previous same style text']

Expected behavior:

No freeze when no next or previous styles have been found.

NVDA logs, crash dumps and other attachments:

n/a

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

alpha-31919,383b2044 (2024.3.0.31919)

Windows version:

Windows 11 23 H2

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

MS Office Word 365 MSO (Version 2403 Build 16.0.17425.20176) 64 Bit

Other information about your system:

Asus ROG Strix Intel I12900HK 5 ghz, 32gb DDR, Grafics NVIDIA GTX 3070TI 8 GB dedicated storage.

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.

no

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

No add-ons in use

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

yes
ONKYO.docx

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#prioritytriagedHas been triaged, issue is waiting for implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions