Does anyone use any crash reporting system for lin...
# kotlin-native
t
Does anyone use any crash reporting system for linux or mingw native? I am looking for something like sentry or firebase crashlytics. I am wondering if someone knows a tool which works. I know that for macOS there is dSYM, but what about the other native targets?
r
sentry should work, just not as easy as it could be, since we don't really focus on the sentry-native SDK as standalone a lot. We support pretty much all popular debug file formats: https://docs.sentry.io/platforms/native/data-management/debug-files/
t
Thanks, I am currently trying to integrate it with cinterop
I am not sure about the debug files on windows, but I think they may not be needed for windows from a quick test
@romtsn finally got Sentry to work on windows, but unfortunately I cannot figure out how to get the stack traces to report correctly. Currently using
sentry_value_set_stacktrace
to set the stack trace of a Kotlin throwable. However, sentry needs to symbolicate it, but even with a pdb file the Kotlin lines are useless. Any suggestions?
r
aren't these native (cpp/c) frames on the screenshot?
t
@romtsn it indeed looks like the pdb file only contains cpp/c symbols. The screenshot is actually a Kotlin exception, the console shows something like this:
Copy code
Uncaught Kotlin exception: kotlin.NotImplementedError: An operation is not implemented.
    at 0   ???                                 7ff6b4516f31       kfun:kotlin.Throwable#<init>(kotlin.String?){} + 97 
    at 1   ???                                 7ff6b451262c       kfun:kotlin.Error#<init>(kotlin.String?){} + 92 
    at 2   ???                                 7ff6b461503c       kfun:kotlin.NotImplementedError#<init>(kotlin.String){} + 92 
    at 3   ???                                 7ff6b4615130       kfun:kotlin.NotImplementedError#<init>(kotlin.String?;kotlin.Int;kotlin.native.internal.DefaultConstructorMarker?){} + 224 
    at 4   ???                                 7ff6b49d63ab       kfun:#main(){} + 699 
    at 5   ???                                 7ff6b49d666f       Konan_start + 111 
    at 6   ???                                 7ff6b4a488a3       Init_and_run_start + 99 
    at 7   ???                                 7ff6b45013b4       __tmainCRTStartup + 564 
    at 8   ???                                 7ff6b45014db       WinMainCRTStartup + 27 
    at 9   ???                                 7ffdc53c259d       __cxa_throw_bad_array_new_length + 30341868173 
    at 10  ???                                 7ffdc5c4af38       __cxa_throw_bad_array_new_length + 30350816296
I think the pdb file is not the solution to symbolication of Kotlin stack traces.
r
hmm, right.. I'm wondering if the symbols are there but just our backend is unable to symbolicate those because it doesn't recognize the platform or something
t
@romtsn It seems Sentry has issues with Kotlin mingw. For now I disabled pdb file creation, and upload already symbolicated stack traces to sentry. I think that
sentry_options_set_symbolize_stacktraces
is already supposed to symbolicate on the device, but that does not work (no DWARF 2 support?). The code is a bit hacky as I parse Kotlin throwable stack trace lines and upload those to sentry, but it works.
Unfortunately I just wasn't able to upload the line numbers, but that's fine
So Kotlin exceptions are now fine (uploaded using try/catch), but some other Native exceptions (which sentry uploads automatically) I cannot fix, probably due to no pdb file uploaded. Creating a pdb file seems to break Kotlin stack traces, so I cannot use it. So no way to debug errors like this unfortunately:
r
@romtsn It seems Sentry has issues with Kotlin mingw. For now I disabled pdb file creation, and upload already symbolicated stack traces to sentry. I think that
sentry_options_set_symbolize_stacktraces
is already supposed to symbolicate on the device, but that does not work (no DWARF 2 support?). The code is a bit hacky as I parse Kotlin throwable stack trace lines and upload those to sentry, but it works.
I have a strong feeling our backend does not recognize those events as "something to symbolicate", hence bypassing the symbolication pipeline altogether. Could you share a link via DM to your project (if it's not selfhosted)? Otherwise would ask you to share the event json maybe