Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Crash in IL2CPP code, SIGSEGV on Android

Discussion in 'Editor & General Support' started by ivoras, Feb 17, 2022.

  1. ivoras

    ivoras

    Joined:
    May 21, 2020
    Posts:
    66
    An app we're trying to port from Unity 2021.1.28 to 2021.2.11 keeps crashing when run on the device. It runs ok in the editor.

    The crash is such that it's not even capturable by Unity's debugger, but I see this with plain adb logcat:

    Code (CSharp):
    1.  
    2. 02-17 15:49:12.172 26552 26576 W native  : W0217 15:49:52.172111   26552 motion_tracking_context.cc:1524] Unable to find measurements corresponding to VIO status at timestamp 106238248473016.
    3. 02-17 15:49:12.868 26552 26576 E AndroidRuntime: FATAL EXCEPTION: UnityMain
    4. 02-17 15:49:12.868 26552 26576 E AndroidRuntime: Process: vision.equinox.app, PID: 26552
    5. 02-17 15:49:12.868 26552 26576 E AndroidRuntime: java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    6. 02-17 15:49:12.868 26552 26576 E AndroidRuntime: Version '2021.2.11f1 (e50cafbb4399)', Build type 'Development', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
    7. 02-17 15:49:12.868 26552 26576 E AndroidRuntime: Build fingerprint: 'Redmi/joyeuse_eea/joyeuse:11/RKQ1.200826.002/V12.5.6.0.RJZEUXM:user/release-keys'
    8. 02-17 15:49:12.868 26552 26576 E AndroidRuntime: Revision: '0'
    9. 02-17 15:49:12.868 26552 26576 E AndroidRuntime: ABI: 'arm64'
    10. 02-17 15:49:12.868 26552 26576 E AndroidRuntime: Timestamp: 2022-02-17 15:49:12+0100
    11. 02-17 15:49:12.868 26552 26576 E AndroidRuntime: pid: 26552, tid: 26587, name: Thread-19  >>> vision.equinox.app <<<
    12. 02-17 15:49:12.868 26552 26576 E AndroidRuntime: uid: 10244
    13. 02-17 15:49:12.868 26552 26576 E AndroidRuntime: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x132
    14. 02-17 15:49:12.868 26552 26576 E AndroidRuntime: Cause: null pointer dereference
    15. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:     x0  0000000000000000  x1  0000000000000000  x2  0000007a4eb4f96c  x3  0000007a4eb4f918
    16. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:     x4  0000007a4eb4f908  x5  00000079dc52509c  x6  0000007ae75ac000  x7  00000000000e39ce
    17. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:     x8  0000000000000023  x9  0000000000000005  x10 0000007880836b50  x11 0000000000000000
    18. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:     x12 0000000000000001  x13 0000000000000000  x14 0000000f109e05b8  x15 00000078b0026be0
    19. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:     x16 00000079de5381c8  x17 0000007ae168d07c  x18 0000007a4ddfc000  x19 b4000078fd2744c0
    20. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:     x20 0000000000000000  x21 00000079dfde4808  x22 0000000000000000  x23 0000007a4eb58fe0
    21. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:     x24 0000007880892f20  x25 b4000078fd2744c0  x26 00000079dfde56c0  x27 0000000000000011
    22. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:     x28 0000007884edc020  x29 0000007a4eb4fb50
    23. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:     sp  0000007a4eb4f860  lr  00000079dc4c17fc  pc  00000079dc4c08cc
    24. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:
    25. 02-17 15:49:12.868 26552 26576 E AndroidRuntime: backtrace:
    26. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:       #00 pc 00000000088b48cc  /data/app/~~l9idC5sT2Cb2qX9rTRJgZg==/vision.equinox.app-FUgda12ycFQkhZSn_ClqMw==/lib/arm64/libil2cpp.so (BuildId: 7c9b5bec78e2110d96ae6d544b0cf7a987e8637c)
    27. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:       #01 pc 00000000088b57f8  /data/app/~~l9idC5sT2Cb2qX9rTRJgZg==/vision.equinox.app-FUgda12ycFQkhZSn_ClqMw==/lib/arm64/libil2cpp.so (BuildId: 7c9b5bec78e2110d96ae6d544b0cf7a987e8637c)
    28. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:       #02 pc 000000000888fb24  /data/app/~~l9idC5sT2Cb2qX9rTRJgZg==/vision.equinox.app-FUgda12ycFQkhZSn_ClqMw==/lib/arm64/libil2cpp.so (BuildId: 7c9b5bec78e2110d96ae6d544b0cf7a987e8637c)
    29. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:       #03 pc 0000000002d7128c  /data/app/~~l9idC5sT2Cb2qX9rTRJgZg==/vision.equinox.app-FUgda12ycFQkhZSn_ClqMw==/lib/arm64/libil2cpp.so (BuildId: 7c9b5bec78e2110d96ae6d544b0cf7a987e8637c)
    30. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:       #04 pc 0000000003f13558  /data/app/~~l9idC5sT2Cb2qX9rTRJgZg==/vision.equinox.app-FUgda12ycFQkhZSn_ClqMw==/lib/arm64/libil2cpp.so (BuildId: 7c9b5bec78e2110d96ae6d544b0cf7a987e8637c)
    31. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:       #05 pc 0000000003f13a54  /data/app/~~l9idC5sT2Cb2qX9rTRJgZg==/vision.equinox.app-FUgda12ycFQkhZSn_ClqMw==/lib/arm64/libil2cpp.so (BuildId: 7c9b5bec78e2110d96ae6d544b0cf7a987e8637c)
    32. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:       #06 pc 000000000475ddc0  /data/app/~~l9idC5sT2Cb2qX9rTRJgZg==/vision.equinox.app-FUgda12ycFQkhZSn_ClqMw==/lib/arm64/libil2cpp.so (BuildId: 7c9b5bec78e2110d96ae6d544b0cf7a987e8637c)
    33. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:       #07 pc 00000000088aef64  /data/app/~~l9idC5sT2Cb2qX9rTRJgZg==/vision.equinox.app-FUgda12ycFQkhZSn_ClqMw==/lib/arm64/libil2cpp.so (BuildId: 7c9b5bec78e2110d96ae6d544b0cf7a987e8637c)
    34. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:       #08 pc 00000000088aedc4  /data/app/~~l9idC5sT2Cb2qX9rTRJgZg==/vision.equinox.app-FUgda12ycFQkhZSn_ClqMw==/lib/arm64/libil2cpp.so (BuildId: 7c9b5bec78e2110d96ae6d544b0cf7a987e8637c)
    35. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:       #09 pc 000000000890e3e4  /data/app/~~l9idC5sT2Cb2qX9rTRJgZg==/vision.equinox.app-FUgda12ycFQkhZSn_ClqMw==/lib/arm64/libil2cpp.so (BuildId: 7c9b5bec78e2110d96ae6d544b0cf7a987e8637c)
    36. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:       #10 pc 000000000891a034  /data/app/~~l9idC5sT2Cb2qX9rTRJgZg==/vision.equinox.app-FUgda12ycFQkhZSn_ClqMw==/lib/arm64/libil2cpp.so (BuildId: 7c9b5bec78e2110d96ae6d544b0cf7a987e8637c)
    37. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:       #11 pc 000000000890e32c  /data/app/~~l9idC5sT2Cb2qX9rTRJgZg==/vision.equinox.app-FUgda12ycFQkhZSn_ClqMw==/lib/arm64/libil2cpp.so (BuildId: 7c9b5bec78e2110d96ae6d544b0cf7a987e8637c)
    38. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:       #12 pc 00000000088b30b0  /data/app/~~l9idC5sT2Cb2qX9rTRJgZg==/vision.equinox.app-FUgda12ycFQkhZSn_ClqMw==/lib/arm64/libil2cpp.so (BuildId: 7c9b5bec78e2110d96ae6d544b0cf7a987e8637c)
    39. 02-17 15:49:12.868 26552 26576 E AndroidRuntime:       #13 pc 000000000887cc90  /data/app/~~l9idC5sT2Cb2qX9rTRJgZg==/vision.equinox.app-FUgda12ycFQkhZSn_ClqMw==/lib/arm64/libil2cpp.so (BuildId: 7c9b5bec78e2110d96ae6d544b0cf7a987e8637c)
    40. 02-17 15:49:12.869   900  7876 V audio_hw_primary: out_get_presentation_position: frames:17102016  avail:0  kernel_buffer_size:384
    41. 02-17 15:49:12.869 26552 26576 E AndroidRuntime:       #14 pc 00000000000eb8a8  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) (BuildId: 2e8a650ddf4a10855ff9ad91c011753e)
    42. 02-17 15:49:12.869 26552 26576 E AndroidRuntime:       #15 pc 000000000008bac8  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 2e8a650ddf4a10855ff9ad91c011753e)
    43. 02-17 15:49:12.869 26552 26576 E AndroidRuntime:
    44. 02-17 15:49:12.869 26552 26576 E AndroidRuntime:        at libil2cpp.0x88b48cc(Native Method)
    45. 02-17 15:49:12.869 26552 26576 E AndroidRuntime:        at libil2cpp.0x88b57f8(Native Method)
    46. 02-17 15:49:12.869 26552 26576 E AndroidRuntime:        at libil2cpp.0x888fb24(Native Method)
    47. 02-17 15:49:12.869 26552 26576 E AndroidRuntime:        at libil2cpp.0x2d7128c(Native Method)
    48. 02-17 15:49:12.869 26552 26576 E AndroidRuntime:        at libil2cpp.0x3f13558(Native Method)
    49. 02-17 15:49:12.869 26552 26576 E AndroidRuntime:        at libil2cpp.0x3f13a54(Native Method)
    50. 02-17 15:49:12.869 26552 26576 E AndroidRuntime:        at libil2cpp.0x475ddc0(Native Method)
    51. 02-17 15:49:12.869 26552 26576 E AndroidRuntime:        at libil2cpp.0x88aef64(Native Method)
    52. 02-17 15:49:12.869 26552 26576 E AndroidRuntime:        at libil2cpp.0x88aedc4(Native Method)
    53. 02-17 15:49:12.869 26552 26576 E AndroidRuntime:        at libil2cpp.0x890e3e4(Native Method)
    54. 02-17 15:49:12.869 26552 26576 E AndroidRuntime:        at libil2cpp.0x891a034(Native Method)
    55. 02-17 15:49:12.869 26552 26576 E AndroidRuntime:        at libil2cpp.0x890e32c(Native Method)
    56. 02-17 15:49:12.869 26552 26576 E AndroidRuntime:        at libil2cpp.0x88b30b0(Native Method)
    57. 02-17 15:49:12.869 26552 26576 E AndroidRuntime:        at libil2cpp.0x887cc90(Native Method)
    58. 02-17 15:49:12.869 26552 26576 E AndroidRuntime:        at libc.__pthread_start(void*)(__pthread_start:64)
    59. 02-17 15:49:12.869 26552 26576 E AndroidRuntime:        at libc.__start_thread(__start_thread:64)
    60. 02-17 15:49:12.869   900  7876 V audio_hw_primary: out_write: frames=192, frame_size=6, bytes_to_write=1152
    I don't think the audio lines are significant, but I've seen a very similar crash in the EDITOR (before I even got to building it correctly) and reported it as a bug, very probably the same as https://issuetracker.unity3d.com/is...pdateaudiomixermemory-when-entering-play-mode .

    Since the above stack trace has next to no information on where it happened - no file names, no line numbers, how can I even proceed working on it?

    This is an AR app (AR Foundation / ARCore).
     
    Last edited: Feb 17, 2022
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,637
    Try using Development Player, that one should provide symbol names.
     
  3. ivoras

    ivoras

    Joined:
    May 21, 2020
    Posts:
    66
    This *is* the development player :(
    It says so in the stack trace:

    02-17 15:49:12.868 26552 26576 E AndroidRuntime: Version '2021.2.11f1 (e50cafbb4399)', Build type 'Development', Scripting Backend 'il2cpp', CPU 'arm64-v8a'


    I've even tried enabling "Force debug information" in Burst AOT settings, same result (no symbol info appears).
     
  4. captain_zero

    captain_zero

    Joined:
    Mar 1, 2015
    Posts:
    6
    i found same crash, wait for fix...
     
  5. ivoras

    ivoras

    Joined:
    May 21, 2020
    Posts:
    66
    Do you use 3rd party libraries, potentially with unsafe code?

    I don't know if this is anywhere near where the actual problem is, but it looks like, after some experimentation, that the Unity generated code doesn't trap null references as it did in the older versions of Unity, and instead of converting them to the NullReferenceException, they are crashing the process. And one 3rd party dll we use does occasionally generate a null access because of its bugs. We are catching that exception, but apparently in this version of Unity, there's nothing to catch, it just crashes.

    This is just a possibility, not sure if that's the actual cause but it's a good possibility because we got rid of the crashes when we stopped using that 3rd party dll (which we will bring back because we need that functionality).
     
  6. captain_zero

    captain_zero

    Joined:
    Mar 1, 2015
    Posts:
    6
    yes, i use a lua plugin, with an arm64 native library.
    in my case, it looks an object handle suddenly be freed, wildpointer access crashed.
     
  7. ivoras

    ivoras

    Joined:
    May 21, 2020
    Posts:
    66
    We are using ZXing QR code library, but we also use Moonsharp Lua, and haven't found a problem with it yet. Which Lua library do you use?
     
  8. captain_zero

    captain_zero

    Joined:
    Mar 1, 2015
    Posts:
    6
    i am develp a native lua plugin myself, base on the official lua c interpreter.
    https://github.com/bianpeng001/bLua
    it works well with unity 2020.x.x, but crashed in unity2021.2.x
     
  9. KarunaTeam

    KarunaTeam

    Joined:
    Dec 6, 2019
    Posts:
    4
    redcurrantsjam likes this.
  10. funny_rb

    funny_rb

    Joined:
    Oct 8, 2022
    Posts:
    1
    we found a problem that is similar to yours,and my leader told me that,it is because some of code in .so isn`t managed by unity,and how to solve,the crashlog would show the memory where it went wrong,and using some tools to decompile
    the address to get out the line ,that is c++code,and then read it to know what went wrong in c# code,hope it will help u,we compile code with l2tocpp
     
  11. sachinhello

    sachinhello

    Joined:
    Dec 27, 2018
    Posts:
    16
    I got this in Anr and crashes panel in play console 2-3 devices get this error, occur event times 1 or 2 only. so how I am able to fix this crashes and anr
     
  12. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,394
    I had these issues with graphics jobs in 2021.3LTS as well on the quest 2
     
  13. War_Tourist

    War_Tourist

    Joined:
    Dec 3, 2014
    Posts:
    8
    Quest 2 game is getting this crash now since updating to 2021.3.10f1.