Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIA console: cmd/powershell crashes completely with a lot of text that scrolls #10406

Closed
aaclause opened this issue Oct 20, 2019 · 10 comments · Fixed by #10513
Closed

UIA console: cmd/powershell crashes completely with a lot of text that scrolls #10406

aaclause opened this issue Oct 20, 2019 · 10 comments · Fixed by #10513
Milestone

Comments

@aaclause
Copy link
Contributor

aaclause commented Oct 20, 2019

Steps to reproduce:

  1. Ensure you have set Windows console support to "preferred UIA".
  2. Open a terminal and execute a script/command that returns a lot of text.
  3. Wait a few seconds.

Actual behavior:

The terminal is frequently crashing (closes completely). No problem with legacy mode. I raised following errors in the log on several attempts (sometimes there is no traceback in the log):

Traceback (most recent call last):
  File "NVDAObjects\UIA\__init__.pyc", line 284, in __init__
  File "comtypesMonkeyPatches.pyc", line 26, in __call__
_ctypes.COMError: (-2147220991, 'An event was unable to invoke any of the subscribers', (None, None, None, 0, None))None, 0, None))
DEBUGWARNING - NVDAObjects.behaviors.LiveText._monitor (05:48:57.681) - Dynamic_WinConsoleUIAEditableTextWithAutoSelectDetectionUIA._monitorThread (6592):
Error getting lines or calculating new text
Traceback (most recent call last):
  File "NVDAObjects\behaviors.pyc", line 301, in _monitor
  File "NVDAObjects\UIA\winConsoleUIA.pyc", line 286, in _getTextLines
  File "comtypesMonkeyPatches.pyc", line 26, in __call__
_ctypes.COMError: (-2147220991, 'An event was unable to invoke any of the subscribers', (None, None, None, 0, None))
Traceback (most recent call last):
  File "NVDAObjects\__init__.pyc", line 77, in __call__
  File "NVDAObjects\UIA\__init__.pyc", line 954, in __init__
NVDAObjects.InvalidNVDAObject: no windowHandle

Expected behavior:

No terminal crash.

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

alpha-18955,12f27acf

Windows version:

10 1903 (build 18990.1)

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

cmd, powershell, bash, etc..

Other information about your system:

N/A

Other questions

Does the issue still occur after restarting your PC?

Yes

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

No problem in legacy mode.

CC @codeofdusk

@lukaszgo1
Copy link
Contributor

Also cc @LeonarddeR @feerrenrut. My personal opinion is that unless this can be fixed in time for 2019.3 we should reconsider making UIA the default for terminals.

@codeofdusk
Copy link
Contributor

Not able to reproduce this – @lukaszgo1 does your C program from #6291 work for this?

@lukaszgo1
Copy link
Contributor

@Andre9642 Is there any particular command with which you are able to reproduce this consistently? Also I believe that you are heavy Braille user is this reproducible without braille display attached?

@francipvb
Copy link
Contributor

Hello,

Try this, I've posted also to #6291.

Run this in a CMD or a PowerShell session. Note that you need to have python 3 installed with the launcher.

    py -3 -c "for x in range(100000): print(x)"

Cheers,

@aaclause
Copy link
Contributor Author

Or more simply (in pure-batch):

@for /l %x in (1, 1, 100000000) do @echo %x

Cmd crashes around 9100 for me.
This bug is critical for me. In this case it does not matter, but during compilations it's very annoying. So I don't use UIA for Windows Console support in production environment. For this reason and other bugs, I consider UIA still in alpha Stage.

@lukaszgo1
Copy link
Contributor

I can reproduce this with @Andre9642 's test case on my 1903 VM. @codeofdusk Are you planning to work on this? It is certainly worse that #6291 because terminal crashes completely, so it prevents users from completing whatever they were doing.

@codeofdusk
Copy link
Contributor

I'm now able to reproduce this, seems to be caused by 9fbd6b4.

@codeofdusk
Copy link
Contributor

I can open a PR to revert 9fbd6b4, which should resolve this issue, but will make auto-read unreliable in situations when the visible ranges cannot be trusted (see #9957). Thoughts? Cc @feerrenrut @LeonarddeR @michaelDCurran @lukaszgo1 @francipvb

@codeofdusk
Copy link
Contributor

Reverting the aforementioned commit would not break text review in these situations, and in theory increases performance (we're only diffing the visible text, not all the text).

@michaelDCurran
Copy link
Member

michaelDCurran commented Nov 19, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants