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
fix: use a WeakPtr so we do not UAF the store in FunctionLifetimeMonitor #22056
Conversation
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.
lgtm
4502022
to
a80b985
Compare
|
||
private: | ||
context_bridge::RenderFramePersistenceStore* store_; | ||
base::WeakPtr<context_bridge::RenderFramePersistenceStore> store_; |
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.
Would it be reasonable to eagerly delete the FLMs when the store is deleted? rather than leaving them hanging around until they happen to wake up and notice they're useless now since their store is gone
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.
@nornagon They will all be deleted at the same time (give or take some milliseconds). The store is only ripped out when the context is destroyed. The function monitors will be ripped apart during the final GC run
Release Notes Persisted
|
I have automatically backported this PR to "7-1-x", please check out #22112 |
I have automatically backported this PR to "9-x-y", please check out #22113 |
I have automatically backported this PR to "8-x-y", please check out #22114 |
We already did this for the ObjectLifeMonitor, should also do it for the FunctionLifetimeMonitor
Notes: Fixed issue where renderers could crash during GC when using the
contextBridge
module