Android crash on Unity 2022.3.31f1

Does anyone have any idea about this crash?

We got a crash in live product, this crash make up 3% of crashing users in android platform.

We set code strip medium, enable stripEngine code, Can anyone help us?

SIGSEGV
backtrace:
  #00  pc 0x00000000005860a8  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/lib/arm64/libunity.so (core::hash_set<core::pair<core::basic_string<char, core::StringStorageDefault<char>> const, int, true>, core::hash_pair<core::hash<core::basic_string<char, core::StringStorageDefault<char>>>, core::basic_string<char, core::StringStorageDefault<char>>, int>, core::equal_pair<std::__ndk1::equal_to<core::basic_string<char, core::StringStorageDefault<char>>>, core::basic_string<char, core::StringStorageDefault<char>>, int>>::node* core::hash_set<core::pair<core::basic_string<char, core::StringStorageDefault<char>> const, int, true>, core::hash_pair<core::hash<core::basic_string<char, core::StringStorageDefault<char>>>, core::basic_string<char, core::StringStorageDefault<char>>, int>, core::equal_pair<std::__ndk1::equal_to<core::basic_string<char, core::StringStorageDefault<char>>>, core::basic_string<char, core::StringStorageDefault<char>>, int>>::lookup<core::basic_string<char, core::StringStorageDefault<char>>, core::equal_pair<std::__ndk1::equal_to<core::basic_string<char, core::StringStorageDefault<char>>>, core::basic_string<char, core::StringStorageDefault<char>>, int>>(core::basic_string<char, core::StringStorageDefault<char>> const&, core::equal_pair<std::__ndk1::equal_to<core::basic_string<char, core::StringStorageDefault<char>>>, core::basic_string<char, core::StringStorageDefault<char>>, int> const&) const) (BuildId: 94baa5566c44ca02)
  #01  pc 0x0000000000582990  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/lib/arm64/libunity.so (core::base_hash_map<core::basic_string<char, core::StringStorageDefault<char>>, int, core::hash<core::basic_string<char, core::StringStorageDefault<char>>>, std::__ndk1::equal_to<core::basic_string<char, core::StringStorageDefault<char>>>>::find(core::basic_string<char, core::StringStorageDefault<char>> const&)) (BuildId: 94baa5566c44ca02)
  #02  pc 0x00000000006da1e8  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/lib/arm64/libunity.so (MonoManager::GetScriptingClass(char const*, char const*, char const*)) (BuildId: 94baa5566c44ca02)
  #03  pc 0x00000000006cd794  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/lib/arm64/libunity.so (OptionalType(char const*, char const*, char const*)) (BuildId: 94baa5566c44ca02)
  #04  pc 0x000000000079a7bc  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/lib/arm64/libunity.so (Scripting::UnityEngine::RaycastHit2DProxy::CleanupProxy()) (BuildId: 94baa5566c44ca02)
  #05  pc 0x000000000078c52c  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/lib/arm64/libunity.so (GetCoreScriptingClassesPtr()) (BuildId: 94baa5566c44ca02)
  #06  pc 0x000000000078b964  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/lib/arm64/libunity.so (GetCoreScriptingClasses()) (BuildId: 94baa5566c44ca02)
  #07  pc 0x00000000006aa0dc  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/lib/arm64/libunity.so (Resources_Bindings::UnloadUnusedAssets()) (BuildId: 94baa5566c44ca02)
  #08  pc 0x0000000008b26590  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/lib/arm64/libil2cpp.so (RuntimeContentManager_Cleanup_m6436DF58ED05204D0A7DFACFB212018BD6B813FD+16241) (BuildId: 5b60086293cdd3e45cecd07f386d4a79c6a1bcec)
  #09  pc 0x0000000008b271a8  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/lib/arm64/libil2cpp.so (RuntimeContentManager_OnShutdown_m09B1F0AD37BE7168472DDB84F55C43F02CD40113+15735) (BuildId: 5b60086293cdd3e45cecd07f386d4a79c6a1bcec)
  #10  pc 0x0000000008279e28  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/lib/arm64/libil2cpp.so (EventHandler_Invoke_m9D3126CBE291A3E7E7C304094E1DA846832F9B96_Multicast(EventHandler_tC6323FD7E6163F965259C33D72612C0E5B9BAB82*, Il2CppObject*, EventArgs_t37273F03EAC87217701DD431B190FBD84AD7C377*, MethodInfo const*)+11390) (BuildId: 5b60086293cdd3e45cecd07f386d4a79c6a1bcec)
  #11  pc 0x000000000912660c  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/lib/arm64/libil2cpp.so (il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**)+608) (BuildId: 5b60086293cdd3e45cecd07f386d4a79c6a1bcec)
  #12  pc 0x0000000009126558  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/lib/arm64/libil2cpp.so (il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**)+594) (BuildId: 5b60086293cdd3e45cecd07f386d4a79c6a1bcec)
  #13  pc 0x0000000009126354  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/lib/arm64/libil2cpp.so (il2cpp::vm::Runtime::Shutdown()+579) (BuildId: 5b60086293cdd3e45cecd07f386d4a79c6a1bcec)
  #14  pc 0x00000000006da514  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/lib/arm64/libunity.so (CleanupIl2Cpp()) (BuildId: 94baa5566c44ca02)
  #15  pc 0x00000000005d5f3c  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/lib/arm64/libunity.so (PlayerCleanup(bool)) (BuildId: 94baa5566c44ca02)
  #16  pc 0x000000000075eed4  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/lib/arm64/libunity.so (UnityDeinitApplication()) (BuildId: 94baa5566c44ca02)
  #17  pc 0x00000000007763a4  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/lib/arm64/libunity.so (nativeDone(_JNIEnv*, _jobject*)) (BuildId: 94baa5566c44ca02)
  #18  pc 0x000000000038e5a0  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+112)
  #19  pc 0x000000000077f820  /apex/com.android.art/lib64/libart.so (nterp_helper+4016)
  #20  pc 0x000000000117945c  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/oat/arm64/base.vdex (com.unity3d.player.UnityPlayer.shutdown)
  #21  pc 0x000000000077f7c4  /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
  #22  pc 0x0000000001178360  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/oat/arm64/base.vdex (com.unity3d.player.UnityPlayer.-$$Nest$mshutdown)
  #23  pc 0x000000000077e8a4  /apex/com.android.art/lib64/libart.so (nterp_helper+52)
  #24  pc 0x0000000001176fd0  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/oat/arm64/base.vdex (com.unity3d.player.UnityPlayer$y.run+4)
  #25  pc 0x0000000000a65944  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Handler.dispatchMessage+68)
  #26  pc 0x0000000000a69544  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Looper.loopOnce+980)
  #27  pc 0x0000000000a690d4  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Looper.loop+916)
  #28  pc 0x0000000000358ee8  /data/app/~~kzQ6jOL6xgDf6PArEHwajw==/com.xxx.xxx-3LQjKvlZzFW1VDVj0LdnXQ==/oat/arm64/base.odex (com.unity3d.player.UnityPlayer$F.run+616)
  #29  pc 0x0000000000362774  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612)
  #30  pc 0x000000000034def0  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+132)
  #31  pc 0x0000000000943e28  /apex/com.android.art/lib64/libart.so (art::detail::ShortyTraits<(char)86>::Type art::ArtMethod::InvokeInstance<(char)86>(art::Thread*, art::ObjPtr<art::mirror::Object>, art::detail::ShortyTraits<>::Type...)+60)
  #32  pc 0x000000000063ebd4  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1344)
  #33  pc 0x000000000063e684  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallbackWithUffdGc(void*)+8)
  #34  pc 0x0000000000101d0c  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+204)
  #35  pc 0x0000000000095ae0  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

According to log this happens, during application quit. Do you by chance call Application.Quit somewhere? If so, you could try to reproduce this locally, but doing an automated step:

  • Launch app
  • Call Application.Quit
  • Scan log for a crash
  • Repeat 100 times

If it’s reproducible, you can report a bug to Unity about this issue.

Thank you for your response! I’ll test it today.
Would calling Resources::UnloadUnusedAssets on onApplicationQuit, setting the engine code strip disabled or strippinglevel to low resolve this crash?

If not, could you identify the stripped type causing the crash from the stack trace? I could potentially preserve it with link.xml.