My app will crash after quick finish my UnityActivity.
I got the libunity.so in this path:unity_workspace_2021020202\Temp\StagingArea\libs\armeabi-v7a\libunity.so
Use arm-linux-androideabi-addr2line -f -C -e libunity.so 004c51ec to decode method.
Should i use this’s folder’s so
\2020.3.4f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\Variations\il2cpp\Development\Symbols\armeabi-v7a\libunity.sym.so?
I export the project with “Development Build”, So i choose
2020.3.4f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\Variations\il2cpp\Development\Symbols\armeabi-v7a\
for Android Logcat Settings, It resolves the stack like below.
04-26 10:32:54.336 17609 17609 I crash_dump32: performing dump of process 17499 (target tid = 17583)
04-26 10:32:54.337 17609 17609 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-26 10:32:54.337 17609 17609 F DEBUG : Build fingerprint:
04-26 10:32:54.337 17609 17609 F DEBUG : Revision: ‘0’
04-26 10:32:54.337 17609 17609 F DEBUG : ABI: ‘arm’
04-26 10:32:54.337 17609 17609 F DEBUG : pid: 17499, tid: 17583, name: Filter1 >>> com.test <<<
04-26 10:32:54.337 17609 17609 F DEBUG : signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 0x8e8c51ec
04-26 10:32:54.337 17609 17609 F DEBUG : r0 7fc02918 r1 00000000 r2 3d366d27 r3 00001223
04-26 10:32:54.337 17609 17609 F DEBUG : r4 8a032ea0 r5 8a032ed0 r6 8a032eb8 r7 7fc028d0
04-26 10:32:54.337 17609 17609 F DEBUG : r8 0026b945 r9 8a032ed0 sl 00001223 fp 8a032ec8
04-26 10:32:54.337 17609 17609 F DEBUG : ip 7fc028a8 sp 7fc028b0 lr 8eef8d7f pc 8e8c51ec cpsr 600d0030
04-26 10:32:54.348 17609 17609 F DEBUG :
04-26 10:32:54.348 17609 17609 F DEBUG : backtrace:
04-26 10:32:54.349 17609 17609 F DEBUG : #00 pc 004c51ec (SuiteAsyncReadManagerThreadedkUnitTestCategory::TestWhenValidBatchReadIsIssued_ReturnsSuccess::RunImpl() const at ??:?) /data/app/com.test-9YLw88uq7h7gzR5ztJbyEg==/lib/arm/libunity.so
04-26 10:32:54.349 17609 17609 F DEBUG : #01 pc 00af8d7b (void std::__ndk1::__sort<std::__ndk1::__less<KeyframeTpl, KeyframeTpl >&, KeyframeTpl>(KeyframeTpl, KeyframeTpl, std::__ndk1::__less<KeyframeTpl, KeyframeTpl >&) at ??:?) /data/app/com.test-9YLw88uq7h7gzR5ztJbyEg==/lib/arm/libunity.so
04-26 10:32:54.349 17609 17609 F DEBUG : #02 pc 007fdf61 (void InitializeTransferFunctionScriptingTraitsFor(TransferFunctionScriptingTraits&) at ??:?) /data/app/com.test-9YLw88uq7h7gzR5ztJbyEg==/lib/arm/libunity.so
04-26 10:32:54.349 17609 17609 F DEBUG : #03 pc 00046e53 (libc.so not found) /system/lib/libc.so (__pthread_start(void)+22)
04-26 10:32:54.349 17609 17609 F DEBUG : #04 pc 0001ad15 (libc.so not found) /system/lib/libc.so (__start_thread+32)
I disable Strip Engine Code,
keep the android logcat set to be below.
2020.3.4f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\Variations\il2cpp\Development\Symbols\armeabi-v7a\
Got underline stack
04-27 20:31:39.101 27900 27900 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-27 20:31:39.101 27900 27900 F DEBUG : Build fingerprint
04-27 20:31:39.101 27900 27900 F DEBUG : Revision: ‘0’
04-27 20:31:39.101 27900 27900 F DEBUG : ABI: ‘arm’
04-27 20:31:39.101 27900 27900 F DEBUG : pid: 27792, tid: 27876, name: Filter0 >>> com.test <<<
04-27 20:31:39.101 27900 27900 F DEBUG : signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 0x8db52878
04-27 20:31:39.101 27900 27900 F DEBUG : r0 7f1ff918 r1 00000000 r2 b6e0f754 r3 00003196
04-27 20:31:39.101 27900 27900 F DEBUG : r4 8a031b80 r5 8a031bb0 r6 8a031b98 r7 7f1ff8d0
04-27 20:31:39.101 27900 27900 F DEBUG : r8 002cb66e r9 8a031bb0 sl 00003196 fp 8a031ba8
04-27 20:31:39.102 27900 27900 F DEBUG : ip 7f1ff8a8 sp 7f1ff8b0 lr 8eb40eeb pc 8db52878 cpsr 600d0030
04-27 20:31:39.112 27900 27900 F DEBUG :
04-27 20:31:39.112 27900 27900 F DEBUG : backtrace:
04-27 20:31:39.112 27900 27900 F DEBUG : #00 pc 00179878 (std::__ndk1::error_category::~error_category() at ??:?) /data/app/com.test-2IqTPy_Ku9fkuFr2RnWlkQ==/lib/arm/libunity.so
04-27 20:31:39.112 27900 27900 F DEBUG : #01 pc 01167ee9 (swappy::ChoreographerFilter::threadMain(bool, int) at ??:?) /data/app/com.test-2IqTPy_Ku9fkuFr2RnWlkQ==/lib/arm/libunity.so
04-27 20:31:39.112 27900 27900 F DEBUG : #02 pc 0116cb57 (void* std::__ndk1::__thread_proxy<std::__ndk1::tuple<std::__ndk1::unique_ptr<std::__ndk1::__thread_struct, std::__ndk1::default_deletestd::__ndk1::__thread_struct >, std::__ndk1::function<void ()> > >(void*) at ??:?) /data/app/com.test-2IqTPy_Ku9fkuFr2RnWlkQ==/lib/arm/libunity.so
04-27 20:31:39.112 27900 27900 F DEBUG : #03 pc 00046e53 (libc.so not found) /system/lib/libc.so (__pthread_start(void*)+22)
04-27 20:31:39.112 27900 27900 F DEBUG : #04 pc 0001ad15 (libc.so not found) /system/lib/libc.so (__start_thread+32)
I disable the Optimized Frame Pacing, try 62 times, this native_crash did not occur。 I am not sure whether this fixed the problem. Seems the problem did not occur every time while i quick leave my UnityActivity。 I’ll run monkey to test this change。
But,What will cause this native crash? Is there any way that i can find the reason.
Hi Tomas1856:
If the Strip Engine Code is enable, which symbol should i use?
(1)Temp/StagingArea/libs/armeabi-v7a/libunity.so
(2)Temp/StagingArea/symbols/armeabi-v7a/libunity.so
If use (1), i got the crash stack like this,but I have disable “Optimized Frame Pacing” :
05-25 10:26:28.856 20639 20657 E CRASH : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-25 10:26:28.856 20639 20657 E CRASH : Version ‘2020.3.4f1c1 (3d27070cb163)’, Build type ‘Release’, Scripting Backend ‘il2cpp’, CPU ‘armeabi-v7a’
05-25 10:26:28.856 20639 20657 E CRASH : Build fingerprint:
05-25 10:26:28.856 20639 20657 E CRASH : Revision: ‘0’
05-25 10:26:28.856 20639 20657 E CRASH : ABI: ‘arm’
05-25 10:26:28.856 20639 20657 E CRASH : Timestamp: 2021-05-25 10:26:28+0800
05-25 10:26:28.856 20639 20657 E CRASH : pid: 20639, tid: 20657, name: UnityMain >>> com.laurel.unity3dapp <<<
05-25 10:26:28.856 20639 20657 E CRASH : uid: 10079
05-25 10:26:28.856 20639 20657 E CRASH : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
05-25 10:26:28.856 20639 20657 E CRASH : Cause: null pointer dereference
05-25 10:26:28.856 20639 20657 E CRASH : r0 00000000 r1 89f7220c r2 00000041 r3 80000000
05-25 10:26:28.856 20639 20657 E CRASH : r4 86bd8da8 r5 86bd9154 r6 86254170 r7 88e65738
05-25 10:26:28.856 20639 20657 E CRASH : r8 86bd8da8 r9 86bd6ac0 r10 88e65738 r11 88e661dc
05-25 10:26:28.856 20639 20657 E CRASH : ip a6a9cd98 sp 88e656e8 lr 898bf3c0 pc 89814904
05-25 10:26:28.856 20639 20657 E CRASH :
05-25 10:26:28.856 20639 20657 E CRASH : backtrace:
05-25 10:26:28.856 20639 20657 E CRASH : #00 pc 0017e904 (UnitySendMessage at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.857 20639 20657 E CRASH : #01 pc 002293bc (JNI_OnUnload at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.857 20639 20657 E CRASH : #02 pc 00229018 (JNI_OnUnload at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.857 20639 20657 E CRASH : #03 pc 00216c00 (JNI_OnUnload at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.857 20639 20657 E CRASH : #04 pc 00216020 (JNI_OnUnload at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.857 20639 20657 E CRASH : #05 pc 004bfc97 (JNI_OnUnload at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.857 20639 20657 E CRASH : #06 pc 0039d1dc (JNI_OnUnload at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.857 20639 20657 E CRASH : #07 pc 0039d480 (JNI_OnUnload at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.858 20639 20657 E CRASH : #08 pc 001ff457 (UnitySwappy_injectTracer at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.858 20639 20657 E CRASH : #09 pc 001f1111 (UnitySwappy_injectTracer at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.858 20639 20657 E CRASH : #10 pc 001f1c09 (UnitySwappy_injectTracer at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.858 20639 20657 E CRASH : #11 pc 00200c91 (UnitySwappy_injectTracer at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
If use (2), the crash stack will be:
05-25 10:26:28.856 20639 20657 E CRASH : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-25 10:26:28.856 20639 20657 E CRASH : Version ‘2020.3.4f1c1 (3d27070cb163)’, Build type ‘Release’, Scripting Backend ‘il2cpp’, CPU ‘armeabi-v7a’
05-25 10:26:28.856 20639 20657 E CRASH : Build fingerprint:
05-25 10:26:28.856 20639 20657 E CRASH : Revision: ‘0’
05-25 10:26:28.856 20639 20657 E CRASH : ABI: ‘arm’
05-25 10:26:28.856 20639 20657 E CRASH : Timestamp: 2021-05-25 10:26:28+0800
05-25 10:26:28.856 20639 20657 E CRASH : pid: 20639, tid: 20657, name: UnityMain >>> com.laurel.unity3dapp <<<
05-25 10:26:28.856 20639 20657 E CRASH : uid: 10079
05-25 10:26:28.856 20639 20657 E CRASH : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
05-25 10:26:28.856 20639 20657 E CRASH : Cause: null pointer dereference
05-25 10:26:28.856 20639 20657 E CRASH : r0 00000000 r1 89f7220c r2 00000041 r3 80000000
05-25 10:26:28.856 20639 20657 E CRASH : r4 86bd8da8 r5 86bd9154 r6 86254170 r7 88e65738
05-25 10:26:28.856 20639 20657 E CRASH : r8 86bd8da8 r9 86bd6ac0 r10 88e65738 r11 88e661dc
05-25 10:26:28.856 20639 20657 E CRASH : ip a6a9cd98 sp 88e656e8 lr 898bf3c0 pc 89814904
05-25 10:26:28.856 20639 20657 E CRASH :
05-25 10:26:28.856 20639 20657 E CRASH : backtrace:
05-25 10:26:28.856 20639 20657 E CRASH : #00 pc 0017e904 (StringToInt(core::basic_string_ref) at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.857 20639 20657 E CRASH : #01 pc 002293bc (gles::InitCaps(ApiGLES*, GraphicsCaps*, GfxDeviceLevelGL&, dynamic_array<core::basic_string_ref, 0u> const&) at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.857 20639 20657 E CRASH : #02 pc 00229018 (gles::InitCaps(ApiGLES*, GraphicsCaps*, GfxDeviceLevelGL&, dynamic_array<core::basic_string_ref, 0u> const&) at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.857 20639 20657 E CRASH : #03 pc 00216c00 (gles::CreateDepthState(DeviceStateGLES&, GfxDepthState) at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.857 20639 20657 E CRASH : #04 pc 00216020 (GfxDeviceGLES::GfxDeviceGLES(MemLabelId) at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.857 20639 20657 E CRASH : #05 pc 004bfc97 (GfxDeviceClient::~GfxDeviceClient() at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.857 20639 20657 E CRASH : #06 pc 0039d1dc (GfxDeviceStats::GfxDeviceStats(MemLabelId) at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.857 20639 20657 E CRASH : #07 pc 0039d480 (GfxDeviceStats::GfxDeviceStats(MemLabelId) at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.858 20639 20657 E CRASH : #08 pc 001ff457 (PlatformThread::Yield() at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.858 20639 20657 E CRASH : #09 pc 001f1111 (MountObbs() at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.858 20639 20657 E CRASH : #10 pc 001f1c09 (InitJni(_JavaVM*, _jobject*, _jobject*) at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
05-25 10:26:28.858 20639 20657 E CRASH : #11 pc 00200c91 (nativeSetLaunchURL(_JNIEnv*, _jobject*, _jstring*) at ??:?) /data/app/LaurelUnityApp/lib/arm/libunity.so (BuildId: 3eaea97115ffc288d1ba44cb444e63b5b18ca49f)
You should always enable that, just in case. If strip engine code is on, libunity.so symbols will be in that zip. But libil2pp.so symbols will be always in that zip, not depending on Strip Engine Code option