Bug 28090 - [WatchKit] App crashes on startup occasionally in simulator
Summary: [WatchKit] App crashes on startup occasionally in simulator
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 8.8.0
Hardware: Macintosh Mac OS
: High major
Target Milestone: Untriaged
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2015-03-16 21:37 UTC by Mike Bluestein
Modified: 2015-06-04 13:28 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
console log (81.36 KB, application/octet-stream)
2015-03-18 15:07 UTC, Mike Bluestein
Details
system log (1.65 MB, application/octet-stream)
2015-03-19 16:06 UTC, Mike Bluestein
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Mike Bluestein 2015-03-16 21:37:24 UTC
This happens ~10% of the time for me. The code in my controller is never reached and then it crashes. It usually happens on first launch of the app after I open XS, but not always. Sorry if this is vague. If there's any better info I can provide to help make this a better bug report let me know. Here's the crash:

Press enter to terminate the application
>Loaded assembly: /Users/mike_bluestein/Library/Developer/CoreSimulator/Devices/B73EAED1-601A-4602-9958-4E9434F0FEFC/data/Containers/Bundle/Application/CB46A137-BD70-47A7-95CA-D737B7E66A19/MegaAwesomeApp.app/PlugIns/com.mikebluestein.MegaAwesomeApp.watchkitextension.appex/Xamarin.iOS.dll [External]
Loaded assembly: /Users/mike_bluestein/Library/Developer/CoreSimulator/Devices/B73EAED1-601A-4602-9958-4E9434F0FEFC/data/Containers/Bundle/Application/CB46A137-BD70-47A7-95CA-D737B7E66A19/MegaAwesomeApp.app/PlugIns/com.mikebluestein.MegaAwesomeApp.watchkitextension.appex/System.dll [External]
2015-03-16 18:13:01.957 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: Stacktrace:

2015-03-16 18:13:01.963 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical:   at <unknown> <0xffffffff>
2015-03-16 18:13:01.963 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical:   at (wrapper managed-to-native) System.Type.GetInterfaceMapData (System.Type,System.Type,System.Reflection.MethodInfo[]&,System.Reflection.MethodInfo[]&) <IL 0x00024, 0xffffffff>
2015-03-16 18:13:01.964 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical:   at System.Type.GetInterfaceMap (System.Type) [0x0008e] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Type.cs:928
2015-03-16 18:13:01.966 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical:   at Registrar.SharedDynamic.PrepareInterfaceMethodMapping (System.Type) [0x00036] in /Developer/MonoTouch/Source/maccore/src/ObjCRuntime/DynamicRegistrar.cs:34
2015-03-16 18:13:01.966 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical:   at Registrar.DynamicRegistrar.PrepareMethodMapping (System.Type) [0x00000] in /Developer/MonoTouch/Source/maccore/src/ObjCRuntime/DynamicRegistrar.cs:271
2015-03-16 18:13:01.967 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical:   at Registrar.Registrar.RegisterTypeUnsafe (System.Type,System.Collections.Generic.List`1<System.Exception>&) [0x00804] in /Developer/MonoTouch/Source/maccore/src/ObjCRuntime/Registrar.cs:1207
2015-03-16 18:13:01.967 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical:   at Registrar.Registrar.RegisterAssembly (System.Reflection.Assembly) [0x0008a] in /Developer/MonoTouch/Source/maccore/src/ObjCRuntime/Registrar.cs:1343
2015-03-16 18:13:01.967 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical:   at ObjCRuntime.Runtime.RegisterAssembly (System.Reflection.Assembly) [0x00052] in /Developer/MonoTouch/Source/maccore/src/ObjCRuntime/Runtime.iOS.cs:79
2015-03-16 18:13:01.967 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical:   at ObjCRuntime.Runtime.RegisterAssembly (intptr) [0x00000] in /Developer/MonoTouch/Source/maccore/src/ObjCRuntime/Runtime.cs:147
2015-03-16 18:13:01.968 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical:   at ObjCRuntime.Runtime.register_assembly (intptr) [0x00000] in /Developer/MonoTouch/Source/maccore/runtime/Delegates.generated.cs:94
2015-03-16 18:13:01.968 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical:   at (wrapper native-to-managed) ObjCRuntime.Runtime.register_assembly (intptr) <IL 0x00021, 0xffffffff>
2015-03-16 18:13:01.968 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 
Native stacktrace:

2015-03-16 18:13:01.981 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	0   com.mikebluestein.MegaAwesomeApp.watchkitextension 0x00192c67 mono_handle_native_sigsegv + 311
2015-03-16 18:13:01.981 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	1   com.mikebluestein.MegaAwesomeApp.watchkitextension 0x0019eb3a sigabrt_signal_handler + 122
2015-03-16 18:13:01.982 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	2   libsystem_platform.dylib            0x08cc203b _sigtramp + 43
2015-03-16 18:13:01.982 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	3   ???                                 0xffffffff 0x0 + 4294967295
2015-03-16 18:13:01.982 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	4   com.mikebluestein.MegaAwesomeApp.watchkitextension 0x00212d81 ves_icall_Type_GetInterfaceMapData + 401
2015-03-16 18:13:01.982 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	5   ???                                 0x15cc5dac 0x0 + 365714860
2015-03-16 18:13:01.983 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	6   ???                                 0x15cc5b80 0x0 + 365714304
2015-03-16 18:13:01.983 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	7   ???                                 0x15cc482a 0x0 + 365709354
2015-03-16 18:13:01.983 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	8   ???                                 0x15cc46a0 0x0 + 365708960
2015-03-16 18:13:01.983 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	9   ???                                 0x144f813f 0x0 + 340754751
2015-03-16 18:13:01.983 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	10  ???                                 0x144f35b8 0x0 + 340735416
2015-03-16 18:13:01.984 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	11  ???                                 0x144f2ad1 0x0 + 340732625
2015-03-16 18:13:01.984 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	12  ???                                 0x144f28f0 0x0 + 340732144
2015-03-16 18:13:01.984 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	13  ???                                 0x144f2860 0x0 + 340732000
2015-03-16 18:13:01.984 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	14  ???                                 0x144f0ec4 0x0 + 340725444
2015-03-16 18:13:01.984 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	15  com.mikebluestein.MegaAwesomeApp.watchkitextension 0x00326bd0 xamarin_register_assembly + 32
2015-03-16 18:13:01.985 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	16  com.mikebluestein.MegaAwesomeApp.watchkitextension 0x00328200 register_assembly + 64
2015-03-16 18:13:01.985 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	17  com.mikebluestein.MegaAwesomeApp.watchkitextension 0x00328876 xamarin_initialize + 998
2015-03-16 18:13:01.985 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	18  com.mikebluestein.MegaAwesomeApp.watchkitextension 0x0032475a xamarin_main + 2090
2015-03-16 18:13:01.985 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	19  com.mikebluestein.MegaAwesomeApp.watchkitextension 0x000cd647 main + 135
2015-03-16 18:13:01.985 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 	20  libdyld.dylib                       0x0899fac9 start + 1
2015-03-16 18:13:01.985 com.mikebluestein.MegaAwesomeApp.watchkitextension[1042:31398] critical: 
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================
Comment 1 Rolf Bjarne Kvinge [MSFT] 2015-03-17 07:02:50 UTC
You should get crash reports in the system's Console app as well, can you attach those?
Comment 2 Mike Bluestein 2015-03-18 15:07:41 UTC
Created attachment 10401 [details]
console log

Here's the console log
Comment 3 Rolf Bjarne Kvinge [MSFT] 2015-03-18 15:15:44 UTC
This is a very strange crash, I've never seen this before:

4   com.mikebluestein.MegaAwesomeApp.watchkitextension	0x0019eb3a sigabrt_signal_handler + 122
5   libsystem_platform.dylib      	0x08cc203b _sigtramp + 43
6   ???                           	0xffffffff 0 + 4294967295
7   com.mikebluestein.MegaAwesomeApp.watchkitextension	0x0019eac0 sigusr1_signal_handler + 256
8   com.mikebluestein.MegaAwesomeApp.watchkitextension	0x00212d81 ves_icall_Type_GetInterfaceMapData + 401

Can you get the output from the iOS Simulator's log as well (in the simulator, open Debug -> Open System Log)? That should verify if we're hitting some sort of timeout.
Comment 4 Mike Bluestein 2015-03-19 16:06:45 UTC
Created attachment 10422 [details]
system log

See the bottom of the log. I just got this crash few minutes ago.
Comment 5 Mike Bluestein 2015-03-19 16:28:23 UTC
And here's the Application Output pad from XS again, in case there's some additional info in there:

Press enter to terminate the application
>Loaded assembly: /Users/mike_bluestein/Library/Developer/CoreSimulator/Devices/2EEF42BF-5EFC-4E1B-9666-60DC167A0234/data/Containers/Bundle/Application/DBE6CEB5-1EA7-4E76-8977-76C7E3109791/MegaAwesomeApp.app/PlugIns/com.mikebluestein.MegaAwesomeApp.watchkitextension.appex/Xamarin.iOS.dll [External]
Loaded assembly: /Users/mike_bluestein/Library/Developer/CoreSimulator/Devices/2EEF42BF-5EFC-4E1B-9666-60DC167A0234/data/Containers/Bundle/Application/DBE6CEB5-1EA7-4E76-8977-76C7E3109791/MegaAwesomeApp.app/PlugIns/com.mikebluestein.MegaAwesomeApp.watchkitextension.appex/System.dll [External]
2015-03-19 15:59:47.914 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: Stacktrace:

2015-03-19 15:59:47.919 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical:   at <unknown> <0xffffffff>
2015-03-19 15:59:47.919 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical:   at (wrapper managed-to-native) System.Type.GetInterfaceMapData (System.Type,System.Type,System.Reflection.MethodInfo[]&,System.Reflection.MethodInfo[]&) <IL 0x00024, 0xffffffff>
2015-03-19 15:59:47.920 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical:   at System.Type.GetInterfaceMap (System.Type) [0x0008e] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Type.cs:928
2015-03-19 15:59:47.921 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical:   at Registrar.SharedDynamic.PrepareInterfaceMethodMapping (System.Type) [0x00036] in /Developer/MonoTouch/Source/maccore/src/ObjCRuntime/DynamicRegistrar.cs:34
2015-03-19 15:59:47.922 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical:   at Registrar.DynamicRegistrar.PrepareMethodMapping (System.Type) [0x00000] in /Developer/MonoTouch/Source/maccore/src/ObjCRuntime/DynamicRegistrar.cs:271
2015-03-19 15:59:47.922 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical:   at Registrar.Registrar.RegisterTypeUnsafe (System.Type,System.Collections.Generic.List`1<System.Exception>&) [0x00804] in /Developer/MonoTouch/Source/maccore/src/ObjCRuntime/Registrar.cs:1207
2015-03-19 15:59:47.922 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical:   at Registrar.Registrar.RegisterAssembly (System.Reflection.Assembly) [0x0008a] in /Developer/MonoTouch/Source/maccore/src/ObjCRuntime/Registrar.cs:1343
2015-03-19 15:59:47.923 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical:   at ObjCRuntime.Runtime.RegisterAssembly (System.Reflection.Assembly) [0x00052] in /Developer/MonoTouch/Source/maccore/src/ObjCRuntime/Runtime.iOS.cs:79
2015-03-19 15:59:47.923 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical:   at ObjCRuntime.Runtime.RegisterAssembly (intptr) [0x00000] in /Developer/MonoTouch/Source/maccore/src/ObjCRuntime/Runtime.cs:147
2015-03-19 15:59:47.923 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical:   at ObjCRuntime.Runtime.register_assembly (intptr) [0x00000] in /Developer/MonoTouch/Source/maccore/runtime/Delegates.generated.cs:94
2015-03-19 15:59:47.923 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical:   at (wrapper native-to-managed) ObjCRuntime.Runtime.register_assembly (intptr) <IL 0x00021, 0xffffffff>
2015-03-19 15:59:47.924 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 
Native stacktrace:

2015-03-19 15:59:47.939 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	0   com.mikebluestein.MegaAwesomeApp.watchkitextension 0x000f8c67 mono_handle_native_sigsegv + 311
2015-03-19 15:59:47.939 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	1   com.mikebluestein.MegaAwesomeApp.watchkitextension 0x00104b3a sigabrt_signal_handler + 122
2015-03-19 15:59:47.940 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	2   libsystem_platform.dylib            0x08c2803b _sigtramp + 43
2015-03-19 15:59:47.940 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	3   ???                                 0xffffffff 0x0 + 4294967295
2015-03-19 15:59:47.940 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	4   com.mikebluestein.MegaAwesomeApp.watchkitextension 0x001c3972 mono_g_hash_table_insert_replace + 98
2015-03-19 15:59:47.940 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	5   com.mikebluestein.MegaAwesomeApp.watchkitextension 0x001c38ff mono_g_hash_table_insert + 31
2015-03-19 15:59:47.940 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	6   com.mikebluestein.MegaAwesomeApp.watchkitextension 0x001e09e8 mono_method_get_object + 1048
2015-03-19 15:59:47.941 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	7   com.mikebluestein.MegaAwesomeApp.watchkitextension 0x00178d81 ves_icall_Type_GetInterfaceMapData + 401
2015-03-19 15:59:47.941 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	8   ???                                 0x15b90dac 0x0 + 364449196
2015-03-19 15:59:47.941 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	9   ???                                 0x15b90b80 0x0 + 364448640
2015-03-19 15:59:47.941 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	10  ???                                 0x15b8f82a 0x0 + 364443690
2015-03-19 15:59:47.942 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	11  ???                                 0x15b8f6a0 0x0 + 364443296
2015-03-19 15:59:47.942 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	12  ???                                 0x1445e13f 0x0 + 340123967
2015-03-19 15:59:47.942 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	13  ???                                 0x144595b8 0x0 + 340104632
2015-03-19 15:59:47.942 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	14  ???                                 0x14458ad1 0x0 + 340101841
2015-03-19 15:59:47.942 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	15  ???                                 0x144588f0 0x0 + 340101360
2015-03-19 15:59:47.943 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	16  ???                                 0x14458860 0x0 + 340101216
2015-03-19 15:59:47.943 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	17  ???                                 0x14456ec4 0x0 + 340094660
2015-03-19 15:59:47.943 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	18  com.mikebluestein.MegaAwesomeApp.watchkitextension 0x0028cbd0 xamarin_register_assembly + 32
2015-03-19 15:59:47.943 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	19  com.mikebluestein.MegaAwesomeApp.watchkitextension 0x0028e200 register_assembly + 64
2015-03-19 15:59:47.944 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	20  com.mikebluestein.MegaAwesomeApp.watchkitextension 0x0028e876 xamarin_initialize + 998
2015-03-19 15:59:47.944 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	21  com.mikebluestein.MegaAwesomeApp.watchkitextension 0x0028a75a xamarin_main + 2090
2015-03-19 15:59:47.944 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	22  com.mikebluestein.MegaAwesomeApp.watchkitextension 0x00033647 main + 135
2015-03-19 15:59:47.945 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 	23  libdyld.dylib                       0x08905ac9 start + 1
2015-03-19 15:59:47.945 com.mikebluestein.MegaAwesomeApp.watchkitextension[5931:876119] critical: 
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================
Comment 6 Rolf Bjarne Kvinge [MSFT] 2015-03-20 05:11:25 UTC
We're hitting a 5s timeout:

Mar 19 15:59:42 DTMobileIS[5900]: invoked for service: com.mikebluestein.MegaAwesomeApp.watchkitextension pid: 5931
Mar 19 15:59:47 launchd_sim[5861] (com.mikebluestein.MegaAwesomeApp.watchkitextension[5931]): Extension is hanging on launch. Killing.

Temporary workaround might be to enable the managed linker or the static registrar (--registrar:static in the additional mtouch arguments) for the extension (this should make the startup faster).

@Mike, can you confirm if enabling the static registrar works?
Comment 7 Oleg Demchenko 2015-04-20 18:13:58 UTC
I can confirm that --registrar:static works. I was experiencing the same problem with cycle5 builds and this compiler option fixed the problem.
Comment 8 Rolf Bjarne Kvinge [MSFT] 2015-04-21 13:09:06 UTC
Fixed (we're emulating a native debugger so that the iOS simulator doesn't kill us if startup takes a little longer than the timeout).

maccore/master: 4fa2cc9fbe22ba2fe3c116e9bdf3a90edf6af00e
Comment 9 Rolf Bjarne Kvinge [MSFT] 2015-05-04 10:31:13 UTC
The fix had to be reverted, it broke our managed debugger.
Comment 10 Rolf Bjarne Kvinge [MSFT] 2015-06-04 13:28:11 UTC
Another fix has been implemented (app launch is now significantly faster).

maccore/master: 6a53f5cc7802f0c15a8a85b0227046219aa2e247

However this fix will not work 100% of the time, because the 5s launch timeout is still in effect, and sometimes the app may just take a long time to launch (cold disk cache, etc), causing the app to still hit the watchdog.