Forum Xamarin.Mac

How to get better information on native crashes

XavierFortinXavierFortin USMember ✭✭

This has been kind of a long standing issue for me, but is there anyway to expand native crash information to get better information. For instance, one of the most recent crash report I've been getting from user (and quite often) is this:

=================================================================
Native Crash Reporting
=================================================================
Got a SIGILL while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================
Native stacktrace:
=================================================================
0x102020228 - /Applications/Remote Desktop Manager Free.app/Contents/MacOS/RemoteDesktopManager.Free : mono_dump_native_crash_info
0x102013a45 - /Applications/Remote Desktop Manager Free.app/Contents/MacOS/RemoteDesktopManager.Free : mono_handle_native_crash
0x102027440 - /Applications/Remote Desktop Manager Free.app/Contents/MacOS/RemoteDesktopManager.Free : mono_sigill_signal_handler
0x7fff7266142d - /usr/lib/system/libsystem_platform.dylib : _sigtramp
0x7fff9c279988 - /usr/lib/system/libsystem_c.dylib : __global_locale
0x7fff7241072e - /usr/lib/system/libdispatch.dylib : dispatch_assert_queue
0x7fff3991a952 - /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox : islGetInputSourceListWithAdditions
0x7fff3991d134 - /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox : isValidateInputSourceRef
0x7fff3991cffc - /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox : TSMGetInputSourceProperty
0x7fff3993d2e7 - /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox : TSMTranslateKeyEvent
0x7fff399401ed - /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox : TSMProcessRawKeyCode
0x7fff381d323e - /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit : _convertEventRefToString
0x7fff381d3080 - /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit : -[NSEvent charactersIgnoringModifiers]
0x7fff3ada5fec - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : __invoking___
0x7fff3ada5e83 - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : -[NSInvocation invoke]
0x7fff3add9d7e - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : -[NSInvocation invokeWithTarget:]
0x7fff3ada4889 - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : ___forwarding___
0x7fff3ada44b8 - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : _CF_forwarding_prep_0
0x7fff3ada5fec - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : __invoking___
0x7fff3ada5e83 - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : -[NSInvocation invoke]
0x7fff3d53147b - /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation : -[NSConnection dispatchInvocation:]
0x7fff3d52f21a - /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation : -[NSConnection handleRequest:sequence:]
0x7fff3d52e279 - /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation : -[NSConnection handlePortCoder:]
0x7fff3d52d8ce - /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation : -[NSConnection dispatchWithComponents:]
0x7fff3d4c544c - /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation : __NSFireMachPort
0x7fff3adf3a7b - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : __CFMachPortPerform
0x7fff3adc50bf - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
0x7fff3adc500f - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : __CFRunLoopDoSource1
0x7fff3adc3c7c - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : __CFRunLoopRun
0x7fff3adc2bd3 - /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation : CFRunLoopRunSpecific
0x7fff3d589af6 - /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation : -[NSConnection run]
0x7fff3d45e7a8 - /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation : __NSThread__start__
0x7fff7266ce65 - /usr/lib/system/libsystem_pthread.dylib : _pthread_start
0x7fff7266883b - /usr/lib/system/libsystem_pthread.dylib : thread_start

=================================================================
Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x7fff72410799):0x7fff72410789 89 de 31 c0 e8 d9 9d 02 00 48 89 1d f7 ed e5 29 ..1......H.....)
0x7fff72410799 0f 0b 55 48 89 e5 48 8b 07 0f b6 40 28 48 8d 48 [email protected](H.H
0x7fff724107a9 ef 48 83 f9 02 73 62 48 8b 47 38 65 33 04 25 18 .H...sbH.G8e3.%.
0x7fff724107b9 00 00 00 83 f8 03 76 4a 65 48 8b 14 25 a0 00 00 ......vJeH..%...

=================================================================
Managed Stacktrace:
=================================================================
=================================================================

As we can see, there is no Managed Stacktrace and there does not appear to be anything in the Native Stacktrace that would point back to the Managed code (no JIT statement). It makes it quite hard to troubleshoot, especially since it doesn't seem really tied to specific operations.

I realize that this is kind of a general question, but any help with this would be appreciated.

Answers

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    There are a few of things you can do, with various costs:

    • You can AOT Compile your application. It will increase the size, but you'll better stack traces when you hit a native crash, since you'll have something showing managed frames.
    • You can integrate a crash reporting service API. Some of those understand C# well enough to get you managed frames.

    But in general, hard native crashes like this are tough. :(

    One thing to consider is that you are crashing in dispatch_assert_queue here:

    0x7fff7241072e - /usr/lib/system/> libdispatch.dylib : dispatch_assert_queue
    0x7fff3991a952 - /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox : islGetInputSourceListWithAdditions
    0x7fff3991d134 - /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox : isValidateInputSourceRef
    0x7fff3991cffc - /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox : TSMGetInputSourceProperty
    

    So maybe there is a threading issue in your application, where you are invoking on a non-UI thread and being killed here?

Sign In or Register to comment.