LucaFongaro LucaFongaro - 18 days ago 5
iOS Question

SIGABRTCrash in xamarin_initialize iOS

I'm developing an app in Xamarin iOS and Android.
In a few case the iOS version (not android) report trough bug report system this problem:


Thread 0SIGABRTCrash in xamarin_initialize

0 libsystem_kernel.dylib pthread_kill (in libsystem_kernel.dylib) +
8 1 libsystem_c.dylib abort (in libsystem_c.dylib) + 140 2 TouristApp
xamarin_initialize (in 1a944b2b614036bbba6b93191b43cf7a)
(runtime.m:938) 3 TouristApp mono_invoke_unhandled_exception_hook (in
1a944b2b614036bbba6b93191b43cf7a) (mini-exceptions.c:2786) 4
TouristApp mono_handle_exception_internal (in
1a944b2b614036bbba6b93191b43cf7a) (mini-exceptions.c:1727) 5
TouristApp mono_handle_exception (in 1a944b2b614036bbba6b93191b43cf7a)
+ 40 6 TouristApp handle_signal_exception (in 1a944b2b614036bbba6b93191b43cf7a) (exceptions-arm64.c:525) 7
TouristApp
TouristApp_TouristApp_DettaglioPunti_UpdateDescriptionAudio_bool (in
1a944b2b614036bbba6b93191b43cf7a) + 76 8 TouristApp
TouristApp_TouristApp_DettaglioPunti__UpdateDescriptionAudioc__AnonStorey3__UpdateDescriptionAudioc__AnonStorey4__m__0
(in 1a944b2b614036bbba6b93191b43cf7a) + 452 9 TouristApp Apply (in
1a944b2b614036bbba6b93191b43cf7a) (NSAction.cs:57) 10 TouristApp
wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr
(in 1a944b2b614036bbba6b93191b43cf7a) + 244 11 TouristApp
mono_jit_runtime_invoke (in 1a944b2b614036bbba6b93191b43cf7a)
(mini-runtime.c:2564) 12 TouristApp mono_runtime_invoke (in
1a944b2b614036bbba6b93191b43cf7a) (object.c:2897) 13 TouristApp
native_to_managed_trampoline_1() (in 1a944b2b614036bbba6b93191b43cf7a)
+ 208 14 TouristApp -[__MonoMac_NSActionDispatcher xamarinApplySelector] (in 1a944b2b614036bbba6b93191b43cf7a) + 60 15
Foundation __NSThreadPerformPerform (in Foundation) + 340 16
CoreFoundation
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION
(in CoreFoundation) + 24 17 CoreFoundation CFRunLoopDoSources0 (in
CoreFoundation) + 540 18 CoreFoundation __CFRunLoopRun (in
CoreFoundation) + 724 19 CoreFoundation CFRunLoopRunSpecific (in
CoreFoundation) + 384 20 GraphicsServices GSEventRunModal (in
GraphicsServices) + 180 21 UIKit UIApplicationMain (in UIKit) + 204 22
TouristApp
(wrapper_managed-to-native)_UIKit.UIApplication:UIApplicationMain (in
1a944b2b614036bbba6b93191b43cf7a) + 324 23 TouristApp Main (in
1a944b2b614036bbba6b93191b43cf7a) (UIApplication.cs:63) 24 TouristApp
TouristApp_TouristApp_Application_Main_string
(in
1a944b2b614036bbba6b93191b43cf7a) + 56 25 TouristApp
wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr
(in 1a944b2b614036bbba6b93191b43cf7a) + 244 26 TouristApp
mono_jit_runtime_invoke (in 1a944b2b614036bbba6b93191b43cf7a)
(mini-runtime.c:2564) 27 TouristApp mono_runtime_invoke (in
1a944b2b614036bbba6b93191b43cf7a) (object.c:2897) 28 TouristApp
mono_runtime_exec_main (in 1a944b2b614036bbba6b93191b43cf7a)
(object.c:4221) 29 TouristApp xamarin_main (in
1a944b2b614036bbba6b93191b43cf7a) (monotouch-main.m:454) 30 TouristApp
main (in 1a944b2b614036bbba6b93191b43cf7a) + 96 31 libdyld.dylib start
(in libdyld.dylib) + 4

Thread 1

0 libsystem_kernel.dylib kevent_qos (in libsystem_kernel.dylib) + 8 1
libdispatch.dylib _dispatch_source_invoke (in libdispatch.dylib) + 0

Thread 2

0 libsystem_kernel.dylib __psynch_cvwait (in libsystem_kernel.dylib) +
8 1 TouristApp thread_func (in 1a944b2b614036bbba6b93191b43cf7a)
(mono-os-mutex.h:106) 2 libsystem_pthread.dylib _pthread_body (in
libsystem_pthread.dylib) + 156 3 libsystem_pthread.dylib _pthread_body
(in libsystem_pthread.dylib) + 0 4 libsystem_pthread.dylib
thread_start (in libsystem_pthread.dylib) + 4

Thread 3

0 libsystem_kernel.dylib semaphore_wait_trap (in
libsystem_kernel.dylib) + 8 1 TouristApp start_wrapper (in
1a944b2b614036bbba6b93191b43cf7a) (threads.c:717) 2 TouristApp
inner_start_thread (in 1a944b2b614036bbba6b93191b43cf7a)
(mono-threads-posix.c:92) 3 libsystem_pthread.dylib _pthread_body (in
libsystem_pthread.dylib) + 156 4 libsystem_pthread.dylib _pthread_body
(in libsystem_pthread.dylib) + 0 5 libsystem_pthread.dylib
thread_start (in libsystem_pthread.dylib) + 4

Thread 4

0 libsystem_kernel.dylib __psynch_cvwait (in libsystem_kernel.dylib) +
8 1 TouristApp _wapi_handle_timedwait_signal_handle (in
1a944b2b614036bbba6b93191b43cf7a) (mono-os-mutex.h:134) 2 TouristApp
wapi_WaitForSingleObjectEx (in 1a944b2b614036bbba6b93191b43cf7a)
(wait.c:187) 3 TouristApp mono_wait_uninterrupted (in
1a944b2b614036bbba6b93191b43cf7a) (threads.c:1518) 4 TouristApp
ves_icall_System_Threading_WaitHandle_WaitOne_internal (in
1a944b2b614036bbba6b93191b43cf7a) (threads.c:1652) 5 TouristApp
wrapper_managed_to_native_System_Threading_WaitHandle_WaitOne_internal_System_Threading_WaitHandle_intptr_int_bool
(in 1a944b2b614036bbba6b93191b43cf7a) + 128 6 TouristApp WaitOne (in
1a944b2b614036bbba6b93191b43cf7a) (WaitHandle.cs:375) 7 TouristApp
WaitOne (in 1a944b2b614036bbba6b93191b43cf7a) (WaitHandle.cs:388) 8
TouristApp SchedulerThread (in 1a944b2b614036bbba6b93191b43cf7a)
(Timer.cs:395) 9 TouristApp ThreadStart_Context (in
1a944b2b614036bbba6b93191b43cf7a) (thread.cs:72) 10 TouristApp
RunInternal (in 1a944b2b614036bbba6b93191b43cf7a)
(executioncontext.cs:957) 11 TouristApp Run (in
1a944b2b614036bbba6b93191b43cf7a) (executioncontext.cs:893) 12
TouristApp ThreadStart (in 1a944b2b614036bbba6b93191b43cf7a)
(thread.cs:109) 13 TouristApp
wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr
(in 1a944b2b614036bbba6b93191b43cf7a) + 244 14 TouristApp
mono_jit_runtime_invoke (in 1a944b2b614036bbba6b93191b43cf7a)
(mini-runtime.c:2564) 15 TouristApp mono_runtime_invoke (in
1a944b2b614036bbba6b93191b43cf7a) (object.c:2897) 16 TouristApp
start_wrapper (in 1a944b2b614036bbba6b93191b43cf7a) (threads.c:740) 17
TouristApp inner_start_thread (in 1a944b2b614036bbba6b93191b43cf7a)
(mono-threads-posix.c:92) 18 libsystem_pthread.dylib _pthread_body (in
libsystem_pthread.dylib) + 156 19 libsystem_pthread.dylib
_pthread_body (in libsystem_pthread.dylib) + 0 20 libsystem_pthread.dylib thread_start (in libsystem_pthread.dylib) + 4

Thread 5

0 libsystem_kernel.dylib __workq_kernreturn (in
libsystem_kernel.dylib) + 8 1 libsystem_pthread.dylib start_wqthread
(in libsystem_pthread.dylib) + 4

Thread 6

0 libsystem_kernel.dylib mach_msg_trap (in libsystem_kernel.dylib) + 8
1 CoreFoundation CFRunLoopServiceMachPort (in CoreFoundation) + 196
2 CoreFoundation __CFRunLoopRun (in CoreFoundation) + 1032 3
CoreFoundation CFRunLoopRunSpecific (in CoreFoundation) + 384 4
CFNetwork +[NSURLConnection(Loader) _resourceLoadLoop:] (in CFNetwork)
+ 412 5 Foundation __NSThread__start
(in Foundation) + 1000 6 libsystem_pthread.dylib _pthread_body (in libsystem_pthread.dylib) +
156 7 libsystem_pthread.dylib _pthread_body (in
libsystem_pthread.dylib) + 0 8 libsystem_pthread.dylib thread_start
(in libsystem_pthread.dylib) + 4

Thread 7

0 libsystem_kernel.dylib select$DARWIN_EXTSN (in
libsystem_kernel.dylib) + 8 1 libsystem_pthread.dylib _pthread_body
(in libsystem_pthread.dylib) + 156 2 libsystem_pthread.dylib
_pthread_body (in libsystem_pthread.dylib) + 0 3 libsystem_pthread.dylib thread_start (in libsystem_pthread.dylib) + 4

Thread 8

0 libsystem_kernel.dylib __psynch_cvwait (in libsystem_kernel.dylib) +
8 1 TouristApp worker_thread (in 1a944b2b614036bbba6b93191b43cf7a)
(mono-os-mutex.h:134) 2 TouristApp start_wrapper (in
1a944b2b614036bbba6b93191b43cf7a) (threads.c:717) 3 TouristApp
inner_start_thread (in 1a944b2b614036bbba6b93191b43cf7a)
(mono-threads-posix.c:92) 4 libsystem_pthread.dylib _pthread_body (in
libsystem_pthread.dylib) + 156 5 libsystem_pthread.dylib _pthread_body
(in libsystem_pthread.dylib) + 0 6 libsystem_pthread.dylib
thread_start (in libsystem_pthread.dylib) + 4

Thread 9

0 libsystem_kernel.dylib __psynch_cvwait (in libsystem_kernel.dylib) +
8 1 TouristApp worker_thread (in 1a944b2b614036bbba6b93191b43cf7a)
(mono-os-mutex.h:134) 2 TouristApp start_wrapper (in
1a944b2b614036bbba6b93191b43cf7a) (threads.c:717) 3 TouristApp
inner_start_thread (in 1a944b2b614036bbba6b93191b43cf7a)
(mono-threads-posix.c:92) 4 libsystem_pthread.dylib _pthread_body (in
libsystem_pthread.dylib) + 156 5 libsystem_pthread.dylib _pthread_body
(in libsystem_pthread.dylib) + 0 6 libsystem_pthread.dylib
thread_start (in libsystem_pthread.dylib) + 4

Thread 10

0 libsystem_kernel.dylib __workq_kernreturn (in
libsystem_kernel.dylib) + 8 1 libsystem_pthread.dylib start_wqthread
(in libsystem_pthread.dylib) + 4

Thread 11

0 libsystem_kernel.dylib __workq_kernreturn (in
libsystem_kernel.dylib) + 8 1 libsystem_pthread.dylib start_wqthread
(in libsystem_pthread.dylib) + 4

Thread 12

0 libsystem_kernel.dylib mach_msg_trap (in libsystem_kernel.dylib) + 8
1 CoreFoundation __CFRunLoopServiceMachPort (in CoreFoundation) + 196
2 CoreFoundation __CFRunLoopRun (in CoreFoundation) + 1032 3
CoreFoundation CFRunLoopRunSpecific (in CoreFoundation) + 384 4
GeoServices _runNetworkThread (in GeoServices) + 428 5
libsystem_pthread.dylib _pthread_body (in libsystem_pthread.dylib) +
156 6 libsystem_pthread.dylib _pthread_body (in
libsystem_pthread.dylib) + 0 7 libsystem_pthread.dylib thread_start
(in libsystem_pthread.dylib) + 4

Thread 13

0 libsystem_kernel.dylib __psynch_cvwait (in libsystem_kernel.dylib) +
8 1 TouristApp worker_thread (in 1a944b2b614036bbba6b93191b43cf7a)
(mono-os-mutex.h:134) 2 TouristApp start_wrapper (in
1a944b2b614036bbba6b93191b43cf7a) (threads.c:717) 3 TouristApp
inner_start_thread (in 1a944b2b614036bbba6b93191b43cf7a)
(mono-threads-posix.c:92) 4 libsystem_pthread.dylib _pthread_body (in
libsystem_pthread.dylib) + 156 5 libsystem_pthread.dylib _pthread_body
(in libsystem_pthread.dylib) + 0 6 libsystem_pthread.dylib
thread_start (in libsystem_pthread.dylib) + 4

Thread 14

0 libsystem_kernel.dylib __workq_kernreturn (in
libsystem_kernel.dylib) + 8 1 libsystem_pthread.dylib start_wqthread
(in libsystem_pthread.dylib) + 4

Thread 15

0 libsystem_kernel.dylib __workq_kernreturn (in
libsystem_kernel.dylib) + 8 1 libsystem_pthread.dylib start_wqthread
(in libsystem_pthread.dylib) + 4

Thread 16

0 libsystem_kernel.dylib __psynch_cvwait (in libsystem_kernel.dylib) +
8 1 TouristApp mono_thread_info_sleep (in
1a944b2b614036bbba6b93191b43cf7a) (mono-os-mutex.h:135) 2 TouristApp
monitor_thread (in 1a944b2b614036bbba6b93191b43cf7a)
(threadpool-ms.c:887) 3 TouristApp start_wrapper (in
1a944b2b614036bbba6b93191b43cf7a) (threads.c:717) 4 TouristApp
inner_start_thread (in 1a944b2b614036bbba6b93191b43cf7a)
(mono-threads-posix.c:92) 5 libsystem_pthread.dylib _pthread_body (in
libsystem_pthread.dylib) + 156 6 libsystem_pthread.dylib _pthread_body
(in libsystem_pthread.dylib) + 0 7 libsystem_pthread.dylib
thread_start (in libsystem_pthread.dylib) + 4

Thread 17

0 libsystem_kernel.dylib __psynch_cvwait (in libsystem_kernel.dylib) +
8 1 TouristApp worker_thread (in 1a944b2b614036bbba6b93191b43cf7a)
(mono-os-mutex.h:134) 2 TouristApp start_wrapper (in
1a944b2b614036bbba6b93191b43cf7a) (threads.c:717) 3 TouristApp
inner_start_thread (in 1a944b2b614036bbba6b93191b43cf7a)
(mono-threads-posix.c:92) 4 libsystem_pthread.dylib _pthread_body (in
libsystem_pthread.dylib) + 156 5 libsystem_pthread.dylib _pthread_body
(in libsystem_pthread.dylib) + 0 6 libsystem_pthread.dylib
thread_start (in libsystem_pthread.dylib) + 4

Thread 18

0 libsystem_kernel.dylib __psynch_cvwait (in libsystem_kernel.dylib) +
8 1 TouristApp worker_thread (in 1a944b2b614036bbba6b93191b43cf7a)
(mono-os-mutex.h:134) 2 TouristApp start_wrapper (in
1a944b2b614036bbba6b93191b43cf7a) (threads.c:717) 3 TouristApp
inner_start_thread (in 1a944b2b614036bbba6b93191b43cf7a)
(mono-threads-posix.c:92) 4 libsystem_pthread.dylib _pthread_body (in
libsystem_pthread.dylib) + 156 5 libsystem_pthread.dylib _pthread_body
(in libsystem_pthread.dylib) + 0 6 libsystem_pthread.dylib
thread_start (in libsystem_pthread.dylib) + 4

Thread 19

0 libsystem_kernel.dylib mach_msg_trap (in libsystem_kernel.dylib) + 8
1 CoreFoundation __CFRunLoopServiceMachPort (in CoreFoundation) + 196
2 CoreFoundation __CFRunLoopRun (in CoreFoundation) + 1032 3
CoreFoundation CFRunLoopRunSpecific (in CoreFoundation) + 384 4
WebCore RunWebThread() (in WebCore) + 456 5 libsystem_pthread.dylib
_pthread_body (in libsystem_pthread.dylib) + 156 6 libsystem_pthread.dylib _pthread_body (in libsystem_pthread.dylib) + 0
7 libsystem_pthread.dylib thread_start (in libsystem_pthread.dylib) +
4

Thread 20

0 libsystem_kernel.dylib __psynch_cvwait (in libsystem_kernel.dylib) +
8 1 libc++.1.dylib std::__1::condition_variable::wait() (in
libc++.dylib) + 56 2 JavaScriptCore JSC::GCThread::waitForNextPhase()
(in JavaScriptCore) + 144 3 JavaScriptCore
JSC::GCThread::gcThreadMain() (in JavaScriptCore) + 84 4
JavaScriptCore WTF::threadEntryPoint() (in JavaScriptCore) + 212 5
JavaScriptCore WTF::wtfThreadEntryPoint() (in JavaScriptCore) + 24 6
libsystem_pthread.dylib _pthread_body (in libsystem_pthread.dylib) +
156 7 libsystem_pthread.dylib _pthread_body (in
libsystem_pthread.dylib) + 0 8 libsystem_pthread.dylib thread_start
(in libsystem_pthread.dylib) + 4

Thread 21

0 libsystem_kernel.dylib mach_msg_trap (in libsystem_kernel.dylib) + 8
1 CoreFoundation __CFRunLoopServiceMachPort (in CoreFoundation) + 196
2 CoreFoundation __CFRunLoopRun (in CoreFoundation) + 1032 3
CoreFoundation CFRunLoopRunSpecific (in CoreFoundation) + 384 4
libAVFAudio.dylib GenericRunLoopThread::Entry() (in libAVFAudio.dylib)
+ 164 5 libAVFAudio.dylib CAPThread::Entry() (in libAVFAudio.dylib) + 84 6 libsystem_pthread.dylib _pthread_body (in
libsystem_pthread.dylib) + 156 7 libsystem_pthread.dylib _pthread_body
(in libsystem_pthread.dylib) + 0 8 libsystem_pthread.dylib
thread_start (in libsystem_pthread.dylib) + 4

Thread 22

0 libsystem_kernel.dylib semaphore_wait_trap (in
libsystem_kernel.dylib) + 8 1 MediaToolbox fpa_AsyncMovieControlThread
(in MediaToolbox) + 1948 2 CoreMedia figThreadMain (in CoreMedia) +
272 3 libsystem_pthread.dylib _pthread_body (in
libsystem_pthread.dylib) + 156 4 libsystem_pthread.dylib _pthread_body
(in libsystem_pthread.dylib) + 0 5 libsystem_pthread.dylib
thread_start (in libsystem_pthread.dylib) + 4

Thread 23

0 libsystem_kernel.dylib __workq_kernreturn (in
libsystem_kernel.dylib) + 8 1 libsystem_pthread.dylib start_wqthread
(in libsystem_pthread.dylib) + 4

Thread 24

0 libsystem_kernel.dylib __psynch_cvwait (in libsystem_kernel.dylib) +
8 1 Foundation -[NSCondition wait] (in Foundation) + 240 2 Foundation
-[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] (in
Foundation) + 792 3 Foundation -[NSObject(NSThreadPerformAdditions)
performSelectorOnMainThread:withObject:waitUntilDone:] (in Foundation)
+ 144 4 TouristApp (wrapper_managed-to-native)_ObjCRuntime.Messaging:objc_msgSend (in
1a944b2b614036bbba6b93191b43cf7a) + 140 5 TouristApp
Foundation.NSObject:InvokeOnMainThread (in
1a944b2b614036bbba6b93191b43cf7a) (NSObject2.cs:556) 6 TouristApp
TouristApp_TouristApp_DettaglioPunti__UpdateDescriptionAudioc__AnonStorey3__m__2 (in 1a944b2b614036bbba6b93191b43cf7a) + 236 7 TouristApp
m__0 (in 1a944b2b614036bbba6b93191b43cf7a)
(NSObject.g.cs:52) 8 TouristApp ThreadStart_Context (in
1a944b2b614036bbba6b93191b43cf7a) (thread.cs:72) 9 TouristApp
RunInternal (in 1a944b2b614036bbba6b93191b43cf7a)
(executioncontext.cs:957) 10 TouristApp Run (in
1a944b2b614036bbba6b93191b43cf7a) (executioncontext.cs:893) 11
TouristApp ThreadStart (in 1a944b2b614036bbba6b93191b43cf7a)
(thread.cs:87) 12 TouristApp
wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr
(in 1a944b2b614036bbba6b93191b43cf7a) + 244 13 TouristApp
mono_jit_runtime_invoke (in 1a944b2b614036bbba6b93191b43cf7a)
(mini-runtime.c:2564) 14 TouristApp mono_runtime_invoke (in
1a944b2b614036bbba6b93191b43cf7a) (object.c:2897) 15 TouristApp
start_wrapper (in 1a944b2b614036bbba6b93191b43cf7a) (threads.c:740) 16
TouristApp inner_start_thread (in 1a944b2b614036bbba6b93191b43cf7a)
(mono-threads-posix.c:92) 17 libsystem_pthread.dylib _pthread_body (in
libsystem_pthread.dylib) + 156 18 libsystem_pthread.dylib
_pthread_body (in libsystem_pthread.dylib) + 0 19 libsystem_pthread.dylib thread_start (in libsystem_pthread.dylib) + 4


I don't understand if this is a problem of Mono/Xamarin or can be my code.

Any idea?

UPDATE
As request in the comment this is the code of Main

public class Application
{
// This is the main entry point of the application.
static void Main (string[] args)
{
Xamarin.Insights.Initialize ("xxxxxxxxx"); //id of the app on insight
UIApplication.Main (args, null, "AppDelegate");
}
}


And this is my AppDelegate

[Register ("AppDelegate")]
public class AppDelegate : UIApplicationDelegate
{
// class-level declarations

public override UIWindow Window {
get;
set;
}

public static UIStoryboard Storyboard = UIStoryboard.FromName ("TouristAppStoryBoard", null);
public static UIViewController initialViewController;

public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
{

Window = new UIWindow (UIScreen.MainScreen.Bounds);

initialViewController = Storyboard.InstantiateInitialViewController ();
Window.RootViewController = initialViewController;

var navController = Window.RootViewController as UINavigationController;
navController.NavigationBar.TitleTextAttributes = ViewUtility.GetAttributesForTitleNavigationBar ();

Window.MakeKeyAndVisible ();
return true;
}

public override void OnResignActivation (UIApplication application)
{
}

public override void DidEnterBackground (UIApplication application)
{

LocationManager.GetIstance ().StopLocationUpdates ();
var taskID = UIApplication.SharedApplication.BeginBackgroundTask( () => {});
Task.Factory.StartNew ( () => {
ComuniDb.GetIstance().Manutenzione();
UIApplication.SharedApplication.EndBackgroundTask(taskID);
});
}

public override void WillEnterForeground (UIApplication application)
{
LocationManager.GetIstance ().StartLocationUpdates ();
}
}
}


My app it's not little, I hope you find what you are looking for.

Answer

I found the problem. The problem is logged in the device log, but not in the crash log. It's silly for me (device log has more information than crash log?), but I found the bug and fix it.

Comments