mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
0c2db3256f
Summary:
In one of our test apps (actually on Mac not iOS, but same code) we very consistently crash in RCTCxxBridge.executeApplicationScript when js debugging, due to a timing issue where another thread has reset _reactInstance in between the null check on self->_reactInstance and usage of it on these lines:
```
} else if (self->_reactInstance) {
self->_reactInstance->loadScriptFromString(std::make_unique<NSDataBigString>(script),
```
The thread doing the reset is doing so switching the executorClass to WebSocketExecutor.
In the scenario we crash, the packager has a bundle ready and quickly returns it, though its a 34MB string being passed to NSDataBigString which must be taking long enough for the other thread to get a chance to reset.
## Changelog
[iOS] [Fixed] - Fix crash in RCTCxxBridge.executeApplicationScript
Pull Request resolved: https://github.com/facebook/react-native/pull/25991
Test Plan: Ran apple code path in normal from bundle file and js debugging scenarios.
Reviewed By: shergin
Differential Revision: D19186065
Pulled By: hramos
fbshipit-source-id: ae1d4b5b50b7fb33b74aba21addc2978e917479f