react-native/Libraries/Utilities
Albert Brand d2de604721 Android: fix JSC crash in dev
Summary:
On Android with dev mode on, we're seeing a regular SIGSEGV when pushing a lot of animation declarations over the bridge. We tracked this down to being not specific to animations, but the crash is caused in `deepFreezeAndThrowOnMutationInDev`.

Specifically: the provided object to freeze is modified while looping, replacing the current key access to a getter/setter. After the modification, JSC crashes during retrieval of the next key - but only when there are a lot of events passing over the bridge.

We have a hunch that this is due to a bug in JSC object enumeration but did we not look into it further yet. Any help here is welcome. The JS code seems all right at first sight and shouldn't cause a segmentation crash.

The workaround in this PR is to retrieve the keys first from the object and then looping over that array. In our app and in a reduced app test case this fixes the crash.

If needed I can provide the reduced app test case. It's really tricky to make a test for this as it requires to be run
Closes https://github.com/facebook/react-native/pull/11804

Differential Revision: D4403483

Pulled By: davidaurelio

fbshipit-source-id: a31e5cff734e96bfec56e4a39dc1c6854798e245
2017-01-11 08:58:30 -08:00
..
__mocks__ Reorganize core JS files 2016-10-11 10:14:28 -07:00
__tests__ Reorganize core JS files 2016-10-11 10:14:28 -07:00
differ Auto-fix lint errors 2016-08-09 06:43:46 -07:00
BackAndroid.android.js FIX: Call all android back key handlers before invoking default 2016-11-11 00:28:40 -08:00
BackAndroid.ios.js fixed polyfill for BackAndroid 2016-08-30 10:58:45 -07:00
Dimensions.js Update Dimensions when device orientation changes 2016-03-15 05:49:25 -07:00
HMRClient.js Auto-fix lint errors 2016-08-09 06:43:46 -07:00
HMRLoadingView.android.js Show a Toast for HMR 2016-02-27 15:58:35 -08:00
HMRLoadingView.ios.js Show a Toast for HMR 2016-02-27 15:58:35 -08:00
HeapCapture.js upload JSC heap capture to bundle server 2016-08-02 08:13:57 -07:00
MatrixMath.js Remove knowledge of fbjs from the packager 2016-03-02 04:28:38 -08:00
PerformanceLogger.js Remove additional JSON encoding for native->JS communication 2016-09-19 04:44:12 -07:00
PixelRatio.js PixelRatio.pixel() 2016-01-15 05:15:31 -08:00
Platform.android.js Apple TV support 4: support for input (tvOS focus engine) 2016-12-19 06:28:40 -08:00
Platform.ios.js Apple TV support 4: support for input (tvOS focus engine) 2016-12-19 06:28:40 -08:00
RCTLog.js Stop throwing yellew boxes when we warn from native 2016-12-27 10:43:33 -08:00
buildStyleInterpolator.js Do not call `toString` on functions in buildStyleInterpolator 2016-12-07 11:58:28 -08:00
clamp.js RN: Cleanup OSS JS & Flow Declarations 2016-11-20 17:58:29 -08:00
createStrictShapeTypeChecker.js Upgrade to React v15.3.0-rc.2 2016-07-21 09:13:29 -07:00
deepFreezeAndThrowOnMutationInDev.js Android: fix JSC crash in dev 2017-01-11 08:58:30 -08:00
defineLazyObjectProperty.js RN: Implement `defineLazyObjectProperty` 2016-06-29 16:43:17 -07:00
deprecatedPropType.js Upgrade to React v15.3.0-rc.2 2016-07-21 09:13:29 -07:00
dismissKeyboard.js [ReactNative] Sync [react_native] Fix keyboard behavior for android 2015-08-14 02:58:37 -08:00
groupByEveryN.js Flowify Library/Utilities/ 2015-03-23 16:47:26 -08:00
infoLog.js Move infoLog to OSS 2016-05-17 12:43:40 -07:00
logError.js Flowify Library/Utilities/ 2015-03-23 16:47:26 -08:00
mapWithSeparator.js Optimize and flowify mapWithSeparator 2016-05-26 12:28:55 -07:00
mergeFast.js Fix typo 2015-08-06 20:22:24 -08:00
mergeIntoFast.js Bugfix - Typos 2015-12-15 09:09:32 -08:00
stringifySafe.js [ReactNative] improve console logging a little bit 2015-05-04 18:57:03 -08:00
throwOnWrongReactAPI.js Show better error message when accessing React APIs on React Native 2016-06-14 06:28:26 -07:00
truncate.js Auto-fix lint errors 2016-08-09 06:43:46 -07:00
utf8.js Add support for missing XHR response types 2016-04-11 05:54:28 -07:00