Search Unity

Crash in unity native code on Android

Discussion in 'Android' started by Prince_of_Persia, Mar 22, 2019.

  1. Prince_of_Persia

    Prince_of_Persia

    Joined:
    Oct 20, 2012
    Posts:
    56
    Hello.

    I am receiving crash logs from users using Android 4 .
    Using Unity 2017.4.22f1

    It seems it's related to a JNI call but I can't find out why it is crashing and how to fix it :(
    Can anyone please help?

    Code (CSharp):
    1. Fatal Exception: java.lang.Error: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 60749540
    2. Build fingerprint: 'samsung/s3ve3gdsxx/s3ve3gds:4.3/JLS36C/I9300IXXUAND1:user/release-keys'
    3. Revision: '4'
    4. pid: 3289, tid: 8837, name: UnityMain  >>> com.ait.danaword <<<
    5.     r0 00000000  r1 00e5ed74  r2 00004000  r3 dead10cc
    6.     r4 60749540  r5 6026e6a0  r6 00000000  r7 6027af0c
    7.     r8 6221ac70  r9 6027af04  sl 6026e6b0  fp 60749540
    8.     ip 6205d1f8  sp 6221ac30  lr 6122bf1c  pc 61230cd8  cpsr 6221a940
    9.  
    10.        at libunity.002e8cd8(Unknown Source)
    11.        at libunity.002e3f18(Unknown Source)
    12.        at libdvm.dvmPlatformInvoke(dvmPlatformInvoke:112)
    13.        at libdvm.dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)(dvmCallJNIMethod:398)
    14.        at libdvm.0002a020(Unknown Source)
    15.        at libdvm.dvmInterpret(Thread*, Method const*, JValue*)(dvmInterpret:184)
    16.        at libdvm.dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)(dvmCallMethodV:292)
    17.        at libdvm.dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)(dvmCallMethod:20)
    18.        at libdvm.000585fb(Unknown Source)
    19.        at libc.__thread_entry(__thread_entry:72)
    20.        at libc.pthread_create(pthread_create:208)
     
  2. AndyJB_Unity

    AndyJB_Unity

    Unity Technologies

    Joined:
    Apr 2, 2019
    Posts:
    4
    Hi Prince_of_Persia,

    We have determined that the crash has occurred during the processing of an unhandled exception handling a file operation, most likely due to the stack frame being corrupted by some previous operation.

    Unfortunately we cannot determine anything further from the exception data you supplied.

    If you can provide a reproducible case or further details we may be able to provide further guidance. Are you using any native plugins?
     
  3. Prince_of_Persia

    Prince_of_Persia

    Joined:
    Oct 20, 2012
    Posts:
    56
    Hi @AndyJB_Unity ,

    Thanks for your response. I have attached full crash log that I got exported from Crashlytics.

    By native Plugin you mean AAR/JAR? Or do you mean compiled c++ code (.so) ?

    Project does not contain any .so file. However, it uses Fabric Answers , Crashlytics , Unity Ads , Firebase messaging and analytics , Native Share , Unity Deep Links , Chartboost.

    It's worth noting that the crash began to appear when we upgraded from Unity 5.6 to Unity 2017.4.22f1.

    We call PlayerPrefs.Save() when application goes in background. Crashlytics shows that 90% of sessions that crashed were in background. Could this be related?

    Thanks in advance
     
  4. AndyJB_Unity

    AndyJB_Unity

    Unity Technologies

    Joined:
    Apr 2, 2019
    Posts:
    4
    Hi Prince_of_Persia,

    Thank you for the additional information, unfortunately we cannot determine much more from this alone.

    Could you please supply any symbols you have for the build; you should find that you have the symbols zipped up already in the build directory alongside the apk.

    Also if possible could you supply logs for other instances of the crash, that would be very helpful as we will be able to see if there are any patterns.

    Thank You!
     
  5. Prince_of_Persia

    Prince_of_Persia

    Joined:
    Oct 20, 2012
    Posts:
    56
  6. AndyJB_Unity

    AndyJB_Unity

    Unity Technologies

    Joined:
    Apr 2, 2019
    Posts:
    4
    Hi Prince_of_Persia,

    Thank you for those. May I ask, did you have a libunity.sym.so along with those, and if so could you provide it please as it will help confirm our stack trace analysis is on the right track.

    Can you reproduce this error in your own testing, if so could we have a reproduction project to examine?

    Thanks.
     
  7. Prince_of_Persia

    Prince_of_Persia

    Joined:
    Oct 20, 2012
    Posts:
    56
    @AndyJB_Unity , Thanks for your response.

    Do you mean the libunity.sym.so that is in the installation folder of Unity ? My Unity version is Unity 2017.4.22f1. But if you would like to have it , let me know to upload it somewhere.

    Unfortunately we are not able to reproduce the issue on our own devices. We are getting this from Crashlytics reports.

    I can however, upload the Apk file for you if it can help.