Search Unity

Android crash

Discussion in 'Android' started by svenskefan, Apr 22, 2011.

  1. svenskefan

    svenskefan

    Joined:
    Nov 26, 2008
    Posts:
    282
    Hi!
    I have just started porting our iPhone game to Android,
    It does crash quite frequently and this is an example dump

    I/DEBUG (18999): signal 11 (SIGSEGV), fault addr 00ea9068
    I/DEBUG (18999): r0 00ea65a8 r1 00d80d90 r2 00d80d90 r3 00d69930
    I/DEBUG (18999): r4 00d7e148 r5 00000161 r6 00d7b548 r7 00ea9068
    I/DEBUG (18999): r8 00ea9098 r9 00d7e170 10 00ea65a8 fp 00d693a8
    I/DEBUG (18999): ip 341d2858 sp 341d27fc lr 4e139d70 pc 4e02eea0 cpsr 80000010
    I/DEBUG (18999): d0 bd9963393cc2b4ef d1 3f4f358923b8e55d
    I/DEBUG (18999): d2 bf113ef53e1b204e d3 3f800000bdbb4e53
    I/DEBUG (18999): d4 c083c4e4408365af d5 41ee34aa40b519b6
    I/DEBUG (18999): d6 c04f3c0e4027c93d d7 3f2a4c513e2ae94f
    I/DEBUG (18999): d8 3f11e4504211be02 d9 000000004011f1ca
    I/DEBUG (18999): d10 41642c743ff04aa8 d11 00000000c2063c02
    I/DEBUG (18999): d12 42066ccabfb50e08 d13 0000000041633b42
    I/DEBUG (18999): d14 c0440c3440585e7b d15 000000004045dfa1
    I/DEBUG (18999): d16 3fedde7ffbe70915 d17 3f640395f5e18982
    I/DEBUG (18999): d18 bf56b2c0abf79398 d19 3f929334b3f26c4e
    I/DEBUG (18999): d20 3fa55553e1053a42 d21 3f929334b3f26c4e
    I/DEBUG (18999): d22 0000000000000000 d23 3ef99342e0ee5069
    I/DEBUG (18999): d24 3ef99342e0ee5069 d25 3e3dff2d20000000
    I/DEBUG (18999): d26 3e3dff2d20000000 d27 3ef99342e0ee5069
    I/DEBUG (18999): d28 0000000000000000 d29 0000000000000000
    I/DEBUG (18999): d30 0000000000000000 d31 0000000000000000
    I/DEBUG (18999): scr 2000001a
    I/DEBUG (18999):
    I/DEBUG (18999): #00 pc 0002eea0 /data/data/se.wormann.egsfc2/lib/libunity.so
    I/DEBUG (18999): #01 pc 00139d6c /data/data/se.wormann.egsfc2/lib/libunity.so
    I/DEBUG (18999):
    I/DEBUG (18999): code around pc:
    I/DEBUG (18999): 4e02ee80 ecb17a02 ee0a4a20 ee4a4aa0 ee0b5a20
    I/DEBUG (18999): 4e02ee90 e2878030 ee4a5a02 ee0a6a82 ee4b6a02
    I/DEBUG (18999): 4e02eea0 ecb78a04 ec98ea03 ee0c4a01 ee4c4a81
    I/DEBUG (18999): 4e02eeb0 ee0d5a01 f5d1f400 e1510002 ee4c5a22
    I/DEBUG (18999): 4e02eec0 ee0c6aa2 ee4d6a22 ecb7aa04 eca44a06
    I/DEBUG (18999):
    I/DEBUG (18999): code around lr:
    I/DEBUG (18999): 4e139d50 e3a00001 eaffffdb e1a01009 e1a0000a
    I/DEBUG (18999): 4e139d60 e1a0300b e58d6000 e0229594 ebfbd42b
    I/DEBUG (18999): 4e139d70 eafffff5 e1a01009 e1a0000a e1a0300b
    I/DEBUG (18999): 4e139d80 e58d6000 e0229594 ebfbd456 eaffffee
    I/DEBUG (18999): 4e139d90 0041b1b8 0000c988 e92d40f0 e590303c
    I/DEBUG (18999):
    I/DEBUG (18999): stack:
    I/DEBUG (18999): 341d27bc c1d2deb3
    I/DEBUG (18999): 341d27c0 c18af7d3
    I/DEBUG (18999): 341d27c4 00000000
    I/DEBUG (18999): 341d27c8 00000000
    I/DEBUG (18999): 341d27cc 00000000
    I/DEBUG (18999): 341d27d0 00000000
    I/DEBUG (18999): 341d27d4 00000000
    I/DEBUG (18999): 341d27d8 00000000
    I/DEBUG (18999): 341d27dc 00000000
    I/DEBUG (18999): 341d27e0 00000000
    I/DEBUG (18999): 341d27e4 00000000
    I/DEBUG (18999): 341d27e8 00000000
    I/DEBUG (18999): 341d27ec 00000000
    I/DEBUG (18999): 341d27f0 e3a070ad
    I/DEBUG (18999): 341d27f4 ef9000ad
    I/DEBUG (18999): 341d27f8 00000000
    I/DEBUG (18999): #01 341d27fc 00000020
    I/DEBUG (18999): 341d2800 00000161
    I/DEBUG (18999): 341d2804 00d7b548 [heap]
    I/DEBUG (18999): 341d2808 341d2968
    I/DEBUG (18999): 341d280c 00000002
    I/DEBUG (18999): 341d2810 00d7e170 [heap]
    I/DEBUG (18999): 341d2814 00000000
    I/DEBUG (18999): 341d2818 00000000
    I/DEBUG (18999): 341d281c 00000000
    I/DEBUG (18999): 341d2820 00000000
    I/DEBUG (18999): 341d2824 00000000
    I/DEBUG (18999): 341d2828 00000000
    I/DEBUG (18999): 341d282c 00000000
    I/DEBUG (18999): 341d2830 00000000
    I/DEBUG (18999): 341d2834 00000000
    I/DEBUG (18999): 341d2838 00000000
    I/DEBUG (18999): 341d283c 00000000
    I/DEBUG (18999): 341d2840 00000000
     
  2. PinBender

    PinBender

    Joined:
    Feb 18, 2009
    Posts:
    4
    Is it possible you're accessing a null variable? They're always supposed to be trapped, but I recently discovered that was causing a similar crash in my codebase.
     
  3. svenskefan

    svenskefan

    Joined:
    Nov 26, 2008
    Posts:
    282
    It is possible, but unlikely. I don´t get any errors in the editor, and the very same app works nicely on iOS.
     
  4. madcow64

    madcow64

    Joined:
    Feb 25, 2011
    Posts:
    9
    I'm seeing the exact same thing here. Our (released) iOS game runs fine (even on 3GS) but on Android crashes with this (SIGSEGV) error.
     
  5. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    It's hard to know for sure where it crashed without knowing what version of Unity you are using, and if you are using (non)developement player mode.
    Looking at the callstack it looks like it could be related to a mesh skinning crash we've seen earlier (one that is fixed in the upcoming 3.4 version).

    But, instead of guessing you can actually recreate the callstack with symbols. But beware; it requires some command line magic ;)
    First the prerequisites:

    1. Acquire the Android NDK matching your host environment (Mac OSX or Windows Cygwin).
    2. Make sure you can run the binutils (arm-eabi-objdump et al) provided with the NDK.

    Given the NDK binutils is in your $PATH you can now run this from the command line:

    $ arm-eabi-objdump -d /Applications/Unity/Unity.app/Contents/PlaybackEngines/AndroidDevelopmentPlayer/libs/armeabi-v7a/libunity.so | less

    less is optional but it's an easy way to search the output. Obviously the path is slightly different when trying this under Windows Cygwin. armeabi-v7a matches the device filter (armv7).

    Now we have the I/DEBUG output; make sure you use Development Build when trying to decipher callstacks (the callstack from non-development builds is in most cases useless). Focus on the part starting with #0x:

    (...)
    I/DEBUG (18999): #00 pc 0002eea0 /data/data/se.wormann.egsfc2/lib/libunity.so
    I/DEBUG (18999): #01 pc 00139d6c /data/data/se.wormann.egsfc2/lib/libunity.so
    (...)

    As you can see these addresses (second column from the right) reside in libunity.so. This is the same libunity.so as the one fed to objdump above.

    With less you can now search by hitting '/' (forward slash) followed by the address (without leading zeros), in this case '2eea0'. If you don't have less, or prefer some other means of search/edit you can redirect the output from objdump to a file with > objdump.txt instead of | less.
    Then, if needed, continue with the next entry in the callstack ('139d6c' here).

    It's worth mentioning that in Honeycomb the I/DEBUG callstack is also decorated with the actual symbols, if available. (i.e. this exercise is not really necessary there).

    By studying the assembly code around the particular address, in combination with the register output from I/DEBUG, it's possible to get a very good idea of what the cause of the crash is.
     
    serraki and drydev like this.
  6. madcow64

    madcow64

    Joined:
    Feb 25, 2011
    Posts:
    9
    I think you are correct, the callstack for me resolves to:

    0002eff0 <_s_SkinVertices_NoNormals_VFP_loop>
    00139a50 <_Z13SkinOptimizedIL20TransformInstruction3ELb0ELi1ELb0ELb0EEbR12SkinMeshInfoi>

    So, as follow-up question. When is 3.4 going to be released?
     
  7. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    It's currently in beta; hard to give exact estimates but the beta period is usually a couple of weeks.
     
  8. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    We are not experiencing this issue infact, the App we are porting has NOT skinned mesh inside !
    Please report it so it might be fixed soon (perhaps not in 3.4 but soon enough!)

    Thanks
     
  9. madcow64

    madcow64

    Joined:
    Feb 25, 2011
    Posts:
    9
    Couple of weeks? Our client is not going to like that :(

    But thanks for the swift answer!
     
    Last edited: May 11, 2011
  10. Wozik

    Wozik

    Joined:
    Apr 10, 2009
    Posts:
    662
    madcow64, I think it's possible to add you to the beta list your client doesn't get upset. Please email me to oleg@unity3d.com and get the beta build.
     
  11. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
    Skinning crash, this explains why my Android build just crashes whenever I'm loading an animated character, but not on menus.
    Looking forward to 3.4 !
     
  12. gg67

    gg67

    Joined:
    Jul 26, 2013
    Posts:
    19
    Is there a way to symbolicate Unity Android crash logs with today's newest Unity and NDK? I don't think the steps provided by eriQue work anymore.
     
  13. Mr-Zhou

    Mr-Zhou

    Joined:
    May 4, 2016
    Posts:
    26
    I did like yours,but the objdump.txt isn't what I want, there rae not functions in it. How can i know where the crash occurs?