xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.49k stars 515 forks source link

Randomly crashes Xamarin IOS app. Crashlytics report starts with xamarin_initialize.cold.1 #9626

Closed arshad9958 closed 4 years ago

arshad9958 commented 4 years ago

I am facing this weird issue on my Xamarin IOS production app from last two weeks. The app crashes randomly.I have symbolicated the crash reports they all have crashlytic xamarin_initialize.cold.1 . I am not using any third party library that may be the cause of this issue.

Crashlytics:

Thread 0 name: Thread 0 Crashed: 0 libsystem_kernel.dylib 0x000000018cdcad88 pthread_kill + 8 1 libsystem_pthread.dylib 0x000000018cce774c pthread_kill$VARIANT$armv81 + 216 (pthread.c:1458) 2 libsystem_c.dylib 0x000000018cc369b0 abort + 112 (abort.c:147) 3 libsystem_c.dylib 0x000000018cc36940 abort + 112 (abort.c:118) 4 PamsiOSApp 0x0000000103349184 xamarin_initialize.cold.1 + 0 5 PamsiOSApp 0x0000000103340c64 xamarin_printf + 17828964 (runtime.m:2472) 6 PamsiOSApp 0x000000010325a3d4 mono_invoke_unhandled_exception_hook + 16884692 (exception.c:1299) 7 PamsiOSApp 0x00000001031fbc94 mono_handle_exception_internal + 16497812 (mini-exceptions.c:2783) 8 PamsiOSApp 0x00000001031fa67c mono_handle_exception + 16492156 (mini-exceptions.c:3107) 9 PamsiOSApp 0x00000001031f19a0 mono_arm_throw_exception + 16456096 (exceptions-arm64.c:401) 10 PamsiOSApp 0x00000001026461ac throw_exception + 172 11 PamsiOSApp 0x000000010241118c System_Runtime_ExceptionServices_ExceptionDispatchInfo_Throw + 44 12 PamsiOSApp 0x0000000102417034 System_Runtime_CompilerServices_AsyncMethodBuilderCorecThrowAsyncb7_0_object + 84 13 PamsiOSApp 0x00000001026d2dcc Foundation_NSAsyncSynchronizationContextDispatcher_Apply + 4795852 (NSAction.cs:178) 14 PamsiOSApp 0x0000000102608f90 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 272 15 PamsiOSApp 0x000000010320bfdc mono_jit_runtime_invoke + 16564188 (mini-runtime.c:3165) 16 PamsiOSApp 0x00000001032a3214 mono_runtime_invoke_checked + 17183252 (object.c:3220) 17 PamsiOSApp 0x00000001032a667c mono_runtime_invoke + 17196668 (object.c:3107) 18 PamsiOSApp 0x0000000102244204 native_to_managed_trampoline_1(objc_object, objc_selector, _MonoMethod**, unsigned int) + 16900 (registrar.m:29) 19 PamsiOSApp 0x00000001022528f0 -[__MonoMac_NSAsyncSynchronizationContextDispatcher xamarinApplySelector] + 76016 (registrar.m:6881) 20 Foundation 0x000000018d3cdf78 NSThreadPerformPerform + 184 (NSThread.m:807) 21 CoreFoundation 0x000000018cf53ad8 _CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORMFUNCTION + 24 (CFRunLoop.c:1922) 22 CoreFoundation 0x000000018cf53a30 CFRunLoopDoSource0 + 80 (CFRunLoop.c:1956) 23 CoreFoundation 0x000000018cf53214 CFRunLoopDoSources0 + 276 (CFRunLoop.c:2000) 24 CoreFoundation 0x000000018cf4e1e8 CFRunLoopRun + 788 (CFRunLoop.c:2882) 25 CoreFoundation 0x000000018cf4dba8 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3192) 26 GraphicsServices 0x00000001970bd344 GSEventRunModal + 160 (GSEvent.c:2246) 27 UIKitCore 0x00000001910893e4 UIApplicationMain + 1932 (UIApplication.m:4823) 28 PamsiOSApp 0x000000010270b338 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 344 29 PamsiOSApp 0x00000001026b9bf0 UIKit_UIApplication_Mainstringintptr_intptr + 4692976 (UIApplication.cs:86) 30 PamsiOSApp 0x00000001026b9b74 UIKit_UIApplication_Main_string_string_string + 4692852 (UIApplication.cs:66) 31 PamsiOSApp 0x000000010225eff4 PamsiOSApp_Application_Main_string + 126964 (/:1) 32 PamsiOSApp 0x0000000102608f90 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 272 33 PamsiOSApp 0x000000010320bfdc mono_jit_runtime_invoke + 16564188 (mini-runtime.c:3165) 34 PamsiOSApp 0x00000001032a3214 mono_runtime_invoke_checked + 17183252 (object.c:3220) 35 PamsiOSApp 0x00000001032a84b8 mono_runtime_exec_main_checked + 17204408 (object.c:5284) 36 PamsiOSApp 0x00000001031f1508 mono_jit_exec + 16454920 (driver.c:1328) 37 PamsiOSApp 0x00000001033477a8 xamarin_main + 17856424 (monotouch-main.m:0) 38 PamsiOSApp 0x000000010225c0c8 main + 114888 (main.m:86) 39 libdyld.dylib 0x000000018cdd58f0 start + 4

Steps to Reproduce

  1. Unable to reproduce because it happens randomly.It does not happen on invoking certain method or interacting with some UI element.

Expected Behavior

App does not crash

Actual Behavior

App Crashes

Environment

System OS : Mac Os Catalina 10.15.3 Visual Studio : Visual Studio for mac community 8.7.1 (build 15) Xamarin IOS : Version: 13.20.2.2 (Visual Studio Community) , Hash: 817b6f72a , Branch: d16-7 Xcode : 11.4

Build Logs

Example Project (If Possible)

rolfbjarne commented 4 years ago

This is an unhandled managed exception in your code:

6 PamsiOSApp 0x000000010325a3d4 mono_invoke_unhandled_exception_hook + 16884692 (exception.c:1299)

According to the stack trace this happened in some async code:

11 PamsiOSApp 0x000000010241118c System_Runtime_ExceptionServices_ExceptionDispatchInfo_Throw + 44 12 PamsiOSApp 0x0000000102417034 System_Runtime_CompilerServices_AsyncMethodBuilderCorecThrowAsyncb__7_0_object + 84

but it's not possible to deduce anything else from the crash report, you have to collect more information somehow, in particular information about the exception that was thrown (which will most likely tell you what's happening).

I'm closing this now, since from the information available this does not look like a bug in Xamarin.iOS. Feel free to reopen this issue if you think otherwise once you have any information about the exception that was thrown.