react-native: EXC_CORPSE_NOTIFY iOS crash when using native modules
- I have reviewed the documentation
- I have searched existing issues
- I am using the latest React Native version
The app intermittently crashes when resolving or rejecting a promise in a native module. Possibly related to https://github.com/facebook/react-native/issues/5011.
This reproduces with several native modules so I don’t think it’s related to a specific module.
Environment
Environment:
OS: macOS High Sierra 10.13.3
Node: 9.5.0
Yarn: 1.3.2
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: ^16.3.0-alpha.1 => 16.3.0-alpha.3
react-native: 0.55.0 => 0.55.0
Steps to Reproduce
- Create a simple Native Module
- Use it
Expected Behavior
I expect the data to flow back and forth as documented.
Actual Behavior
The app intermittently crashes with what looks like a memory issue.
From my observation I think it happens when resolving or rejecting a promise from Objective-C.
Here’s a screenshot from the crash organizer. Note that the crash occurred on thread 10, not the main thread:

So it looks like it’s somewhere in this code:
I see that code can throw this exception:
Exception ‘%@’ was thrown while invoking %s on target %@ with params %@\ncallstack: %@", exception
But I don’t see that error anywhere in the crash log so I’m not sure where to find it. I’m not sure if this was the actual exception, since the crash report says EXC_CORPSE_NOTIFY so it may be a red herring
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 4
- Comments: 28 (8 by maintainers)
Think this issue should be re-opened as there seems to be more people getting this issue, including myself?
We’re having the same issue in React Native 59.9 It only crashes on iOS. It only crashes in production. It doesn’t always crash. It crashes without doing anything (just starting the app and waiting on a static screen). It crashes after 3-10 seconds We don’t download heavy amounts of data. It has the exact same com.facebook.react.ExceptionsManagerQueue stacktrace. In the complete logfile there is only one line of code coming from us and it’s in com.apple.main-thread: right before UIKitCore and GraphicsServices, so it’s very likely not coming from our code.
We do connect to quite a few native-modules: From react-native:
From third party:
Edit:
Never ever have I experienced something like this, nor do I have any clue what could be the cause.
@keremaydin52 this solution worked for me
https://github.com/kmagiera/react-native-gesture-handler/issues/320#issuecomment-554808528
@MrKriegler Thanks mate. I have added Firebase Crashlytics today and found that the problem is due to react-native-gesture-handler. I was just looking for the solution and saw your comment.
is there any solution for this issue? facing same issue in review process in appstore. with real devices and emulators everything working perfectly. but when it put as new production release they are rejecting build and crash reports same as this report.
@solixmedia We rewrote the app in Swift and got rid of React Native.
seems like we are seeing this:
I was just able to reproduce what I think is the same issue in the simulator by pressing <kbd>⌘R</kbd> a few times:
Interestingly, the stack trace is identical, but this says
EXC_BAD_ACCESSvs.EXC_CORPSE_NOTIFY. I wonder if the difference is because the former is a debug build but the latter is a release build.I tried to inspect some of the variables in lldb, but then Xcode crashed 🙄