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 instabilities mostly in console windows #15850

Closed
beqabeqa473 opened this issue Nov 28, 2023 · 17 comments · Fixed by #16483
Closed

UIA instabilities mostly in console windows #15850

beqabeqa473 opened this issue Nov 28, 2023 · 17 comments · Fixed by #16483
Labels
app/windows-terminal New terminal app, potentially supersedes app/windows-console (repo: microsoft/terminal) needs-technical-investigation A technical investigation is required to progress the issue. p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Milestone

Comments

@beqabeqa473
Copy link
Contributor

beqabeqa473 commented Nov 28, 2023

CC @michaelDCurran
Instabilities with UIA implementation was discovered mostly when working in console windows, but it might also be reproduceable with other software implementing UIA. It is not fixed by #14888 and was also reproduceable before.
Unfortunately git -P log -1000 doesn't cause this, seems it is not so fast to output stdout.
For this cat should be available on system. Cat is usually installed with other unix tools when installing git for windows.

Steps to reproduce:

First problem:
execute in NVDA repository
git -P log -1000 > log.txt
cat log.txt
Second problem:
execute in NVDA repository:
git -P log -10000

Actual behavior:

For the first problem:
UIA stops responding when outputting large amount of text with cat and on my machine NVDA stop reading everything related to UIA.
After one to five minutes, everything gets back to normal state
For the second problem:
after outputting a large amount of text with git -P log -10000, if you weren't able to reproduce, run twice, NVDA stops reading of console output in any new or existing console windows.
When restarting NVDA, there is no exit soundanymore.

Expected behavior:

UIA should be stable enough in NVDA to nott disturb user.

NVDA logs, crash dumps and other attachments:

No logs

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

alpha-30120,8052b68f (2024.1.0.30120)

Windows version:

Windows 11 23H2 (AMD64) build 22631.2428

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

ConHost

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.

Reproduceable with all Previous versions.

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

@beqabeqa473
Copy link
Contributor Author

About problem related to stop reading an output from console windows, it is %100 reproduceable when holding controll to stop speech untill output ends.

@Danstiv
Copy link
Contributor

Danstiv commented Nov 28, 2023

About problem related to stop reading an output from console windows, it is %100 reproduceable when holding controll to stop speech untill output ends.

I was also able to reproduce this.

@michaelDCurran
Copy link
Member

michaelDCurran commented Nov 28, 2023 via email

@beqabeqa473
Copy link
Contributor Author

beqabeqa473 commented Nov 28, 2023 via email

@Adriani90
Copy link
Collaborator

cc: @codeofdusk

@a11cf0
Copy link

a11cf0 commented Nov 29, 2023

I can also confirm this. When this happens, UIA completely stops working at least for several minutes.

@michaelDCurran
Copy link
Member

michaelDCurran commented Nov 29, 2023 via email

@beqabeqa473
Copy link
Contributor Author

For small amounts of texts, #14888 is better, but unfortunately, if we have to work with larger amounts than outlined in the description of #14888, we are experiencing these issues.
As for stopping to read an output, i am experiencing it very often when building a project several times in one console session.
These are examples to reliably reproduce described issues.

@bramd
Copy link
Contributor

bramd commented Nov 29, 2023

I also observed the same behavior with latest alpha. The strange thing is that I ran a build with an earlier version of PR #14888 and that seemed to have better performance and at least dod not drop all other UIA events. I was observing build output from a remote Linux machine in Windows console and could alt+tab to an Edge window that was playing a Youtube video. I knew the system was still responsive since I could control the Youtube video, but NVDA did not produce any output in speech or braille and only started working after minutes. Even then, some UIA events tseemed to be dropped and new output in the console was not announced.

@Danstiv
Copy link
Contributor

Danstiv commented Dec 1, 2023

NVDA stops reading of console output in any new or existing console windows.
When restarting NVDA, there is no exit soundanymore.

100% reproduceable on my machine with the following steps:

  1. Enable UIA windows console support.
  2. Select Diff Match Patch diff algorithm.
  3. Create text document with 👆 emoji or download test.txt.
  4. Open cmd in directory in which the file is saved.
  5. Execute chcp 65001
  6. Execute type test.txt

After this, the problem described above occurs.

This only happens when DMP plus UIA support is enabled.
Also, after the emoji is outputted to the console, nvda_dmp.exe disappears from the task manager.

@Danstiv
Copy link
Contributor

Danstiv commented Dec 1, 2023

CC @codeofdusk

@Adriani90
Copy link
Collaborator

@bramd wrote:

I ran a build with an earlier version of PR #14888

Can you post the last commit of the PR you are running?

@Danstiv wrote:

Also, after the emoji is outputted to the console, nvda_dmp.exe disappears from the task manager.

cc: @josephsl maybe you can look into this?

@josephsl
Copy link
Collaborator

josephsl commented Dec 1, 2023

Hi,

I cannot really look into this as NVDA dmp module is not really my area of expertise and to focus on school.

Thanks.

@Danstiv
Copy link
Contributor

Danstiv commented Dec 2, 2023

Also, after the emoji is outputted to the console, nvda_dmp.exe disappears from the task manager.

I patched dmp a little and got the following:

Traceback (most recent call last):
  File "D:\dev\nvda\source\..\include\nvda_dmp\nvda_dmp.py", line 32, in <module>
    for op, text in diff(oldText, newText, counts_only=False):
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: String contains high-code-point characters that cannot be represented natively on this platform.

@beqabeqa473
Copy link
Contributor Author

Just for clarity, #14888 have noticeable positive impact, when using windows terminal with UIA notifications.
So, it had problems with UIA enhanced processing turned off, and performance was drastically improved after turning it back on.
Both of problems are not reproduceable with UIA notifications selected instead of diffing, however, UIA notifications are not implemented in conhost, and there we still have problems.

@Danstiv
Copy link
Contributor

Danstiv commented Dec 3, 2023

1

after outputting a large amount of text with git -P log -10000, if you weren't able to reproduce, run twice, NVDA stops reading of console output in any new or existing console windows.

2

Also, after the emoji is outputted to the console, nvda_dmp.exe disappears from the task manager.

Cannot reproduce with fast_diff_match_patch downgraded to diff_match_patch.

@seanbudd seanbudd added p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority app/windows-terminal New terminal app, potentially supersedes app/windows-console (repo: microsoft/terminal) triaged Has been triaged, issue is waiting for implementation. labels Dec 7, 2023
@seanbudd seanbudd added the needs-technical-investigation A technical investigation is required to progress the issue. label Apr 29, 2024
seanbudd pushed a commit that referenced this issue May 9, 2024
Follow up to #16027
Fixes #15850

Summary of the issue:
Diff Match Patch proxy crashes and the calling thread deadlocks

Description of user facing changes
Diff Match Patch proxy will become more stable

Description of development approach
Refactored DiffMatchPatch diff handler.

Now, when reading from stdout of a proxy process, if not enough bytes are read, the return code is checked.

If a return code was received, an exception is raised and a fallback to difflib occurs.
@nvaccessAuto nvaccessAuto added this to the 2024.3 milestone May 9, 2024
@seanbudd
Copy link
Member

seanbudd commented May 9, 2024

@beqabeqa473 - can you please confirm this is fixed with the next alpha build created

XLTechie pushed a commit to XLTechie/xlnvda that referenced this issue May 10, 2024
Follow up to nvaccess#16027
Fixes nvaccess#15850

Summary of the issue:
Diff Match Patch proxy crashes and the calling thread deadlocks

Description of user facing changes
Diff Match Patch proxy will become more stable

Description of development approach
Refactored DiffMatchPatch diff handler.

Now, when reading from stdout of a proxy process, if not enough bytes are read, the return code is checked.

If a return code was received, an exception is raised and a fallback to difflib occurs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app/windows-terminal New terminal app, potentially supersedes app/windows-console (repo: microsoft/terminal) needs-technical-investigation A technical investigation is required to progress the issue. p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants