-
-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not capturing correct backtrace of Kotlin Coroutine Crashes #4465
Comments
An example of this. Here's the raw stacktrace shown in Sentry:
but when I symbolicate the same crash in Xcode it has this extra section at the top:
which shows the actual line of code that threw the exception. The crashing code is written in Kotlin multiplatform mobile, but the Xcode crash symbolicator has no official support for KMM, so I believe this is some kind of general exception backtrace that Xcode is showing. Sentry should support these backtraces or else I cannot use it to fix crashes like this. |
Thanks for the info. If I'm not mistaken, @brustolin is currently investigating this, and will get back to you. |
Yes. Im trying to figure this out. We get back to you for any news. |
@silverhammermba how are you initializing the SDK? can you show the setup |
@buenaflor Here is our function for initializing Sentry public func enableCrashReporting(accessToken: String, environment: String?, enablePerformanceMonitoring: Bool) {
SentrySDK.start { options in
options.dsn = accessToken
options.environment = environment ?? "Public"
// percent of events that get recorded
options.sampleRate = 1 // error events
if enablePerformanceMonitoring {
options.tracesSampleRate = 1 // performance events
}
// auto capture extra issues
options.enableCaptureFailedRequests = true
options.enableAppHangTracking = true
options.maxBreadcrumbs = 2_000
// declare modules as "in-app"
options.add(inAppInclude: "KMMUnifiedBackend")
// omitting other added modules unrelated to this crash
}
} |
@silverhammermba the problem is that you are initializing the SDK with the Sentry Cocoa SDK initializer. You need to use the KMP initializer because we filter the SIGABRT report and create instead a new crash event that contains the proper stacktrace etc... If you need to set native options that we haven't exposed in the KMP layer then you should use |
@silverhammermba Can you confirm if @buenaflor suggested worked for you? |
@brustolin I will try it out and let you know if it works. I'm a bit busy at the moment but I'll report back when I get time to try it. |
Platform
iOS
Environment
Production
Installed
Swift Package Manager
Version
8.36.0
Xcode Version
Unknown
Did it work on previous versions?
No response
Steps to Reproduce
Unclear at the moment.
Expected Result
Crashes reported by the SDK, such as SIGABRT and SIGPIPE have the Last Exception Backtrace which contain more information on the exception's cause.
Actual Result
The symbolicated event in Sentry only contains the global terminateWithUnhandledException, and to get the last exception backtrace the user needs to find the corresponding exception in Apple TestFlight.
From original investigation, the first option would be looking if it is possible to capture a CoroutineException in this case.
Are you willing to submit a PR?
No response
The text was updated successfully, but these errors were encountered: