Conrad Kramer
05/23/2022, 8:45 PMKotlin_ObjCExport_trapOnUndeclaredException
and the “Application Specific Information” which normally contains the exception message (for Swift traps and Objective-C exceptions) just shows abort() called
Is there a way to put the Kotlin exception message inside of the crash report?ankushg
05/23/2022, 8:53 PMRick Clephas
05/23/2022, 8:54 PMConrad Kramer
05/23/2022, 8:55 PMsetUnhandledExceptionHook
(which is what they use), so perhaps I could take the exception and crash myself in a way that reports the exception message correctly
I do wonder how “Application Specific Information” is populated, though, and if there is a way to get this functionality into Kotlin itselfConrad Kramer
05/23/2022, 8:59 PMRick Clephas
05/23/2022, 9:00 PMNSError
and then send it to ObjC/Swift. From there you could basically throw it or something to get the "normal behavior".
Not sure if that would actually work but might be worth to try.Conrad Kramer
05/23/2022, 9:01 PMConrad Kramer
05/23/2022, 9:01 PMConrad Kramer
05/23/2022, 9:03 PM__crash_info
)Conrad Kramer
05/23/2022, 9:04 PMConrad Kramer
05/23/2022, 9:04 PMankushg
05/23/2022, 9:21 PMRick Clephas
05/23/2022, 9:22 PMkpgalligan
05/23/2022, 9:26 PMConrad Kramer
05/25/2022, 7:42 AMConrad Kramer
05/25/2022, 7:43 AMkpgalligan
05/25/2022, 12:00 PMkpgalligan
05/25/2022, 12:00 PMkpgalligan
05/25/2022, 12:06 PM__crash_info
structure (https://github.com/firebase/firebase-ios-sdk/blob/35669875acdb8d27503feead0d8a2b3d3a0fe19c/Crashlytics/Crashlytics/Components/FIRCLSProcess.c#L752), but it seems to only care about the message
field (https://github.com/firebase/firebase-ios-sdk/blob/35669875acdb8d27503feead0d8a2b3d3a0fe19c/Crashlytics/Crashlytics/Components/FIRCLSProcess.c#L804). I was getting excited that maybe the backtrace
field (https://github.com/firebase/firebase-ios-sdk/blob/35669875acdb8d27503feead0d8a2b3d3a0fe19c/Crashlytics/Crashlytics/Components/FIRCLSProcess.c#L756) would be the magic key, but as far as I can see, at least Crashlytics doesn’t care about it.kpgalligan
05/25/2022, 12:08 PMkpgalligan
05/25/2022, 12:09 PMkpgalligan
05/25/2022, 12:13 PMkpgalligan
05/25/2022, 12:13 PMkpgalligan
05/25/2022, 12:20 PM__crash_info
, I think the piece, or one of the pieces, that I’m missing is what actually gets put in there, and who is intended to read it? I did go through the wireshark and firefox code, but only lightly. I’m definitely not set up for local native dev like that, so I’ve just been reading source. I think writing to it would be easy enough if I understand what’s happening, although I wouldn’t know what to write. Also, I have that background concern of if this is actually a private api, does that mess with app store submissions? That last one is a bit down the road as far as worries go, but still.kpgalligan
05/25/2022, 12:21 PMRick Clephas
05/25/2022, 2:42 PMAlso, I have that background concern of if this is actually a private api, does that mess with app store submissions?As long as Swift is using the same that shouldn’t be an issue, right? Also if Crashlytics is aware of it then it’s already part of your app.
kpgalligan
05/25/2022, 3:23 PM__crash_info
is a problem, but I’m not sure that it’s considered private either. Poorly documented for sure, but not sure it’s something Apple cares about. but, again, I’m also not sure it’ll do much for the crash reports, at least for stack traces.Rick Clephas
05/25/2022, 3:52 PMBugsnag at least lets you inspect and modify crash reports before they’re sent to the server … and I’m not sure Crashlytics or others allow the same.Yes if automatic collection is disabled you can update the report before it’s send: https://firebase.google.com/docs/reference/swift/firebasecrashlytics/api/reference/Classes/Crashlytics#checkandupdateunsentreports Though there is no field for a stacktrace, but you could add it as logs or as a custom value or something.
Conrad Kramer
05/25/2022, 4:09 PMkpgalligan
05/25/2022, 5:12 PMwhen I was reading reports at AppleApologies in advance for the endless list of questions I might throw at you in the future
As for reporting, I am always just going to use Apple’s crash reporting functionalityWe’re primarily focused on 3rd party tools, but that’s mostly because that’s what our clients are using. Certainly interested to see what you figure out.
The backtrace functionality does work – NSException actually uses it. I remember reading a lot of “Application Specific Backtrace” sectionsI’d definitely love to see how this works. The apple-side internals are a bit out of my wheelhouse, and I’m not sure the 3rd party tools wouldn’t report this, but would need to try it and see how it goes.
I’ll likely write a diff for the Kotlin runtime to use crash_info (as that is where it belongs, in the runtime), but compiling Kotlin sounds like a PITAI wouldn’t say compiling Kotlin is the easiest, but it’s not too bad once you get it set up. We’re hacking around compiler changes now. If you have thoughts on what that should look like we might be able to try some things our, or just assist getting local dev working for you if needed.
Conrad Kramer
05/26/2022, 6:16 PM__crash___info
section, but the crash info section seemingly only gets checked for system libraries. I updated the code to find an existing section in a system library and write to thatkpgalligan
05/26/2022, 6:19 PMConrad Kramer
05/26/2022, 6:22 PMConrad Kramer
05/26/2022, 6:26 PMkpgalligan
05/26/2022, 6:29 PMkpgalligan
05/26/2022, 6:30 PMkpgalligan
05/26/2022, 6:31 PMkpgalligan
05/26/2022, 6:32 PM