locked
iOS works in Debug but mono crashes at splash screen in Release / AppStore RRS feed

  • Question

  • User221722 posted

    Sorry to bother you guys, but I've been struggling with this for several days now and I'm out of ideas!

    I've been testing an app via TestFlight for a while, but the 90 day expired and I had to upload a new version to keep the beta testers alive.

    What changed? * Code wise, nothing!
    * VS version updated * Xamarin updated * Some Nugets updated.

    It all still runs (on all my devices) in debug mode, but in release mode, ad-hoc and AppStore mode is crashes at the splash screen.

    I've tried all linker options but it makes no difference. I've tried to strip out as much code as possible but it happens with even a bare bones amount of code running. It looks like it's crashing on a mono invoke but I am quite willing to be corrected there.

    Help!

    The console shows this:

    Launched application 'xxxappname' on 'iPad Air 2 Device' with pid 1175 2020-07-16 14:46:02.099 xxxappname'[1175:596388] error: * Assertion at /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mono/mini/mini-trampolines.c:1494, condition `invoke' not met

    =================================================================

    Native Crash Reporting

    Got a abrt 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:

    0x102d92cc8 - /private/var/containers/Bundle/Application/C90B8695-455C-4C99-8B3C-8537AA5ABB65/xxxappname.iOS.app/xxxappname.iOS : 
    0x102d89964 - /private/var/containers/Bundle/Application/C90B8695-455C-4C99-8B3C-8537AA5ABB65/xxxappname.iOS.app/xxxappname.iOS : 
    0x102d92214 - /private/var/containers/Bundle/Application/C90B8695-455C-4C99-8B3C-8537AA5ABB65/xxxappname.iOS.app/xxxappname.iOS : 
    0x19434b894 - /usr/lib/system/libsystem_platform.dylib : <redacted>
    0x1943501e8 - /usr/lib/system/libsystem_pthread.dylib : <redacted>
    0x1942a3934 - /usr/lib/system/libsystem_c.dylib : abort
    0x102eced50 - /private/var/containers/Bundle/Application/C90B8695-455C-4C99-8B3C-8537AA5ABB65/xxxappname.iOS.app/xxxappname.iOS : xamarin_find_protocol_wrapper_type
    0x102ec90a4 - /private/var/containers/Bundle/Application/C90B8695-455C-4C99-8B3C-8537AA5ABB65/xxxappname.iOS.app/xxxappname.iOS : 
    0x102ec912c - /private/var/containers/Bundle/Application/C90B8695-455C-4C99-8B3C-8537AA5ABB65/xxxappname.iOS.app/xxxappname.iOS : 
    0x102ec915c - /private/var/containers/Bundle/Application/C90B8695-455C-4C99-8B3C-8537AA5ABB65/xxxappname.iOS.app/xxxappname.iOS : 
    0x102d9d4f0 - /private/var/containers/Bundle/Application/C90B8695-455C-4C99-8B3C-8537AA5ABB65/xxxappname.iOS.app/xxxappname.iOS : 
    0x102d947ac - /private/var/containers/Bundle/Application/C90B8695-455C-4C99-8B3C-8537AA5ABB65/xxxappname.iOS.app/xxxappname.iOS : 
    0x102d74c5c - /private/var/containers/Bundle/Application/C90B8695-455C-4C99-8B3C-8537AA5ABB65/xxxappname.iOS.app/xxxappname.iOS : 
    0x102d75cec - /private/var/containers/Bundle/Application/C90B8695-455C-4C99-8B3C-8537AA5ABB65/xxxappname.iOS.app/xxxappname.iOS : 
    0x102d75528 - /private/var/containers/Bundle/Application/C90B8695-455C-4C99-8B3C-8537AA5ABB65/xxxappname.iOS.app/xxxappname.iOS : 
    0x102d94e3c - /private/var/containers/Bundle/Application/C90B8695-455C-4C99-8B3C-8537AA5ABB65/xxxappname.iOS.app/xxxappname.iOS : 
    0x102d995f0 - /private/var/containers/Bundle/Application/C90B8695-455C-4C99-8B3C-8537AA5ABB65/xxxappname.iOS.app/xxxappname.iOS : 
    0x102e32b30 - /private/var/containers/Bundle/Application/C90B8695-455C-4C99-8B3C-8537AA5ABB65/xxxappname.iOS.app/xxxappname.iOS : 
    0x102e34738 - /private/var/containers/Bundle/Application/C90B8695-455C-4C99-8B3C-8537AA5ABB65/xxxappname.iOS.app/xxxappname.iOS : 
    0x102ecefe4 - /private/var/containers/Bundle/Application/C90B8695-455C-4C99-8B3C-8537AA5ABB65/xxxappname.iOS.app/xxxappname.iOS : xamarin_find_protocol_wrapper_type
    0x102ed5770 - /private/var/containers/Bundle/Application/C90B8695-455C-4C99-8B3C-8537AA5ABB65/xxxappname.iOS.app/xxxappname.iOS : xamarin_release_block_on_main_thread
    0x100717e98 - /private/var/containers/Bundle/Application/C90B8695-455C-4C99-8B3C-8537AA5ABB65/xxxappname.iOS.app/xxxappname.iOS : 
    0x1944428f0 - /usr/lib/system/libdyld.dylib : <redacted>
    

    =================================================================

    Basic Fault Address Reporting

    Memory around native instruction pointer (0x194437d88):0x194437d78 c0 03 5f d6 c0 03 5f d6 10 29 80 d2 01 10 00 d4 .......)...... 0x194437d88 e3 00 00 54 fd 7b bf a9 fd 03 00 91 4f 7b ff 97 ...T.{......O{.. 0x194437d98 bf 03 00 91 fd 7b c1 a8 c0 03 5f d6 c0 03 5f d6 .....{........ 0x194437da8 90 29 80 d2 01 10 00 d4 e3 00 00 54 fd 7b bf a9 .).........T.{..

    =================================================================

    Managed Stacktrace:

    ================================================================= Application 'xxxappname' terminated.

    Thursday, July 16, 2020 2:09 PM

Answers

  • User221722 posted

    SOLUTION (for me)

    I traced it to a DependencyService that worked perfectly in debug mode but not in release. Trying to reproduce in debug mode would never have worked.

    The cause was the linker setting in release mode. Make sure it's set to "SDK & Framework Only", otherwise the linker was removing code as part of it's optimisation but you need it to be there.

    Hope this helps.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, November 5, 2020 1:45 PM

All replies

  • User221722 posted

    I should probably have added that I completely uninstalled VS & all libraries and re-installed from scratch today (latest stable versions) as a last ditch hope that something was corrupted.

    Thursday, July 16, 2020 2:11 PM
  • User369979 posted

    It's better to stably reproduce this issue under debugging. We can't spot your issue through these stack traces. Does this device have a corresponding UDID to test your application? Have you tested this on another validate device? Try to integrate some analytic libraries to help us find the root cause. Additionally, App Center could be helpful.

    Friday, July 17, 2020 8:01 AM
  • User221722 posted

    @LandLu thanks for the reply.

    If I could reproduce under debugging I'd at least have a change, but it works 100% under the debugger.

    It works 100% under the debugger on all my (5) devices.

    It crashes 100% of the time in release mode on all my (5) devices.

    I haven't used App Center before, I'll look in to it. What other analytic libraries do you suggest?

    Friday, July 17, 2020 8:19 AM
  • User369979 posted

    It's hard to say what caused this at startup time. We need to collect some information to spot this issue. Did you choose this architecture under release mode: Moreover, opening a free support ticket could be considered, if you really can't reproduce it on your side: https://support.microsoft.com/en-us/supportforbusiness/productselection?sapId=211dd84f-3474-c3c5-79bf-66db630c92a6

    Monday, July 20, 2020 9:48 AM
  • User221722 posted

    Hi Landlu,
    Thanks again. Yes I selected ARM64 and tried with all linker options. I also integrated App Center and in debug mode everything runs perfectly. In release mode I never get anything to the App Center so I assume it's crashing either before it gets initialised or before any events can be logged.

    I also extracted the crash log from the device. Not sure if this is helpful or not:

    Incident Identifier: FACBC6FA-AE31-4B40-B89A-89D4DE6E1825 CrashReporter Key: ca6f1c721a83cb2b8d06d0d401f2a37e57b97712 Hardware Model: iPad5,4 Process: xxxxxx.iOS [1515] Path: /private/var/containers/Bundle/Application/BE11B2AC-78D6-40BC-xxxx-10B19D7A83E1/xxxxxx.iOS.app/xxxxxx.iOS Identifier: com.xxxxx.xxxxxx Version: 1.0.1.56 (1.0.2) Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd [1] Coalition: com.xxxxx.xxxxxx[883]

    Date/Time: 2020-07-20 21:50:57.6768 +0100 Launch Time: 2020-07-20 21:50:57.5742 +0100 OS Version: iPhone OS 13.5.1 (17F80) Release Type: User Baseband Version: 9.60.01 Report Version: 104

    Exception Type: EXCCRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXCCORPSE_NOTIFY Triggered by Thread: 0

    Thread 0 name: tid407 Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libsystemkernel.dylib 0x0000000194437d88 _pthreadkill + 8 1 libsystempthread.dylib 0x00000001943501e8 pthreadkill$VARIANT$mp + 136 2 libsystemc.dylib 0x00000001942a39b0 _abort + 112 3 libsystemc.dylib 0x00000001942a3940 _abort + 0 4 xxxxxx.iOS 0x000000010336732c printcallback(char const*, int) + 43004716 (runtime.m:1218) 5 xxxxxx.iOS 0x0000000103354c14 monoegglogvnofree + 42929172 (goutput.c:167) 6 xxxxxx.iOS 0x0000000103354ca8 monoegassertionmessage + 42929320 (goutput.c:201) 7 xxxxxx.iOS 0x0000000103354cec monoassertionmessageunreachable + 42929388 (goutput.c:227) 8 xxxxxx.iOS 0x0000000103209cac monoclasscreatefromtypedef + 41573548 (class-init.c:418) 9 xxxxxx.iOS 0x0000000103208488 monoclasssetupfields + 41567368 (class-init.c:370) 10 xxxxxx.iOS 0x0000000103214f84 monoclassdatasize + 41619332 (class.c:2219) 11 xxxxxx.iOS 0x000000010328fa30 monoclassvtablechecked + 42121776 (object.c:1949) 12 xxxxxx.iOS 0x00000001031cdee4 monoresolvepatchtarget + 41328356 (mini-runtime.c:1471) 13 xxxxxx.iOS 0x00000001031a68dc initmethod + 41167068 (aot-runtime.c:4674) 14 xxxxxx.iOS 0x00000001031a796c loadmethod + 41171308 (aot-runtime.c:4296) 15 xxxxxx.iOS 0x00000001031a71a8 monoaotgetmethod + 41169320 (aot-runtime.c:4968) 16 xxxxxx.iOS 0x00000001031ce9a0 monojitcompilemethodwithopt + 41331104 (mini-runtime.c:2383) 17 xxxxxx.iOS 0x00000001031d33c8 monojitruntimeinvoke + 41350088 (mini-runtime.c:3056) 18 xxxxxx.iOS 0x00000001032904ac monoruntimetryinvoke + 42124460 (object.c:3161)xxxxxx.iOS 19 xxxxxx.iOS 0x00000001032923c8 monoruntimeinvoke + 42132424 (object.c:3101) 20 xxxxxx.iOS 0x00000001033675c0 xamarininitialize + 43005376 (runtime.m:1364) 21 xxxxxx.iOS 0x000000010336e96c xamarin_main + 43034988 (monotouch-main.m:435) 22 xxxxxx.iOS 0x0000000100adf76c main + 505708 (main.m:184) 23 libdyld.dylib 0x00000001944428f0 start + 4

    Thread 1: 0 libsystempthread.dylib 0x000000019435c738 startwqthread + 0

    Thread 2: 0 libsystempthread.dylib 0x000000019435c738 startwqthread + 0

    Thread 3: 0 libsystempthread.dylib 0x000000019435c738 startwqthread + 0

    Thread 4: 0 libsystempthread.dylib 0x000000019435c738 startwqthread + 0

    Thread 5: 0 libsystempthread.dylib 0x000000019435c738 startwqthread + 0

    Thread 6: 0 libsystempthread.dylib 0x000000019435c738 startwqthread + 0

    Thread 7 name: JavaScriptCore bmalloc scavenger Thread 7: 0 libsystemkernel.dylib 0x0000000194437b58 psynchcvwait + 8 1 libsystempthread.dylib 0x0000000194351ce4 _pthreadcondwait$VARIANT$mp + 680 2 libc++.1.dylib 0x00000001944897ac std::1::conditionvariable::wait+ 51116 (std::1::uniquelock&) + 24 3 JavaScriptCore 0x00000001a352dab8 void std::1::conditionvariableany::wait >+ 563896 (std::1::uniquelock&) + 108 4 JavaScriptCore 0x00000001a3531790 bmalloc::Scavenger::threadRunLoop+ 579472 () + 160 5 JavaScriptCore 0x00000001a35314a0 bmalloc::Scavenger::Scavenger+ 578720 (std::1::lockguard const&) + 0 6 JavaScriptCore 0x00000001a35326e4 std::1::threadspecificptr::setpointer+ 583396 (std::1::threadstruct*) + 0 7 libsystempthread.dylib 0x0000000194358d98 pthreadstart + 156 8 libsystempthread.dylib 0x000000019435c74c threadstart + 8

    Thread 8 name: WebThread Thread 8: 0 libsystemkernel.dylib 0x0000000194416198 machmsgtrap + 8 1 libsystemkernel.dylib 0x000000019441560c machmsg + 72 2 CoreFoundation 0x00000001945c0468 _CFRunLoopServiceMachPort + 148 3 CoreFoundation 0x00000001945bb49c _CFRunLoopRun + 1160 4 CoreFoundation 0x00000001945bace8 CFRunLoopRunSpecific + 424 5 WebCore 0x000000019cb35ac0 RunWebThread+ 10132160 (void*) + 612 6 libsystempthread.dylib 0x0000000194358d98 pthreadstart + 156 7 libsystempthread.dylib 0x000000019435c74c threadstart + 8

    Thread 9 name: SGen worker Thread 9: 0 libsystemkernel.dylib 0x0000000194437b58 _psynchcvwait + 8 1 libsystempthread.dylib 0x0000000194351ce4 pthreadcondwait$VARIANT$mp + 680 2 xxxxxx.iOS 0x0000000103331f40 threadfunc + 42786624 (sgen-thread-pool.c:196) 3 libsystempthread.dylib 0x0000000194358d98 _pthreadstart + 156 4 libsystempthread.dylib 0x000000019435c74c threadstart + 8

    Thread 0 crashed with ARM Thread State (64-bit): x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000000000000 x4: 0x0000000000000000 x5: 0x0000000000989680 x6: 0x0000000000000000 x7: 0xffffffffffffffec x8: 0x00000001039d5840 x9: 0x68b8e610e81f331d x10: 0x00000000000003e8 x11: 0x00000000000007fb x12: 0x00000000000007fd x13: 0x0000000000000000 x14: 0x000000008d820800 x15: 0x0000000000000041 x16: 0x0000000000000148 x17: 0x000000000d800000 x18: 0x0000000000000000 x19: 0x0000000000000006 x20: 0x0000000000000407 x21: 0x0000000000000001 x22: 0x00000001039d5920 x23: 0x0000000000000000 x24: 0x0000000000000000 x25: 0x00000000ffffffff x26: 0x0000000000000001 x27: 0x0000000000000080 x28: 0x0000000000000080 fp: 0x000000016f399dc0 lr: 0x00000001943501e8 sp: 0x000000016f399da0 pc: 0x0000000194437d88 cpsr: 0x40000000 esr: 0x56000080 Address size fault

    Binary Images: 0x100a64000 - 0x10347bfff xxxxxx.iOS arm64 /var/containers/Bundle/Application/BE11B2AC-78D6-40BC-B16C-10B19D7A83E1/xxxxxx.iOS.app/xxxxxx.iOS 0x103888000 - 0x103893fff libobjc-trampolines.dylib arm64 <927690b4ce6e3dbb8d54d00bd46e211c> /usr/lib/libobjc-trampolines.dylib 0x103968000 - 0x1039cbfff dyld arm64 /usr/lib/dyld 0x1941e7000 - 0x1941fdfff libsystemtrace.dylib arm64 /usr/lib/system/libsystemtrace.dylib 0x1941fe000 - 0x19422ffff libxpc.dylib arm64 /usr/lib/system/libxpc.dylib 0x194230000 - 0x194230fff libsystemblocks.dylib arm64 <5ecacf25aea7392db0edea47df03841f> /usr/lib/system/libsystemblocks.dylib 0x194231000 - 0x1942acfff libsystemc.dylib arm64 <7de48f8fc80f3f6582e5438a038914de> /usr/lib/system/libsystemc.dylib

    • lots more (too much to post)
    Monday, July 20, 2020 9:06 PM
  • User67478 posted

    Did you ever find a solution? Mine is also crashing on splash screen start up. This is the only info I have:

    Thread 0 Crashed: 0 libsystem_kernel.dylib 0x00000001ab1f7ec4 __pthread_kill + 8 1 libsystem_pthread.dylib 0x00000001ab1131d8 pthread_kill$VARIANT$mp + 136 (pthread.c:1458) 2 libsystem_c.dylib 0x00000001ab0678c0 __abort + 112 (abort.c:147) 3 libsystem_c.dylib 0x00000001ab067850 abort + 112 (abort.c:118) 4 MyAppiOS 0x000000010267e414 xamarin_find_protocol_wrapper_type + 500 5 MyAppiOS 0x000000010266bbf4 0x100588000 + 34487284 6 MyAppiOS 0x000000010266bc44 0x100588000 + 34487364 7 MyAppiOS 0x00000001024b9558 0x100588000 + 32707928 8 MyAppiOS 0x0000000102518854 0x100588000 + 33097812 9 MyAppiOS 0x000000010251996c 0x100588000 + 33102188 10 MyAppiOS 0x0000000102519478 0x100588000 + 33100920 11 MyAppiOS 0x000000010251b9fc 0x100588000 + 33110524 12 MyAppiOS 0x000000010267e50c xamarin_find_protocol_wrapper_type + 748 13 MyAppiOS 0x0000000102685af0 xamarin_release_block_on_main_thread + 26784 14 MyAppiOS 0x00000001005de9e0 0x100588000 + 354784 15 libdyld.dylib 0x00000001ab202360 start + 4

    EDIT:

    Ok the solution is here:

    Try cleaning your solution and then rebuilding it.

    Thursday, November 5, 2020 12:50 PM
  • User221722 posted

    SOLUTION (for me)

    I traced it to a DependencyService that worked perfectly in debug mode but not in release. Trying to reproduce in debug mode would never have worked.

    The cause was the linker setting in release mode. Make sure it's set to "SDK & Framework Only", otherwise the linker was removing code as part of it's optimisation but you need it to be there.

    Hope this helps.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, November 5, 2020 1:45 PM