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

NVDA freezes on Google Chrome when image contains huge base64 data #10227

Closed
JulienCochuyt opened this issue Sep 16, 2019 · 3 comments
Closed

NVDA freezes on Google Chrome when image contains huge base64 data #10227

JulienCochuyt opened this issue Sep 16, 2019 · 3 comments

Comments

@JulienCochuyt
Copy link
Collaborator

@JulienCochuyt JulienCochuyt commented Sep 16, 2019

Steps to reproduce:

  • Open in Google Chrome a web page in which the src attribute of a focusable img element contains huge base64 data (>1MB).
    EDIT:
    Here is an example of such a page with an added .txt extension as GitHub does not support attaching .html files: i10227.html.txt
  • In browse mode, move to the incriminated image.

The issue does not occur in Firefox, but the Python Console freezes as soon as you try to access the IA2Attributes dictionary of the focused object.

Actual behavior:

NVDA freezes.
A core dump show it is stuck in IAccessibleHandler.splitIA2Attribs
timeit show it takes on my system around 600ms to complete the call with given IA2 attributes string vs around 15us for the same call without the base64 data.

Expected behavior:

NVDA not frozen.

System configuration

NVDA installed/portable/running from source:

Any.

NVDA version:

Reproduced with NVDA from 2018.1 to 2019.2
Earlier versions behave well in the same situations (tested from 2016.4 to 2017.4)

Windows version:

Windows 10 ver. 1903 (18362.356)

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

Google Chrome Version 77.0.3865.75 (64 bits)

Other information about your system:

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.

2018.1 - 2019.2: KO.
2016.4 - 2017.4: OK.

@JulienCochuyt
Copy link
Collaborator Author

@JulienCochuyt JulienCochuyt commented Sep 16, 2019

The fastest workaround I could come up with is at the beginning of IAccessibleHandler.splitIA2Attribs to use the re module to replace r"base64\\,[A-Za-z0-9+/=]+" with ""base64,<truncated>" in the passed attributes string.
To avoid a useless performance penalty, I've triggered the regex substitution only if the length of the attributes string exceeds a threshold, say 4096.

It seems to circumvent the present issue, but there could for sure be a better solution, covering more cases.

By example, the huge base64 data is still uselessly present in the Virtual Buffer data, which could be avoided by impacting the C++ part.

Anyone please have a better idea?
Otherwise, I'll file a PR if the first successful tests are confirmed.

cc @michaelDCurran
cc @frederic-brugnot

JulienCochuyt added a commit to accessolutions/nvda that referenced this issue Sep 17, 2019
JulienCochuyt added a commit to accessolutions/nvda that referenced this issue Sep 17, 2019
michaelDCurran pushed a commit that referenced this issue Sep 24, 2019
…ome (#10227) (#10231)

* IA2: Do not treat huge base64 data as NVDA might freeze in Google Chrome (#10227)

* Refine comment

Review action #10231 (comment)
michaelDCurran pushed a commit that referenced this issue Sep 24, 2019
…ome (#10227) - Py2 backport to beta (#10240)

* IA2: Do not treat huge base64 data as NVDA might freeze in Google Chrome (#10227)

* Refine comment

Review action #10231 (comment)
@zahra21
Copy link

@zahra21 zahra21 commented Mar 4, 2020

hi Julien.
when i read the title and comments, i thought that its the same issue which you fixed in 2019.2.1.
am i right?

@JulienCochuyt
Copy link
Collaborator Author

@JulienCochuyt JulienCochuyt commented Mar 5, 2020

Indeed.
If I remember correctly, this issue should now be fixed as all related PRs have been merged a while ago.
We probably just missed to close this issue back then.
Is anyone experiencing a faulty behavior in this scope with latest NVDA?

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

No branches or pull requests

2 participants