Unity 2021.3.42f1 Android crash on app pause when recycle command buffer is on

Hello. We are struggling with android crash at Unity 2021.3.42f1 on some devices (adreno). No crashes were found on previous Unity 2021.3.38f1.

Using Il2cpp, URP

Crash seems to encounter if app is set on pause when loading scenes. Unfortunately it is quite difficult to repeat this crash.

2024.08.19 18:39:33.458 16093 16311 Error CRASH *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2024.08.19 18:39:33.458 16093 16311 Error CRASH Version '2021.3.42f1 (f1197811e8ce)', Build type 'Development', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
2024.08.19 18:39:33.458 16093 16311 Error CRASH Build fingerprint: 'POCO/redwood_ru/redwood:13/TKQ1.221114.001/V14.0.4.0.TMSRUXM:user/release-keys'
2024.08.19 18:39:33.458 16093 16311 Error CRASH Revision: '0'
2024.08.19 18:39:33.458 16093 16311 Error CRASH ABI: 'arm64'
2024.08.19 18:39:33.458 16093 16311 Error CRASH Timestamp: 2024-08-19 18:39:33+0300
2024.08.19 18:39:33.458 16093 16311 Error CRASH pid: 16093, tid: 16311, name: UnityGfxDeviceW  >>> ######### <<<
2024.08.19 18:39:33.458 16093 16311 Error CRASH uid: 10551
2024.08.19 18:39:33.458 16093 16311 Error CRASH signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8
2024.08.19 18:39:33.458 16093 16311 Error CRASH Cause: null pointer dereference
2024.08.19 18:39:33.458 16093 16311 Error CRASH     x0  0000000000000000  x1  0000007400d45530  x2  0000000000000000  x3  000000754fdab89d
2024.08.19 18:39:33.458 16093 16311 Error CRASH     x4  0000000000000424  x5  0000000000000006  x6  0000000000000000  x7  0000000000000004
2024.08.19 18:39:33.458 16093 16311 Error CRASH     x8  00000074011e4d18  x9  0000000000000000  x10 0000000000000052  x11 0000000000000000
2024.08.19 18:39:33.458 16093 16311 Error CRASH     x12 0000000000000040  x13 0000000000000040  x14 00000000ffffffff  x15 0000000000000000
2024.08.19 18:39:33.458 16093 16311 Error CRASH     x16 0000007550205208  x17 00000076b7d7725c  x18 00000073efda6000  x19 00000074e0f7d760
2024.08.19 18:39:33.458 16093 16311 Error CRASH     x20 0000007400d45530  x21 0000000000000000  x22 00000074e0c86d70  x23 0000007400d45570
2024.08.19 18:39:33.458 16093 16311 Error CRASH     x24 00000074e03fec20  x25 00000074e0c871d8  x26 0000007400d45570  x27 0000000000000082
2024.08.19 18:39:33.458 16093 16311 Error CRASH     x28 00000074e03f2b20  x29 0000007400d45420
2024.08.19 18:39:33.458 16093 16311 Error CRASH     sp  0000007400d453e0  lr  000000754f586520  pc  00000074011e4d3c
2024.08.19 18:39:33.458 16093 16311 Error CRASH backtrace:
2024.08.19 18:39:33.458 16093 16311 Error CRASH       #00 pc 000000000009ad3c  /vendor/lib64/hw/vulkan.adreno.so (qglinternal::vkCmdBeginRenderPass(VkCommandBuffer_T*, VkRenderPassBeginInfo const*, VkSubpassContents)+36) (BuildId: d1bb5b6dc386ed185cf31b269a76bb70)
2024.08.19 18:39:33.459 16093 16311 Error CRASH       #01 pc 0000000000b0451c  /data/app/~~6choQQ27Z6KwHXfMmMdj6g==/com.drivezone.car.race.game-MxJstkteJiLn1gWXQ5viEA==/lib/arm64/libunity.so (vk::CommandBuffer::BeginRenderPass(VkRenderPassBeginInfo const&, VkSubpassContents)+620) (BuildId: 165d897d1a5b7a4a8ef023ed96e251341e2551c5)
2024.08.19 18:39:33.459 16093 16311 Error CRASH       #02 pc 0000000000b281b4  /data/app/~~6choQQ27Z6KwHXfMmMdj6g==/######-MxJstkteJiLn1gWXQ5viEA==/lib/arm64/libunity.so (vk::RenderPassSwitcher::BeginCurrentRenderPass(vk::CommandBuffer*)+932) (BuildId: 165d897d1a5b7a4a8ef023ed96e251341e2551c5)
2024.08.19 18:39:33.459 16093 16311 Error CRASH       #03 pc 0000000000b28400  /data/app/~~6choQQ27Z6KwHXfMmMdj6g==/######-MxJstkteJiLn1gWXQ5viEA==/lib/arm64/libunity.so (vk::RenderPassSwitcher::InternalApply(vk::CommandBuffer*)+160) (BuildId: 165d897d1a5b7a4a8ef023ed96e251341e2551c5)
2024.08.19 18:39:33.459 16093 16311 Error CRASH       #04 pc 0000000000b595dc  /data/app/~~6choQQ27Z6KwHXfMmMdj6g==/######-MxJstkteJiLn1gWXQ5viEA==/lib/arm64/libunity.so (GfxDeviceVKBase::EnsureCurrentCommandBuffer(vk::CommandBuffer::Type, bool)+312) (BuildId: 165d897d1a5b7a4a8ef023ed96e251341e2551c5)
2024.08.19 18:39:33.459 16093 16311 Error CRASH       #05 pc 0000000000b53c64  /data/app/~~6choQQ27Z6KwHXfMmMdj6g==/######-MxJstkteJiLn1gWXQ5viEA==/lib/arm64/libunity.so (GfxDeviceVK::ClearImpl(GfxClearFlags, ColorRGBAf const*, int, unsigned int, float, unsigned int)+368) (BuildId: 165d897d1a5b7a4a8ef023ed96e251341e2551c5)
2024.08.19 18:39:33.459 16093 16311 Error CRASH       #06 pc 0000000000c8de60  /data/app/~~6choQQ27Z6KwHXfMmMdj6g==/######-MxJstkteJiLn1gWXQ5viEA==/lib/arm64/libunity.so (GfxDeviceWorker::RunCommand(ThreadedStreamBuffer&)+5228) (BuildId: 165d897d1a5b7a4a8ef023ed96e251341e2551c5)
2024.08.19 18:39:33.459 16093 16311 Error CRASH       #07 pc 0000000000c94d44  /data/app/~~6choQQ27Z6KwHXfMmMdj6g==/######-MxJstkteJiLn1gWXQ5viEA==/lib/arm64/libunity.so (GfxDeviceWorker::RunExt(ThreadedStreamBuffer&)+84) (BuildId: 165d897d1a5b7a4a8ef023ed96e251341e2551c5)
2024.08.19 18:39:33.459 16093 16311 Error CRASH       #08 pc 0000000000c94ce4  /data/app/~~6choQQ27Z6KwHXfMmMdj6g==/######-MxJstkteJiLn1gWXQ5viEA==/lib/arm64/libunity.so (GfxDeviceWorker::Run()+140) (BuildId: 165d897d1a5b7a4a8ef023ed96e251341e2551c5)
2024.08.19 18:39:33.459 16093 16311 Error CRASH       #09 pc 0000000000c8c7dc  /data/app/~~6choQQ27Z6KwHXfMmMdj6g==/######-MxJstkteJiLn1gWXQ5viEA==/lib/arm64/libunity.so (GfxDeviceWorker::RunGfxDeviceWorker(void*)+4) (BuildId: 165d897d1a5b7a4a8ef023ed96e251341e2551c5)
2024.08.19 18:39:33.459 16093 16311 Error CRASH       #10 pc 000000000048fff8  /data/app/~~6choQQ27Z6KwHXfMmMdj6g==/######-MxJstkteJiLn1gWXQ5viEA==/lib/arm64/libunity.so (Thread::RunThreadWrapper(void*)+796) (BuildId: 165d897d1a5b7a4a8ef023ed96e251341e2551c5)
2024.08.19 18:39:33.459 16093 16311 Error CRASH       #11 pc 00000000000f55c8  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208) (BuildId: 449f781894033dce6346794a1ee593e0)
2024.08.19 18:39:33.459 16093 16311 Error CRASH       #12 pc 000000000008efbc  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+68) (BuildId: 449f781894033dce6346794a1ee593e0)

After enormous tries and random researches we figured out that main reason of crash is the recycle command buffers setting. To my mind something was broken at last unity 2021 lts versions

2 Likes

Hi,

Did you find any solution to this crash issue?

Unfortunately not. Recycle command buffers is giving great performance boost so it is very disappointing that no decision found :frowning:

New information: after some researches we figured out that crash is comming due to Unity anr watchdog: after 5 sec it is sending app to reload and crash is comming when recycle command buffer option is on. But app is not crashing only reloading. Unfortunatly crash fact is sending to Google play console(

New information: before crash in background we are getting this errors from vulkan before crash

2024.12.18 16:16:51.576 5213 5819 Error BufferQueueProducer [SurfaceView[/com.unity3d.player.UnityPlayerActivityExtension]#4(BLAST Consumer)4](id:145d00000004,api:0,p:-1,c:5213) dequeueBuffer: BufferQueue has been abandoned
2024.12.18 16:16:51.576 5213 5819 Error vulkan dequeueBuffer failed: No such device (-19)
2024.12.18 16:16:51.582 5213 5819 Error BufferQueueProducer [SurfaceView[/com.unity3d.player.UnityPlayerActivityExtension]#4(BLAST Consumer)4](id:145d00000004,api:0,p:-1,c:5213) dequeueBuffer: BufferQueue has been abandoned
2024.12.18 16:16:51.582 5213 5819 Error vulkan dequeueBuffer failed: No such device (-19)
2024.12.18 16:16:51.596 5213 5819 Error BufferQueueProducer [SurfaceView[/com.unity3d.player.UnityPlayerActivityExtension]#4(BLAST Consumer)4](id:145d00000004,api:0,p:-1,c:5213) connect: BufferQueue has been abandoned
2024.12.18 16:16:51.596 5213 5819 Error vulkan native_window_api_connect() failed: No such device (-19)
1 Like

Our further investigation show us that any heavy operation (e.g. loading heavy prefab or resource) can lead to crash when recylce buffer command is on when app is put on pause. In our case it was heavy prefab that was loading between scenes transition but it can be at any time. Unity thread stucked and android system sent ANR. Meanwhile vulkan had some errors with buffers (that ive mentioned above) that lead to crash(

Here is an article how heavy operations on pause can influence on unity behavior