Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Bug App crashing on Quest 2 shortly after launch

Discussion in 'VR' started by Bovine, Jan 26, 2023.

  1. Bovine

    Bovine

    Joined:
    Oct 13, 2010
    Posts:
    195
    Hi There

    I am getting the app crashing consistently within a few seconds of launching with the following callstack:

    upload_2023-1-26_8-34-13.png

    presumably the memcpy is hitting memory the app does not own:

    2023/01/26 08:28:44.416 5416 5476 Error CRASH #00 pc 0005c64c /apex/com.android.runtime/lib/bionic/libc.so (__memcpy_base_a55+340) (BuildId: adcfc534098235ba5d6501ea7c144148)

    or the address is bogus. I'm not familiar with debugging such a crash, so a bit lost as to how to proceed. It also looks from the callstack to be coming from GfxDeviceGLES::DrawBuffersBatchMode() so it feels more like this is a Unity issue rather than something I am doing.

    SIGSEGV looks like a buffer overrun or bogus pointer:

    https://www.geeksforgeeks.org/segmentation-fault-sigsegv-vs-bus-error-sigbus/

    I am using Unity 2022.2.0b16.112.5806. It did at one point seem to be related to il2cpp usage but I think the crash is quite random.

    I am using a compute shader but if I turn off updating this, then the crash still occurs. I am also using point light shadows, I might turn that off also to see if things persist, but I do find with intermitent crashes that changing somethng can just impact the frequency of crash rather than be the root cause.

    Any suggestions would be appreciated as the crashing has become so bad now, that I am unable to run on the device.

    Cheers
    Ian H
     
    dchen05 likes this.
  2. dchen05

    dchen05

    Joined:
    Aug 28, 2012
    Posts:
    45
    We have been experiencing this exact bug since we upgraded to from 2021 to 2022. Also on Quest 2. The random nature of the crash has been driving the team nuts and is really hard to pin down.

    Unity 2022.2.2 using OpenGLES3


    Code (CSharp):
    1. 01-25 14:21:29.952   834   834 I /system/bin/tombstoned: received crash request for pid 9628
    2. 01-25 14:21:29.952  9831  9831 I crash_dump64: performing dump of process 9554 (target tid = 9628)
    3. 01-25 14:21:29.958  9831  9831 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    4. 01-25 14:21:29.958  9831  9831 F DEBUG   : Build fingerprint: 'oculus/hollywood/hollywood:10/QQ3A.200805.001/49882890192000150:user/release-keys'
    5. 01-25 14:21:29.958  9831  9831 F DEBUG   : Revision: '0'
    6. 01-25 14:21:29.958  9831  9831 F DEBUG   : ABI: 'arm64'
    7. 01-25 14:21:29.958  9831  9831 F DEBUG   : Timestamp: 2023-01-25 14:21:29-0500
    8. 01-25 14:21:29.958  9831  9831 F DEBUG   : pid: 9554, tid: 9628, name: Thread-3  >>> com.normalvr.nock <<<
    9. 01-25 14:21:29.958  9831  9831 F DEBUG   : uid: 10448
    10. 01-25 14:21:29.958  9831  9831 F DEBUG   : signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x7970400000
    11. 01-25 14:21:29.958  9831  9831 F DEBUG   :     x0  00000078e5c6c000  x1  00000079703fffc0  x2  0000000000000060  x3  00000078e5c6c200
    12. 01-25 14:21:29.958  9831  9831 F DEBUG   :     x4  0000007970400070  x5  00000078e5c6c2b0  x6  0000000000000000  x7  0201000f00000027
    13. 01-25 14:21:29.958  9831  9831 F DEBUG   :     x8  000000000000004d  x9  ffffffffffc00028  x10 0000000000000001  x11 0000000000000000
    14. 01-25 14:21:29.958  9831  9831 F DEBUG   :     x12 0000000000000000  x13 ffffffffffc000e5  x14 0000000000000000  x15 0000000000000000
    15. 01-25 14:21:29.958  9831  9831 F DEBUG   :     x16 0000007a695aaf48  x17 0000007b5403dec0  x18 000000798f9fa000  x19 0000000000000020
    16. 01-25 14:21:29.959  9831  9831 F DEBUG   :     x20 0000007a11bf81c0  x21 000000000000000a  x22 00000079703ffdc0  x23 00000078e5c6c000
    17. 01-25 14:21:29.959  9831  9831 F DEBUG   :     x24 00000000000002b0  x25 0000007a10cb72e0  x26 00000000000002b0  x27 00000079e1b55050
    18. 01-25 14:21:29.959  9831  9831 F DEBUG   :     x28 00000079b0c60aa0  x29 00000000000000a0
    19. 01-25 14:21:29.959  9831  9831 F DEBUG   :     sp  00000079b0c607a0  lr  0000007a68d20e48  pc  0000007b5403de7c
    20. 01-25 14:21:29.959  9831  9831 F DEBUG   :
    21. 01-25 14:21:29.959  9831  9831 F DEBUG   : backtrace:
    22. 01-25 14:21:29.959  9831  9831 F DEBUG   :       #00 pc 000000000007de7c (libc.so not found)  /apex/com.android.runtime/lib64/bionic/libc.so (__memcpy+300) (BuildId: 76160b7be02961a2e357c92bde57eb19)
    23. 01-25 14:21:29.959  9831  9831 F DEBUG   :       #01 pc 0000000000ee6e44 (GfxDeviceGLES::DrawBuffersBatchMode(GfxBatchHeader const&) at ??:0)  /data/app/com.normalvr.nock-hbSbiBnl1PtVwFKJfSNWEg==/lib/arm64/libunity.so (BuildId: e6b45d116bc2fadb)
    24. 01-25 14:21:29.959  9831  9831 F DEBUG   :       #02 pc 00000000010a3ddc (GfxDeviceWorker::RunCommand(ThreadedStreamBuffer&) at ??:0)  /data/app/com.normalvr.nock-hbSbiBnl1PtVwFKJfSNWEg==/lib/arm64/libunity.so (BuildId: e6b45d116bc2fadb)
    25. 01-25 14:21:29.959  9831  9831 F DEBUG   :       #03 pc 000000000109c658 (GfxDeviceWorker::RunExt(ThreadedStreamBuffer&) at ??:0)  /data/app/com.normalvr.nock-hbSbiBnl1PtVwFKJfSNWEg==/lib/arm64/libunity.so (BuildId: e6b45d116bc2fadb)
    26. 01-25 14:21:29.959  9831  9831 F DEBUG   :       #04 pc 000000000109c3d0 (GfxDeviceWorker::RunGfxDeviceWorker(void*) at ??:0)  /data/app/com.normalvr.nock-hbSbiBnl1PtVwFKJfSNWEg==/lib/arm64/libunity.so (BuildId: e6b45d116bc2fadb)
    27. 01-25 14:21:29.959  9831  9831 F DEBUG   :       #05 pc 00000000008b1aa8 (Thread::RunThreadWrapper(void*) at ??:0)  /data/app/com.normalvr.nock-hbSbiBnl1PtVwFKJfSNWEg==/lib/arm64/libunity.so (BuildId: e6b45d116bc2fadb)
    28. 01-25 14:21:29.960  9831  9831 F DEBUG   :       #06 pc 00000000000d5c44 (libc.so not found)  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: 76160b7be02961a2e357c92bde57eb19)
    29. 01-25 14:21:29.960  9831  9831 F DEBUG   :       #07 pc 0000000000082fe4 (libc.so not found)  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 76160b7be02961a2e357c92bde57eb19)
    30. 01-25 14:21:30.013  9554  9663 I VrApi   : FPS=88/90,Prd=30ms,Tear=0,Early=0,Stale=1,Stale2/5/10/max=0/0/0/0,VSnc=0,Lat=-1,Fov=0,CPU4/GPU=4/3,1478/490MHz,OC=FF,TA=0/0/0,SP=N/N/N,Mem=2092MHz,Free=1270MB,PLS=0,Temp=28.2C/0.0C,TW=0.78ms,App=6.67ms,GD=0.00ms,CPU&GPU=13.19ms,LCnt=1(DR90,LM0),GPU%=0.70,CPU%=0.27(W0.33),DSF=1.00,CFL=14.65/20.04
    31. 01-25 14:21:30.866  1056  9835 W ActivityTaskManager:   Force finishing activity com.normalvr.nock/com.unity3d.player.UnityPlayerActivity
    32. 01-25 14:21:30.866  1056  9836 I DropBoxManagerService: add tag=data_app_native_crash isTagEnabled=true flags=0x2
    33. 01-25 14:21:30.870   834   834 E /system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_05
     

    Attached Files:

  3. Bovine

    Bovine

    Joined:
    Oct 13, 2010
    Posts:
    195
    Yeah it has become much, much worse recently for no reasons I can think of and pretty much testing on the device is not possible now.

    I think I will raise a bug. I do have one thing to try but I am pretty convinced it isn't that... :(
     
  4. Bovine

    Bovine

    Joined:
    Oct 13, 2010
    Posts:
    195
    I note that Vulkan seems to be crash free, not too surprisingly. I am not convinced the performance is as good, however. I do have some issues with my compute shader mind on Vulkan, so need to dig into that :/
     
  5. dchen05

    dchen05

    Joined:
    Aug 28, 2012
    Posts:
    45
    Vulkan is crash free over here as well, but agreed performance is not the same at all :/

    We will update this thread if we find any solutions.
     
    Bovine likes this.
  6. Bovine

    Bovine

    Joined:
    Oct 13, 2010
    Posts:
    195
    That would be appreciated. I managed to refactor the computer shader to remove branches and it appears to work now on Vulkan. I am getting a crash after a time, no callstack yet but I think something is leaking
     
  7. florianpenzkofer

    florianpenzkofer

    Unity Technologies

    Joined:
    Sep 2, 2014
    Posts:
    479
    We worked around an Adreno driver issue to fix a crash (https://issuetracker.unity3d.com/is...-devices-when-using-shader-with-mixed-stencil) a couple months ago. The callstack looks similar.
    The assumption was that the problem only occurs when D32_SFloat_S8_UInt format is used (instead of Depth24/Stencil8).
    Can you check if you are using that format?

    The fix we made was to treat the format as unsupported for specific driver versions and to completely disable its use in URP for Android platforms.
     
  8. mxweas

    mxweas

    Joined:
    Nov 4, 2015
    Posts:
    15
    We're still seeing this issue in Unity 2022.2.2f1. Do you all know when a fix would land?

    Max
     
  9. Bovine

    Bovine

    Joined:
    Oct 13, 2010
    Posts:
    195
    I can check the depth buffer. Stencil isn't being used.

    Cheets
     
  10. florianpenzkofer

    florianpenzkofer

    Unity Technologies

    Joined:
    Sep 2, 2014
    Posts:
    479
    The fix for the issue I mentioned above already landed.
    It could be that it didn't address the root cause of the issue, or it's a different bug altogether.
     
  11. mxweas

    mxweas

    Joined:
    Nov 4, 2015
    Posts:
    15
    I believe it's a different bug. URP is hardcoded to D24 / S8 on Android
     
  12. florianpenzkofer

    florianpenzkofer

    Unity Technologies

    Joined:
    Sep 2, 2014
    Posts:
    479
    Can anyone please create a bug report with repro project for the crash on Quest 2?
     
  13. mxweas

    mxweas

    Joined:
    Nov 4, 2015
    Posts:
    15
    I've filed bug IN-34014 for this crash.

    Max
     
  14. v-fox

    v-fox

    Joined:
    Jun 5, 2020
    Posts:
    4
    I'd like to add that I've got the same issue on an Android phone (Pixel 6), Unity 2022.2.12.
    It started happening after I enabled il2cpp and started using GLES3 instead of Vulkan
    upload_2023-3-26_19-53-50.png
    After starting the game, it would crash after running for 3 - 60 seconds.

    Disabling "SRP Batcher" on the Universal Render Pipeline Asset seems to mitigate the issue; the app won't crash anymore using GLES3.
    upload_2023-3-26_19-55-47.png
     

    Attached Files:

  15. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,251
    Since this is a completely different device, I suggest to try on another android device as well. If it also crashes there file a bug report so it can be fixed
     
  16. v-fox

    v-fox

    Joined:
    Jun 5, 2020
    Posts:
    4
    I have just tried on another android device, and it also crashes when the same conditions are met (il2cpp, GLES3 and batching enabled)

    I don't think I should file a bug report, though. Someone else on this thread already filed one, for the same issue.