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

HP Secure Browser support (#16377): Detect & prevent infinite loop in iterUIARangeByUnit #16394

Merged
merged 1 commit into from Apr 16, 2024

Conversation

tomaszw
Copy link
Contributor

@tomaszw tomaszw commented Apr 15, 2024

Link to issue number:

#16377

Summary of the issue:

We're experiencing NVDA locking up trying to infinitely split some text ranges, for example on www.bat.org when it tries to split the range representing "Submit" button into individual characters.

NVDA hangs completely in this scenario and has to be forcibly killed.

If the offending split is attempted, the hang always happens. Secure Browser seems to be provoking this split more, but we've also seen that in normal chromium-based browsers when using UIA instead of IAccessible2. This could be due to significant timing differences etc, as the virtualized browser has higher overhead.

Typical repro scenario involves navigating to www.bat.org then duplicating the tab & closing some of the dupes, until NVDA attempts the split and hangs.

Description of user facing changes

Detect & prevent the infinite loop so that NVDA remains responsive

Description of development approach

This is likely a deficiency in UIA text range implementation on the chromium side, as I don't see anything obviously wrong with the algorithm in iterRangeByUnit which is doing the split. Rewriting this UIA algorithm in C++ and running against offending website also hangs, always, in regular Google Chrome, Edge, and Secure Browser.

At the cost of extra Compare COM call we can detect that chromium is yielding same range infinitely, and therefore detect & shortcircuit the infinite loop on the NVDA side.

Testing strategy:

Manual testing

Known issues with pull request:

N/A

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

… loop in iterUIARangeByUnit

Summary of the issue:
We're experiencing NVDA locking up trying to infinitely split some text
ranges, for example on www.bat.org when it tries to split the range representing
"Submit" button into individual characters.

NVDA hangs completely in this scenario and has to be forcibly killed.

If the offending split is attempted, the hang always happens. Secure Browser seems to be provoking this split more,
but we've also seen that in normal chromium-based browsers when using UIA instead of IAccessible2.
This could be due to significant timing differences etc, as the virtualized
browser has higher overhead.

Typical repro scenario involves navigating to www.bat.org then duplicating the tab &
closing some of the dupes, until NVDA attempts the split and hangs.

Description of user facing changes:
Detect & prevent the infinite loop so that NVDA remains responsive

Description of development approach:
This is likely a deficiency in UIA text range implementation on the chromium
side, as I don't see anything obviously wrong with the algorithm in
iterRangeByUnit which is doing the split. Rewriting this UIA algorithm in C++
and running against offending website also hangs, always, in regular
Google Chrome, Edge, and Secure Browser.

At the cost of extra Compare COM call we can detect that chromium is yielding
same range infinitely, and therefore detect & shortcircuit the infinite loop
on the NVDA side.
@tomaszw tomaszw mentioned this pull request Apr 15, 2024
5 tasks
@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Apr 16, 2024
@tomaszw tomaszw marked this pull request as ready for review April 16, 2024 06:24
@tomaszw tomaszw requested a review from a team as a code owner April 16, 2024 06:24
@seanbudd seanbudd merged commit 11a2b4f into nvaccess:master Apr 16, 2024
1 check passed
@nvaccessAuto nvaccessAuto added this to the 2024.2 milestone Apr 16, 2024
tomaszw pushed a commit to tomaszw/nvda-hp that referenced this pull request Apr 17, 2024
…access#16395

Summary of the issue:
Changelog entries are missing for nvaccess#16392 nvaccess#16393 nvaccess#16394 nvaccess#16395

Description of user facing changes:
Added Changelog entries

Description of development approach:
N/A
tomaszw pushed a commit to tomaszw/nvda-hp that referenced this pull request Apr 17, 2024
…access#16395

Summary of the issue:
Changelog entries are missing for nvaccess#16392 nvaccess#16393 nvaccess#16394 nvaccess#16395

Description of user facing changes:
Added Changelog entries

Description of development approach:
N/A
tomaszw pushed a commit to tomaszw/nvda-hp that referenced this pull request Apr 17, 2024
…access#16395

Summary of the issue:
Changelog entries are missing for nvaccess#16392 nvaccess#16393 nvaccess#16394 nvaccess#16395

Description of user facing changes:
Added Changelog entries

Description of development approach:
N/A
seanbudd added a commit that referenced this pull request Apr 18, 2024
* Changelog entries for #16392 #16393 #16394 #16395

Summary of the issue:
Changelog entries are missing for #16392 #16393 #16394 #16395

Description of user facing changes:
Added Changelog entries

Description of development approach:
N/A

* Apply suggestions from code review

---------

Co-authored-by: Tomasz Wroblewski <tomasz.wroblewski@hp.com>
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants