sentry-cocoa
sentry-cocoa copied to clipboard
`SentryCrashMonitor` crashes on macOS and iOS
Environment
How do you use Sentry?
Sentry SaaS (sentry.io)
Which SDK and version?
7.5.2
Steps to Reproduce
- Look at this report: https://sentry.io/organizations/sindresorhus/issues/2847452452/events/76b39b939f954ff1b446cf770b33d3ba/
- Notice how it crashed in "Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_CPPException.cpp:169"
Expected Result
I expected the crash monitor to not crash.
Actual Result
The reason I think the crash monitor itself is crashing is that the crash reason is EXC_BAD_INSTRUCTION: callStackSymbols
. I don't access callStackSymbols
anywhere in my own code.
SentryCrashMonitor_CPPException.cpp:169 is calling g_originalTerminateHandler()
. As pointed out by you @sindresorhus, it could be that the crash monitor is crashing itself. Do you maybe have a way to reproduce this?
Do you maybe have a way to reproduce this?
I don't. It didn't crash for me. Just a crash report from a random user.
Thanks for the info, @sindresorhus. According to your report, it happened once. We will keep an eye on this, but without a repro, it will be hard to fix.
Longshot, but maybe it needs a NULL
check like here: https://github.com/kstenerud/KSCrash/pull/41/files
The original KSCrashMonitor_CPPException
has a few changes our SentryCrashMonitor_CPPException
doesn't have. I think a good start would be to include the latest fixes of KSCrash also into our SentryCrash.
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog
or Status: In Progress
, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
Please keep this open.
We see this fairly regularly on iOS. The first instance was 7.2.6, and the most recent was 7.9.0. We've had approximately 24k events over the past 7 months. Here's an example.
We haven't been able to find the root cause, as we've not triggered it locally.
Thanks for the information, @squarefrog. So you didn't see the problem before using 7.2.6
, or did you start using Sentry with 7.2.6
?
@philipphofmann that's a great question. We've used Sentry since 5.0.2
, so I think it's reasonable to assume we didn't get it before 7.2.6
Maybe it's related to https://github.com/getsentry/sentry-cocoa/blob/d2df66ae9612bf7621bc5da788d1cc107f0ba22f/Sources/SentryCrash/Recording/Monitors/SentryCrashMonitor_CPPException.cpp#L83 done in https://github.com/getsentry/sentry-cocoa/pull/1083 which was released with https://github.com/getsentry/sentry-cocoa/blob/master/CHANGELOG.md#720. Thanks for the input.
Also seeing this crash, and after upgrading it seems to be happening even more. This is pretty bad, as it's practically our only crash happening in our app.
I'm sorry about that. Thanks for the update, @mpasalic.
I have the same problem here, but it happens on iPad Pro, currently using sdk version 6.2.1, I found that the error started from iPadOS 15.0, I wonder if some new features of iPadOS 15.0 sdk are not compatible. I hope it can be solved as soon as possible, thank you
The same issue as @MountainTao has. We are now using SDK version 7.15.0
iPhones: iOS 16.0.0
iPads: iPadOS 15.3.0, 15.5.0
But the crash reason in Firebase Console is different, here are two examples:
Fatal Exception: NSInvalidArgumentException *** -[__NSDictionaryM setObject:forKey:]: object cannot be nil (key: title)
Fatal Exception: NSInvalidArgumentException -[SKStoreProductViewController sceneDisconnected:]: unrecognized selector sent to instance 0x1049c4600
I'm still seeing this: https://sentry.io/organizations/sindresorhus/issues/3410158760/events/5107abe27a2048b5bbf0aef1aa889195/
Unhandled: callStackSymbols
I found that the error started from iPadOS 15.0,
We have reports of this going back to iOS 14 (our minimum deployment version), so I'm not sure this is the cause.

Has there been any movement on this issue? It's one of our highest impact crashes, and we're still seeing it in sdk v7.23.0.
OS Version: iOS 15.6.1 (19G82)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Crashed Thread: 0
Application Specific Information:
NSException > terminating with %s exception of type %s > terminating with uncaught exception of type NSException > XTUM
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x39f58fb38 __pthread_kill
1 libsystem_pthread.dylib 0x4130733b8 pthread_kill
2 libsystem_c.dylib 0x345fa2520 abort
3 libc++abi.dylib 0x361a03b78 abort_message
4 libc++abi.dylib 0x3619f39c0 demangling_terminate_handler
5 libobjc.A.dylib 0x3617eec64 _objc_terminate
6 [REDACTED] 0x2011d95f8 CPPExceptionTerminate (SentryCrashMonitor_CPPException.cpp:171)
7 libc++abi.dylib 0x361a02f14 std::__terminate
8 libc++abi.dylib 0x361a05eb8 __cxa_rethrow
9 libobjc.A.dylib 0x3617ea6bc objc_exception_rethrow
10 CoreFoundation 0x32fc8acb0 CFRunLoopRunSpecific
11 GraphicsServices 0x367f7f370 GSEventRunModal
12 UIKitCore 0x334a7cb54 -[UIApplication _run]
13 UIKitCore 0x3347fe08c UIApplicationMain
14 [REDACTED] 0x20079e420 main ([REDACTED])
15 <unknown> 0x101fcdda4 <redacted>
Thanks for the info, @squarefrog. Now we know it's also happening on iOS.
Hello, we have also encountered this bug, which is the most frequent bug in our app.

OS Version: iOS 15.6.1 (19G82) Report Version: 104
Exception Type: EXC_CRASH (SIGABRT) Crashed Thread: 9
Application Specific Information: NSException > terminating with %s exception of type %s > terminating with uncaught exception of type NSException
Thread 9 Crashed:
0 libsystem_kernel.dylib 0x372199b38 __pthread_kill
1 libsystem_pthread.dylib 0x3e4fd73bc pthread_kill
2 libsystem_c.dylib 0x318e5e524 abort
3 libc++abi.dylib 0x3348bfb7c
Hello! We're having the same issue using "@sentry/react-native": "^3.2.13"
@philipphofmann
Thanks for the update, @ErrorPro.