Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to map iOS crash logs to Unity c# functions

Discussion in 'iOS and tvOS' started by dorukeker, Jan 30, 2019.

  1. dorukeker

    dorukeker

    Joined:
    Dec 6, 2016
    Posts:
    37
    Hello All,

    I need help understanding how to read iOS crash logs and map them to Unity functions.
    Using Unity: 2018.2.4f1 Xcode: 10.1 Building for enterprise / adhoc

    The crash log I receive from the device looks like this

    Thread 0 name: Dispatch queue: com.apple.main-thread
    Thread 0 Crashed:
    0 ??? 0x00000001291ad600 0 + 4984591872
    1 <my_app_name> 0x00000001033aec14 _hidden#220979_ + 4484116 (__hidden#221117_:340)
    2 <my_app_name> 0x00000001033aec3c _hidden#220979_ + 4484156 (__hidden#221117_:357)
    3 <my_app_name> 0x00000001033aed98 _hidden#190622_ + 4484504 (__hidden#221117_:411)
    4 <my_app_name> 0x00000001031ccba0 _hidden#190542_ + 2509728 (__hidden#190642_:0)
    5 <my_app_name> 0x0000000102f7731c _hidden#433_ + 62236 (__hidden#483_:280)
    6 <my_app_name> 0x0000000102f77208 _hidden#430_ + 61960 (__hidden#483_:77)
    7 QuartzCore 0x0000000195c47854 CA::Display::DisplayLink::dispatch_items+ 67668 (unsigned long long, unsigned long long, unsigned long long) + 828
    8 IOKit 0x00000001919e3b94 IODispatchCalloutFromCFMessage + 488
    9 CoreFoundation 0x00000001916ecff8 __CFMachPortPerform + 188
    10 CoreFoundation 0x0000000191714844 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
    11 CoreFoundation 0x0000000191713f90 __CFRunLoopDoSource1 + 440
    12 CoreFoundation 0x000000019170ed48 __CFRunLoopRun + 2140
    13 CoreFoundation 0x000000019170e1cc CFRunLoopRunSpecific + 436
    14 GraphicsServices 0x0000000193985584 GSEventRunModal + 100
    15 UIKitCore 0x00000001be581054 UIApplicationMain + 212
    16 <my_app_name> 0x0000000102f6fdd0 main + 32208 (__hidden#8_:33)
    17 libdyld.dylib 0x00000001911cebb4 start + 4


    After applying the techniques mentioned here https://stackoverflow.com/questions/25855389/how-to-symbolicate-crash-log-xcode and here https://www.bugsee.com/blog/ios-crash-symbolication-bitcode/
    I was able to symbolicate it to this


    000000000000000000 000000000000000000
    0x0000000104cc6c14 CleanupAllObjects() (in <my_app_name>) (BaseObject.h:759)
    0x0000000104cc6c3c CleanupAllObjects() (in <my_app_name>) (BaseObject.h:246)
    0x0000000104cc6d98 CleanupAllObjects() (in <my_app_name>) (SaveAndLoadHelper.cpp:489)
    0x0000000104ae4ba0 access_virt_sarray (in <my_app_name>) (jmemmgr.c:854)
    0x000000010488f31c -[KeyboardDelegate positionInput:x:y:] (in <my_app_name>) (Keyboard.mm:393)
    0x000000010488f208 -[KeyboardDelegate updateInputHidden] (in <my_app_name>) (Keyboard.mm:374)
    0x0000000195c47854 0x0000000195c47854
    0x00000001919e3b94 0x00000001919e3b94
    0x00000001916ecff8 0x00000001916ecff8
    0x0000000191714844 0x0000000191714844
    0x0000000191713f90 0x0000000191713f90
    0x000000019170ed48 0x000000019170ed48
    0x000000019170e1cc 0x000000019170e1cc
    0x0000000193985584 0x0000000193985584
    0x00000001be581054 0x00000001be581054
    0x0000000104887dd0 -[UnityWWWConnectionDelegate .cxx_destruct] (in <my_app_name>) (WWWConnection.mm:27)
    0x00000001911cebb4 0x00000001911cebb4


    So it tells me some thing goes wrong on line 759 on BaseObject.h.
    However I cannot find a way to map BaseObject.h to the scripts I have in Unity.

    Can some one help out what is the best way to do this?
    Thank you in advanced.

    Cheers,
    Doruk
     
    Last edited: Jan 30, 2019
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Are you able to reproduce the crash in your testing? Then you should be able to step debug into the code, or use Debug.Log, to get a better idea of which method may be failing. It's more difficult when you only have crash logs however.
     
  3. dorukeker

    dorukeker

    Joined:
    Dec 6, 2016
    Posts:
    37
    Thanks for the reply!

    Short answer: no I cannot replicate when testing.

    More context: it is an AR installation for a museum. The crash seem to happen randomly; once in every couple days. I cannot reproduce it but there some iPads frozen (with a crash) time to time.

    This piece of log is from one of the live iPads for the exhibition.

    There more logs in the iPad over the months. When I apply to same symbolication to the logs they all show the same line in the BaseObjcet.h. This makes me think that the crash is not random after all. But I cannot map that line back to my scripts to understand what is going on.

    It is an AR application using ARKit plugin.
     
    ROBYER1 likes this.
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Understood, yes trying to debug from crash logs only is problematic when you can't reproduce. You are on the right track, sorry I could not be of more help.
     
    ROBYER1 likes this.