-
-
Notifications
You must be signed in to change notification settings - Fork 739
Avoid crash in Chrome, issue 41487612 #16893
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
Conversation
… when terminating the backend in the UI thread, and if this does not occur, leak the COM object rather than crashing the browser.
WalkthroughThe changes enhance the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
I think terminating a thread or terminating its message loop without cleaning up COM objects would be a violation of COM rules on the part of the application anyway, so I wouldn't consider this a problem with this PR as such. |
jcsteh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the oversight.
| // See https://issues.chromium.org/issues/41487612 | ||
| // In most cases this will be released in renderThread_terminate. | ||
| // However in the unlikely case terminate can't run, | ||
| // it will be deleted along with the backend, but in an RPC thread! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be misconstrued to mean that even with the code below, it will be deleted from the wrong thread. Perhaps this could say "if we don't do anything here, it will be deleted along with..."
user_docs/en/changes.md
Outdated
| * Playing NVDA sounds no longer fails on a mono audio device. (#16770, @jcsteh) | ||
| * NVDA will report addresses when arrowing through To/CC/BCC fields in outlook.com / Modern Outlook. (#16856) | ||
| * NVDA now handles add-on installation failures more gracefully. (#16704) | ||
| * No longer cause Google Chrome to crash when closing a document or exiting Chrome. (#16893) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you move this to the "web browser fixes" sub-list at the start of bug fixes
| * NVDA will correctly announce radio and checkbox menu items when first entering sub-menus in Google Chrome and Mozilla Firefox. (#14550) | ||
| * NVDA's browse mode find functionality is now more accurate when the page contains emojis. (#16317, @LeonarddeR) | ||
| * In Mozilla Firefox, NVDA now correctly reports the current character, word and line when the cursor is at the insertion point at the end of a line. (#3156, @jcsteh) | ||
| * No longer cause Google Chrome to crash when closing a document or exiting Chrome. (#16893) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelDCurran or @seanbudd, I am reviewing the translation of this item.
Translating this sentence sounds a bit strange because grammatically, the subject is missing in this sentence.
Said otherwise, I wonder, what (or who) no longer causes Chrome to crash? Is it NVDA?
Or maybe I haven't understood the sentence correctly...
|
This should be:
NVDA no longer causes Google Chrome to crash when closing a document or
exiting Chrome.
|
Link to issue number:
Fixes Chrome issue 41487612
Fixes Chrome crash introduced in NVDA pr #14647
Summary of the issue:
Google has detected crashes in Chrome when users are running NVDA.
Exact steps to reproduce are not known, but it is when an NVDA virtual buffer is destroyed. Could be on Chrome exit, NVDA exit, or closing a Chrome window.
Chrome issue: https://issues.chromium.org/issues/41487612
It shows that a COM object tries to be released from an RPC worker thread by NVDA's in-process code, which causes Chrome to crash.
NVDA pr #14647 introduced code to hold a reference to the document root accessible on the virtual buffer, so that NVDA could check if the document had died. However, it is this COM object that is automatically released when the virtual buffer id destroyed from an RPC worker thread.
The COM object should really however be released when the virtual buffer is terminated in the correct UI thread, before destruction.
Description of user facing changes
No longer cause Google Chrome to crash when closing a document or exiting Chrome.
Description of development approach
Testing strategy:
Known issues with pull request:
In the very unlikely case that the virtual buffer cannot be terminated in the UI thread correctly (Perhaps that thread has been terminated, or the browser is exiting such that wm_destroy messages are not being sent), the document root accessible will be leaked I.e. never released. This may hold memory or other resources. However, the original behaviour of calling release from the wrong thread was much worse as it could crash the browser entirely.
Code Review Checklist:
Summary by CodeRabbit