Closed GuidoNeele closed 2 years ago
So we are crashing due to an uncaught exception:
0 libsystem_kernel.dylib 0x00000001cb2b27b0 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001e79809c0 pthread_kill + 208
2 libsystem_c.dylib 0x00000001a8083a38 abort + 116
3 MyApp.iOS 0x0000000104e98a74 xamarin_unhandled_exception_handler (runtime.m:1100)
4 MyApp.iOS 0x0000000104d5f500 mono_invoke_unhandled_exception_hook (exception.c:1265)
5 MyApp.iOS 0x0000000104cf46c8 mono_handle_exception_internal (mini-exceptions.c:2791)
6 MyApp.iOS 0x0000000104cf309c mono_handle_exception (mini-exceptions.c:3116)
7 MyApp.iOS 0x0000000104ce8e18 mono_arm_throw_exception (exceptions-arm64.c:401)
8 MyApp.iOS 0x00000001013ab86c throw_exception + 168
9 MyApp.iOS 0x00000001010caa2c System_Runtime_ExceptionServices_ExceptionDispatchInfo_Throw + 40
10 MyApp.iOS 0x00000001010d2254 System_Runtime_CompilerServices_AsyncMethodBuilderCore__c__ThrowAsyncb__7_0_object + 80
I question if your code is correct in reporting the exception and then swallowing. That means if you have corrupted state, your application will not crash. Reporting the error and then rethrowing is a more common pattern.
If you rethrow, it might crash closer to the source of the crash and provide more info.
Another option is to try to get the associated logs. Do you see nothing?
Without a sample, or more logs, there is little we can do to assist here.
You're right I will alter the code and rethrow the exception, this might give us a better clue of what's going on. Will report back if I know more.
We will be closing this issue as it has been over 30 days since we have heard any updates. If you are still experiencing this issue, please provide a sample and full build logs and then click the Reopen Issue button. Thank you!
Steps to Reproduce
Expected Behavior
App shouldn't crash
Actual Behavior
App crashes during background fetch
Crash report
Anybody know what's going on with this Xamarin Forms iOS app crash? App crashes during or while starting background fetch. Don't see any recognizable methods of our app that can lead me in the right direction. The app crashes on several devices (iPhones and iPads). Can't reproduce the error since the app doesn't crash while the debugger is attached. Tried running the app while sending the simulate background fetch request and also started the app with the background fetch profile directly, in both cases the app does what it needs to do without crashing.
The background fetch is handled by Shiny (https://github.com/shinyorg/shiny). 9 jobs are started in sequence they all inherit from a BaseSyncJob that looks like this.
We are using AppCenter but the crash doesn't get logged. AppCenter.Start() is one of the first things that gets called after starting the app.