Search Unity

Huge increase of Android Crashes after update to 2019

Discussion in 'Android' started by dsanteugini, Jul 8, 2019.

  1. dsanteugini

    dsanteugini

    Joined:
    Jul 4, 2017
    Posts:
    10
    Hello everyone,

    We were trying to find why we are experimenting a huge number of crashes in our app (in Android) since we update to Unity 2019 version. We are using this:

    Unity 2019.1 (all versions until 1.8)
    and these SDK on their own latest version
    Branch SDK
    Firebase SDK
    Crashalytics
    UniwebView
    DoTween
    GRPC libraries (libgrpc_csharp_ext.so)
    IL2CPP for build

    We are getting the same kind of error on Android 9 + Huawei (mainly) and almost 90% of Android 9 devices has at least one crash like this one:

    Code (CSharp):
    1.  
    2. *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** pid: 0, tid: 0 >>> com.tangelogames.mundijuegos <<< backtrace:
    3.  
    4. #00 pc 000000000082c780 /data/app/com.tangelogames.mundijuegos-3y08jnh9Y4sjKGs3gs1S7g==/lib/arm/libunity.so
    5.  
    6. #01 pc 00000000002baf28 /data/app/com.tangelogames.mundijuegos-3y08jnh9Y4sjKGs3gs1S7g==/lib/arm/libunity.so
    7.  
    8. #02 pc 0000000000019b9c /system/lib/libc.so
    9.  
    10. #03 pc 000000000001d792 /system/lib/libc.so (abort+54)
    11.  
    12. #04 pc 00000000003a00cf /data/app/com.tangelogames.mundijuegos-3y08jnh9Y4sjKGs3gs1S7g==/lib/arm/libil2cpp.so (__gnu_cxx::__verbose_terminate_handler()+226)
    13.  
    14. #05 pc 000000000039c029 /data/app/com.tangelogames.mundijuegos-3y08jnh9Y4sjKGs3gs1S7g==/lib/arm/libil2cpp.so (__cxxabiv1::__terminate(void (*)())+4)
    15.  
    16. #06 pc 000000000039c09d /data/app/com.tangelogames.mundijuegos-3y08jnh9Y4sjKGs3gs1S7g==/lib/arm/libil2cpp.so (std::terminate()+8)
    17.  
    18. #07 pc 000000000039c1c1 /data/app/com.tangelogames.mundijuegos-3y08jnh9Y4sjKGs3gs1S7g==/lib/arm/libil2cpp.so (__cxa_throw+120)
    19.  
    20. #08 pc 000000000035c6f0 /data/app/com.tangelogames.mundijuegos-3y08jnh9Y4sjKGs3gs1S7g==/lib/arm/libil2cpp.so
    21.  
    22. #09 pc 000000000035c5e4 /data/app/com.tangelogames.mundijuegos-3y08jnh9Y4sjKGs3gs1S7g==/lib/arm/libil2cpp.so
    23.  
    24. #10 pc 000000000035a7e0 /data/app/com.tangelogames.mundijuegos-3y08jnh9Y4sjKGs3gs1S7g==/lib/arm/libil2cpp.so
    25.  
    26. #11 pc 0000000000333b68 /data/app/com.tangelogames.mundijuegos-3y08jnh9Y4sjKGs3gs1S7g==/lib/arm/libunity.so
    27.  
    28. #12 pc 00000000002982f0 /data/app/com.tangelogames.mundijuegos-3y08jnh9Y4sjKGs3gs1S7g==/lib/arm/libunity.so
    29.  
    30. #13 pc 0000000000298324 /data/app/com.tangelogames.mundijuegos-3y08jnh9Y4sjKGs3gs1S7g==/lib/arm/libunity.so
    31.   #14  pc 00000000000874cb  /data/app/com.tangelogames.mundijuegos-3y08jnh9Y4sjKGs3gs1S7g==/oat/arm/base.odex (com.unity3d.player.ReflectionHelper.nativeProxyFinalize+98)
    32.   #15  pc 0000000000430375  /system/lib/libart.so (art_quick_invoke_stub_internal+68)
    33.   #16  pc 00000000004092a3  /system/lib/libart.so (art_quick_invoke_static_stub+222)
    34.   #17  pc 00000000000a4913  /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+154)
    35.   #18  pc 00000000001ed6b7  /system/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+230)
    36.   #19  pc 00000000001e8329  /system/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+784)
    37.   #20  pc 0000000000404e17  /system/lib/libart.so (MterpInvokeStatic+130)
    38.   #21  pc 0000000000423314  /system/lib/libart.so (ExecuteMterpImpl+14612)
    39.   #22  pc 0000000000132852  /data/app/com.tangelogames.mundijuegos-3y08jnh9Y4sjKGs3gs1S7g==/oat/arm/base.vdex (com.unity3d.player.ReflectionHelper.a)
    40.   #23  pc 00000000001cccdf  /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.4133397274+354)
    41.   #24  pc 00000000001d1617  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+146)
    42.   #25  pc 00000000001e8313  /system/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+762)
    43.   #26  pc 0000000000404e17  /system/lib/libart.so (MterpInvokeStatic+130)
    44.   #27  pc 0000000000423314  /system/lib/libart.so (ExecuteMterpImpl+14612)
    45.   #28  pc 000000000013275a  /data/app/com.tangelogames.mundijuegos-3y08jnh9Y4sjKGs3gs1S7g==/oat/arm/base.vdex (com.unity3d.player.ReflectionHelper$1.finalize+24)
    46.   #29  pc 00000000001cccdf  /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.4133397274+354)
    47.   #30  pc 00000000001d1563  /system/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+82)
    48.   #31  pc 00000000003f39e3  /system/lib/libart.so (artQuickToInterpreterBridge+882)
    49.   #32  pc 00000000004348ff  /system/lib/libart.so (art_quick_to_interpreter_bridge+30)
    50.   #33  pc 000000000018f9b7  /system/framework/arm/boot-core-libart.oat (java.lang.Daemons$FinalizerDaemon.doFinalize+86)
    51.   #34  pc 000000000018fc13  /system/framework/arm/boot-core-libart.oat (java.lang.Daemons$FinalizerDaemon.runInternal+466)
    52.   #35  pc 000000000012b4a3  /system/framework/arm/boot-core-libart.oat (java.lang.Daemons$Daemon.run+66)
    53.   #36  pc 0000000000270911  /system/framework/arm/boot.oat (java.lang.Thread.run+64)
    54.   #37  pc 0000000000430375  /system/lib/libart.so (art_quick_invoke_stub_internal+68)
    55.   #38  pc 00000000004091a1  /system/lib/libart.so (art_quick_invoke_stub+224)
    56.   #39  pc 00000000000a4901  /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+136)
    57.   #40  pc 0000000000365029  /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+52)
    58.   #41  pc 0000000000365dbd  /system/lib/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+316)
    59.   #42  pc 0000000000387d19  /system/lib/libart.so (art::Thread::CreateCallback(void*)+900)
    60.   #43  pc 0000000000065aa7  /system/lib/libc.so (__pthread_start(void*)+22)
    61.   #44  pc 000000000001e9ad  /system/lib/libc.so (__start_thread+32)
    We are frustrated because we can't understand what is happening. The Symbols file is too big to be uploaded to Google Play (about 450mb) so we can't deobfuscate this crashes.

    Has someone any idea of where we should keep looking for?

    The option of go back to unity 2018 is not possible (due huge number of changes we did for the prefabs and their nested prefabs).

    Thank you very much
     
    dan_ginovker likes this.
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,905
    Hey,

    You don't need to upload symbols to deobfuscate, you just simply pass address like 00000000003a00cf address to addr2line, specify symbol file (in this case libil2cpp.so).

    Note though, depending on your settings different symbol file might be needed (ARM7 or ARM64, Release or Development, mono or il2cpp, Strip Engine code true or false)

    Note: if Strip Engine Code is enabled, the symbols are placed next to apk file, otherwise they're in Unity application folder (for ex., <UnityInstallationFoldeR)\Editor\Data\PlaybackEngines\AndroidPlayer\Variations\il2cpp\Release\Symbols\armeabi-v7a)


    Sadly if you specify incorrect symbol file, there will be no error, the stacktrace simply won't make sense.


    Hope that helps a bit.
     
  3. dsanteugini

    dsanteugini

    Joined:
    Jul 4, 2017
    Posts:
    10
    Hi,

    We have a report desymbolicated. It's always the same report but we are not getting any clear data:

    Code (CSharp):
    1. *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    2. pid: 0, tid: 0 >>> com.tangelogames.mundijuegos <<<
    3.  
    4. backtrace:
    5.   #00  pc 000000000082c780  /data/app/com.tangelogames.mundijuegos-lfarrMGBMuyM5fHqaobSUw==/lib/arm/libunity.so (CrashReporting::Android::SignalHandler(int, siginfo*, void*))
    6.   #01  pc 00000000002baf28  /data/app/com.tangelogames.mundijuegos-lfarrMGBMuyM5fHqaobSUw==/lib/arm/libunity.so (NativeRuntimeException::signal_handler(int, siginfo*, void*))
    7.   #02  pc 0000000000019ab4  /system/lib/libc.so
    8.   #03  pc 000000000001cefa  /system/lib/libc.so (abort+54)
    9.   #04  pc 00000000003a00cf  /data/app/com.tangelogames.mundijuegos-lfarrMGBMuyM5fHqaobSUw==/lib/arm/libil2cpp.so (__gnu_cxx::__verbose_terminate_handler()+226)
    10.   #05  pc 000000000039c029  /data/app/com.tangelogames.mundijuegos-lfarrMGBMuyM5fHqaobSUw==/lib/arm/libil2cpp.so (__cxxabiv1::__terminate(void (*)())+4)
    11.   #06  pc 000000000039c09d  /data/app/com.tangelogames.mundijuegos-lfarrMGBMuyM5fHqaobSUw==/lib/arm/libil2cpp.so (std::terminate()+8)
    12.   #07  pc 000000000039c1c1  /data/app/com.tangelogames.mundijuegos-lfarrMGBMuyM5fHqaobSUw==/lib/arm/libil2cpp.so (__cxa_throw+120)
    13.   #08  pc 000000000035c6f0  /data/app/com.tangelogames.mundijuegos-lfarrMGBMuyM5fHqaobSUw==/lib/arm/libil2cpp.so (il2cpp::vm::TerminateBackgroundThread(void*))
    14.   #09  pc 000000000035c5e4  /data/app/com.tangelogames.mundijuegos-lfarrMGBMuyM5fHqaobSUw==/lib/arm/libil2cpp.so (il2cpp::vm::Thread::Initialize(Il2CppThread*, Il2CppDomain*))
    15.   #10  pc 000000000035a7e0  /data/app/com.tangelogames.mundijuegos-lfarrMGBMuyM5fHqaobSUw==/lib/arm/libil2cpp.so (il2cpp::vm::Thread::Attach(Il2CppDomain*))
    16.   #11  pc 0000000000333b68  /data/app/com.tangelogames.mundijuegos-lfarrMGBMuyM5fHqaobSUw==/lib/arm/libunity.so (scripting_thread_attach(ScriptingDomainPtr))
    17.   #12  pc 00000000002982f0  /data/app/com.tangelogames.mundijuegos-lfarrMGBMuyM5fHqaobSUw==/lib/arm/libunity.so (JavaToScriptingThreadAttach::JavaToScriptingThreadAttach(ScriptingDomainPtr))
    18.   #13  pc 0000000000298324  /data/app/com.tangelogames.mundijuegos-lfarrMGBMuyM5fHqaobSUw==/lib/arm/libunity.so (UnityJavaProxy_finalize(_JNIEnv*, _jobject*, int))
    19.   #14  pc 000000000009d4cb  /data/app/com.tangelogames.mundijuegos-lfarrMGBMuyM5fHqaobSUw==/oat/arm/base.odex (com.unity3d.player.ReflectionHelper.nativeProxyFinalize+98)
    20.   #15  pc 00000000001345b3  /data/app/com.tangelogames.mundijuegos-lfarrMGBMuyM5fHqaobSUw==/oat/arm/base.odex (com.unity3d.player.ReflectionHelper$1.finalize+114)
    21.   #16  pc 000000000014b1a7  /system/framework/arm/boot-core-libart.oat (java.lang.Daemons$FinalizerDaemon.doFinalize+86)
    22.   #17  pc 000000000014b403  /system/framework/arm/boot-core-libart.oat (java.lang.Daemons$FinalizerDaemon.runInternal+466)
    23.   #18  pc 00000000000ef64b  /system/framework/arm/boot-core-libart.oat (java.lang.Daemons$Daemon.run+66)
    24.   #19  pc 0000000000219669  /system/framework/arm/boot.oat (java.lang.Thread.run+64)
    25.   #20  pc 0000000000411375  /system/lib/libart.so (art_quick_invoke_stub_internal+68)
    26.   #21  pc 00000000003ea459  /system/lib/libart.so (art_quick_invoke_stub+224)
    27.   #22  pc 00000000000a1615  /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+136)
    28.   #23  pc 000000000034b0a5  /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+52)
    29.   #24  pc 000000000034bdfd  /system/lib/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+320)
    30.   #25  pc 000000000036d1e3  /system/lib/libart.so (art::Thread::CreateCallback(void*)+866)
    31.   #26  pc 0000000000064949  /system/lib/libc.so (__pthread_start(void*)+140)
     
    Last edited: Jul 8, 2019
  4. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,905
    I assume you can't reproduce it locally? From callstack this seems to occur when Java GC collects the object, and from java object finalizer it seems to want to do something in your script or one of the plugins.

    Without knowing which object is this, it's kind a hard to tell what's wrong, you might want to enable this https://docs.unity3d.com/ScriptReference/AndroidJNIHelper-debug.html to get more information
     
  5. dsanteugini

    dsanteugini

    Joined:
    Jul 4, 2017
    Posts:
    10
    Thanks Tomas. I'll try AndroidJNIHelper-debug.

    On the other side, now we know how to reproduce it. It seems is a problem when the application executes a Application.Quit(). For some reason, part of the resources (or connections or callbacks) are not being disposed.

    Could you please tell me if there is something we should control in this case?

    Regards,
     
  6. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,905
    Application.Quit internally calls native function kill, which instantly kills the app, so there's a chance that some of the Java Object finalizers were not called. You might want to use https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnApplicationQuit.html and call necessary deallocation of resources from there.

    In any case, without debugging this, it's hard to say.
     
  7. alior

    alior

    Joined:
    Sep 6, 2014
    Posts:
    25
    Hi!
    The same is happening even on completely empty project. I reported it but with no luck for now.
     
  8. khanism

    khanism

    Joined:
    Dec 11, 2020
    Posts:
    10
    @alior any update on this ?