Closed lavenzg closed 4 weeks ago
This pull request was exported from Phabricator. Differential Revision: D56094070
This pull request was exported from Phabricator. Differential Revision: D56094070
This pull request was exported from Phabricator. Differential Revision: D56094070
This pull request has been merged in facebook/hermes@699138c58e18eb0f6326c1361ae5c3b957afad94.
Summary: There is race condition between removing a RuntimeModule from the Runtime in the background thread (triggered from Domain finalizer) and adding a new RuntimeModule in the mutator.
After further investigation, we found that there is also race conditions between Debugger::willUnloadModule() called in the destructor of RuntimeModule and other Debugger actions.
This diff moves the destruction of RuntimeModule (and its removal from the list in Runtime) to the time of marking weak roots in Runtime.
Reviewed By: neildhar
Differential Revision: D56094070