Search Unity

Unity as a Library with Xamarin Forms Android crash

Discussion in 'Android' started by Pequeno, Feb 18, 2021.

  1. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    Hi Unity,

    I'm currently working on implementing Unity (using 2020.2.4f1) as a library in Xamarin Forms, but I'm running into a very weird crash issue. Unity works as a view, and renders correctly, but if I open any other views after having opened the Unity view, the app dies without any good logs, or even a real crash report.

    When my visual studio (Xamarin) debugger is attached, the app crashes when I remove the view, where Unity is being rendered without getting a crash report in the logs.

    If I don't have the debugger attached I get the following 'crash log' in logcat:
    Code (CSharp):
    1. E/CRASH: Version '2020.2.4f1 (becced5a802b)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
    2. E/CRASH: Build fingerprint: 'OnePlus/OnePlus5/OnePlus5:10/QKQ1.191014.012/2010292059:user/release-keys'
    3. E/CRASH: Revision: '0'
    4. E/CRASH: ABI: 'arm64'
    5. E/CRASH: Timestamp: 2021-02-18 08:44:59+0100
    6. E/CRASH: pid: 32362, tid: 1851, name: Thread Pool Wor  >>> com.company.appname <<<
    7. E/CRASH: uid: 14298
    8. E/CRASH: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
    9. E/CRASH: Cause: null pointer dereference
    10. E/CRASH:     x0  0000000000000000  x1  0000000000000000  x2  00000073817ca13a  x3  00000073703ebe6c
    11. E/CRASH:     x4  0000000000000000  x5  00000000c0000000  x6  0000007371578e60  x7  000000735bd34628
    12. E/CRASH:     x8  00000073de4f4000  x9  0000000000000000  x10 0000000000000001  x11 0000000000000000
    13. E/CRASH:     x12 000000000199a980  x13 00000073de417d00  x14 00000073da2dad50  x15 00000000ffffffff
    14. E/CRASH:     x16 00000073dab7b890  x17 00000073ce3ea400  x18 0000000000000008  x19 00000073703ec8c0
    15. E/CRASH:     x20 00000073703ecad8  x21 0000000000000000  x22 000000737e694270  x23 000000737e129f18
    16. E/CRASH:     x24 000000737e129ea0  x25 000000737e129f98  x26 000000737e0a90d0  x27 0000000000000000
    17. E/CRASH:     x28 00000073703ed020  x29 00000073703ec410
    18. E/CRASH:     sp  00000073703ec410  lr  00000073dab7b83c  pc  00000073dab7b8a8
    19. E/CRASH: backtrace:
    20. E/CRASH:       #00 pc 000000000000f8a8  <anonymous:00000073dab6c000>

    This log doesn't crash the app immediately (If the debugger is not attached), but it will crash, whenever I navigate to another complex view. This leads me to think it could be GC related. Though I am in no way sure of this. Disabling the GC on the unity side did not make a difference.

    This happens when I use a simple scene, or a more complex scene (AR specifically).

    I'm using a ViewRenderer in Xamarin Forms Android to display the UnityPlayer. I do not unload or dispose the UnityPlayer. The viewrenderer does get dispose called, though I do not touch the UnityPlayer in there. If I navigate back to my view, I reuse the UnityPlayer, which seems to work fine, if the debugger isn't attached.

    I can provide a small sample, if needed to repro. The sample includes the Unity project, a Library binding project and a Xamarin Forms project and a few steps to build.

    Is this a Unity or Xamarin issue? Should I report this as a bug and include everything?
     
    Last edited: Feb 19, 2021
  2. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    To update the issue, I seem to be getting these things in the log consistently too:

    Code (CSharp):
    1. E/native: normal_detector_cpu.cc:229 Error graph_->WaitUntilIdle():INTERNAL: RET_CHECK failure (third_party/mediapipe/framework/scheduler.cc:278) state_ != STATE_NOT_STARTED (0 vs. 0)
    2. E/SurfaceFlinger: Permission Denial: SurfaceFlinger did not recognize request code: 20001
    3. E/OnePlusService: Exception notifySurfaceFlingerUpdate
    4. W/System.err: java.lang.SecurityException
    5. W/System.err:     at android.os.BinderProxy.transactNative(Native Method)
    6. W/System.err:     at android.os.BinderProxy.transact(BinderProxy.java:557)
    7. W/System.err:     at com.oneplus.server.OnePlusService.notifySurfaceFlingerUpdate(Unknown Source:21)
    8. W/System.err:     at com.oneplus.os.IOnePlusService$Stub.onTransact(IOnePlusService.java:356)
    9. W/System.err:     at android.os.Binder.execTransactInternal(Binder.java:1032)
    10. W/System.err:     at android.os.Binder.execTransact(Binder.java:1005)
    11. /libc: Access denied finding property "sys.thermal.para"
    12. E/voice: voice_is_in_call:in_call 0
    13. /qti_sensors_hal: reportSingleEvent: prox data: 0.000000 raw:47.000000 2989048576.000000 SAM TS: 2939256200 HAL TS:1531487037989890 elapsedRealtimeNano:1531487039922972
    14. E/AutomaticBrightnessController: mProximityPositive : true
    15. E/Layer: [SurfaceView - com.company.appname/crc64c4f195b524672dcf.MainActivity#0] No local sync point found
    16. E/qti_sensors_hal: reportSingleEvent: prox data: 5.000305 raw:22.000000 2989048576.000000 SAM TS: 2939263158 HAL TS:1531487250331199 elapsedRealtimeNano:1531487251955420
    17. E/AutomaticBrightnessController: mProximityPositive : false
    18. E/KernelWakelockReader: Kernel wake locks exceeded buffer size 32768
    19. W/InputDispatcher: channel '7f514d1 com.company.appname/crc64c4f195b524672dcf.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
    20. E/InputDispatcher: channel '7f514d1 com.company.appname/crc64c4f195b524672dcf.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
    21. E/InputDispatcher: Window handle Window{7f514d1 u0 com.company.appname/crc64c4f195b524672dcf.MainActivity} has no registered input channel
    22. W/InputDispatcher: Attempted to unregister already unregistered input channel '7f514d1 com.company.appname/crc64c4f195b524672dcf.MainActivity (server)'
    23. W/DeviceKeyHandler: onKeyguardOccludedChangedLw false
    24. W/ActivityTaskManager: Force removing ActivityRecord{4a1b26d u0 com.company.appname/crc64c4f195b524672dcf.MainActivity t46833}: app died, no saved state
    25. W/ActivityManager: setHasOverlayUi called on unknown pid: 24364
    26. E/ANDR-PERF-JNI: UXEngine Trigger - Returning null
    27. E/RegisteredServicesCache: Next Tag=services
    28. E/RegisteredServicesCache: installedServices no uidString
    29. E/RegisteredServicesCache: installedServices contains uidString : 10013
    30. E/RegisteredServicesCache: installedServices no uidString
    31. E/RegisteredServicesCache: 1invalidateCache:WriteServiceStateToFile
    32. E/RegisteredServicesCache:  Writing service state Data Always
    33. E/RegisteredServicesCache: component namecom.google.android.gms/com.google.android.gms.nearby.mediums.nearfieldcommunication.NfcAdvertisingService
    34. E/RegisteredServicesCache: component namecom.google.android.gms/com.google.android.gms.pay.hce.service.PayHceService
    35. E/RegisteredServicesCache: component namese.sas.android/se.sas.android.misc.nfc.SmartPassHostApduService
    36. E/soundtrigger: audio_extn_sound_trigger_update_stream_status: invalid input device 0x0, for event 2
    37. E/audio_hw_primary: disable_snd_device snd_device =2 device_name =speaker
    38. W/adbd: timeout expired while flushing socket, closing
    39. E/TaskPersister: File error accessing recents directory (directory doesn't exist?).
    40. E/libc: Access denied finding property "sys.thermal.para"
    41. W/auditd: type=1400 "thermal-engine""u:object_r:system_prop:s0""tmpfs"
    42. E/KernelWakelockReader: Kernel wake locks exceeded buffer size 32768
    43. W/AlarmManager: Unrecognized alarm listener com.android.server.b@1afe0bc
    44. W/auditd: type=1400 "thermal-engine""u:object_r:system_prop:s0""tmpfs"
    45. E/libc: Access denied finding property "sys.thermal.para"
    It could seem like the surfaceflinger could have something to do with Unity?
     
  3. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    Having poked around quite a bit more, trying to get a better error message, I've come to a point, where I consistently can get this error. It happens when the Unity view is shown, and the app actually crashes now.

    Code (CSharp):
    1. 2021-03-01 00:34:56.619 27997-29219/com.company.appname E/CRASH: Forwarding signal 6
    2. 2021-03-01 00:34:56.619 27997-29219/com.company.appname A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 29219 (UnityMain), pid 27997 (.company.appname)
    3. 2021-03-01 00:34:56.730 30984-30984/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    4. 2021-03-01 00:34:56.730 30984-30984/? A/DEBUG: Build fingerprint: 'OnePlus/OnePlus5/OnePlus5:10/QKQ1.191014.012/2010292059:user/release-keys'
    5. 2021-03-01 00:34:56.730 30984-30984/? A/DEBUG: Revision: '0'
    6. 2021-03-01 00:34:56.730 30984-30984/? A/DEBUG: ABI: 'arm64'
    7. 2021-03-01 00:34:56.730 30984-30984/? A/DEBUG: Timestamp: 2021-03-01 00:34:56+0100
    8. 2021-03-01 00:34:56.730 30984-30984/? A/DEBUG: pid: 27997, tid: 29219, name: UnityMain  >>> com.company.appname <<<
    9. 2021-03-01 00:34:56.730 30984-30984/? A/DEBUG: uid: 14298
    10. 2021-03-01 00:34:56.730 30984-30984/? A/DEBUG: signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
    11. 2021-03-01 00:34:56.730 30984-30984/? A/DEBUG: Abort message: '* Assertion at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mono/utils/mono-threads.c:650, condition `info' not met, function:mono_thread_info_current,
    12.     '
    13. 2021-03-01 00:34:56.730 30984-30984/? A/DEBUG:     x0  0000000000000000  x1  0000000000007223  x2  0000000000000006  x3  000000737429b620
    14. 2021-03-01 00:34:56.730 30984-30984/? A/DEBUG:     x4  0080000000000000  x5  0080000000000000  x6  0080000000000000  x7  0000000000008000
    15. 2021-03-01 00:34:56.730 30984-30984/? A/DEBUG:     x8  00000000000000f0  x9  98b2507f809c96be  x10 0000000000000001  x11 0000000000000000
    16. 2021-03-01 00:34:56.730 30984-30984/? A/DEBUG:     x12 fffffff0fffffbdf  x13 0000000000000030  x14 ffffffffffffffff  x15 0000f18671be7449
    17. 2021-03-01 00:34:56.730 30984-30984/? A/DEBUG:     x16 000000746e65b8c0  x17 000000746e637900  x18 000000737429c2f8  x19 0000000000006d5d
    18. 2021-03-01 00:34:56.730 30984-30984/? A/DEBUG:     x20 0000000000007223  x21 00000000ffffffff  x22 0000000000000000  x23 000000738e033a30
    19. 2021-03-01 00:34:56.730 30984-30984/? A/DEBUG:     x24 0000000000000008  x25 0000000000000000  x26 000000737429e020  x27 0000000000000002
    20. 2021-03-01 00:34:56.730 30984-30984/? A/DEBUG:     x28 0000000000000002  x29 000000737429b6c0
    21. 2021-03-01 00:34:56.730 30984-30984/? A/DEBUG:     sp  000000737429b600  lr  000000746e5e90c4  pc  000000746e5e90f0
    22. 2021-03-01 00:34:56.741 30984-30984/? A/DEBUG: backtrace:
    23. 2021-03-01 00:34:56.741 30984-30984/? A/DEBUG:       #00 pc 00000000000830f0  /apex/com.android.runtime/lib64/bionic/libc.so (abort+160) (BuildId: e55e6e4c631509598633769798683023)
    24. 2021-03-01 00:34:56.741 30984-30984/? A/DEBUG:       #01 pc 000000000028a1b8  /data/app/Mono.Android.DebugRuntime-Xd0RuqBwH2VCcXZj0rcBPQ==/lib/arm64/libmonosgen-64bit-2.0.so (monoeg_assert_abort+24)
    25. 2021-03-01 00:34:57.168 1215-1215/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_08
    Anyone seen this before and have any ideas how to fix this?
     
  4. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    Trying to figure out what is happening, when I implement the UnityPlayer in a fragment, I got the follow errors, which might help?

    Code (CSharp):
    1. 2021-03-12 12:59:01.309 1540-4133/? D/ActivityTaskManager: setRequestedOrientation() to 1 for ActivityRecord{6cf19bb u0 com.company.appname/com.company.companyActivity t47612} from pid=14488, uid=14311
    2. 2021-03-12 12:59:01.310 14488-17030/com.company.appname E/libEGL: eglMakeCurrentImpl:1105 error 3002 (EGL_BAD_ACCESS)
    3. 2021-03-12 12:59:01.311 14488-17030/com.company.appname E/Unity: [EGL] Unable to acquire context: EGL_BAD_ACCESS: EGL cannot access a requested resource (for example a context is bound in another thread).
    4.      #0 0x7005f16f98 (libunity.so) ? 0x0
    5.      #1 0x7006790918 (libunity.so) ? 0x0
    6.      #2 0x7005f11d88 (libunity.so) ? 0x0
    7.      #3 0x7005f101b0 (libunity.so) ? 0x0
    8.      #4 0x70061b5e6c (libunity.so) ? 0x0
    9.      #5 0x70061b6158 (libunity.so) ? 0x0
    10.      #6 0x70061b8034 (libunity.so) ? 0x0
    11.      #7 0x707abf1350 (libart.so) art_quick_generic_jni_trampoline 0x90
    12.      #8 0x707abe8334 (libart.so) art_quick_invoke_stub 0x224
    13.      #9 0x707abf6fec (libart.so) art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*) 0xf4
    14.      #10 0x707ad94928 (libart.so) art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*) 0x180
    15.      #11 0x707ad8fb88 (libart.so) bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*) 0x37c
    16.      #12 0x707b054100 (
    17. 2021-03-12 12:59:01.311 14488-17030/com.company.appname E/libEGL: eglMakeCurrentImpl:1105 error 3002 (EGL_BAD_ACCESS)
    18. 2021-03-12 12:59:01.312 14488-17030/com.company.appname E/Unity: [EGL] Unable to acquire context: EGL_BAD_ACCESS: EGL cannot access a requested resource (for example a context is bound in another thread).
    19.      #0 0x7005f16f98 (libunity.so) ? 0x0
    20.      #1 0x7006790918 (libunity.so) ? 0x0
    21.      #2 0x7005f11d88 (libunity.so) ? 0x0
    22.      #3 0x70061b5e74 (libunity.so) ? 0x0
    23.      #4 0x70061b6158 (libunity.so) ? 0x0
    24.      #5 0x70061b8034 (libunity.so) ? 0x0
    25.      #6 0x707abf1350 (libart.so) art_quick_generic_jni_trampoline 0x90
    26.      #7 0x707abe8334 (libart.so) art_quick_invoke_stub 0x224
    27.      #8 0x707abf6fec (libart.so) art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*) 0xf4
    28.      #9 0x707ad94928 (libart.so) art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*) 0x180
    29.      #10 0x707ad8fb88 (libart.so) bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*) 0x37c
    30.      #11 0x707b054100 (libart.so) MterpInvokeDirect 0x1a8
    31.      #1
    32. 2021-03-12 12:59:01.312 3289-3289/? I/GoogleInputMethodService: GoogleInputMethodService.onFinishInput():3340
    33. 2021-03-12 12:59:01.312 3289-3289/? I/GoogleInputMethodService: GoogleInputMethodService.onStartInput():1929
    34. 2021-03-12 12:59:01.318 1540-4428/? D/ActivityTaskManager: setRequestedOrientation() to 1 for ActivityRecord{6cf19bb u0 com.company.appname/com.company.companyActivity t47612} from pid=14488, uid=14311
    35. 2021-03-12 12:59:01.319 14488-17030/com.company.appname E/libEGL: eglMakeCurrentImpl:1105 error 3002 (EGL_BAD_ACCESS)
    36. 2021-03-12 12:59:01.319 14488-17030/com.company.appname E/Unity: [EGL] Unable to acquire context: EGL_BAD_ACCESS: EGL cannot access a requested resource (for example a context is bound in another thread).
    37.      #0 0x7005f16f98 (libunity.so) ? 0x0
    38.      #1 0x7006790918 (libunity.so) ? 0x0
    39.      #2 0x7005f11d88 (libunity.so) ? 0x0
    40.      #3 0x7005f101b0 (libunity.so) ? 0x0
    41.      #4 0x70061b5e6c (libunity.so) ? 0x0
    42.      #5 0x70061b6158 (libunity.so) ? 0x0
    43.      #6 0x70061a2600 (libunity.so) ? 0x0
    44.      #7 0x70061b8154 (libunity.so) ? 0x0
    45.      #8 0x9b4e49fc (jit-cache (deleted)) ? 0x0
    46. 2021-03-12 12:59:01.319 14488-17030/com.company.appname E/libEGL: eglMakeCurrentImpl:1105 error 3002 (EGL_BAD_ACCESS)
    47. 2021-03-12 12:59:01.319 14488-17030/com.company.appname E/Unity: [EGL] Unable to acquire context: EGL_BAD_ACCESS: EGL cannot access a requested resource (for example a context is bound in another thread).
    48.      #0 0x7005f16f98 (libunity.so) ? 0x0
    49.      #1 0x7006790918 (libunity.so) ? 0x0
    50.      #2 0x7005f11d88 (libunity.so) ? 0x0
    51.      #3 0x70061b5e74 (libunity.so) ? 0x0
    52.      #4 0x70061b6158 (libunity.so) ? 0x0
    53.      #5 0x70061a2600 (libunity.so) ? 0x0
    54.      #6 0x70061b8154 (libunity.so) ? 0x0
    55.      #7 0x9b4e49fc (jit-cache (deleted)) ? 0x0
    Anyone seen this before? Anyone know how to get around this on Android?

    Is this Unity forum completely dead? Did Unity stop supporting developers?
     
  5. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    I have reported this as a reproducable bug with projects to quickly reproduce these crashes.
    Bug number is 1321798.
     
  6. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    Having now built it using Unity 2021 in debug mode, I've gotten the following crash, which might show even better, what is wrong:

    Code (CSharp):
    1. E/AndroidRuntime: FATAL EXCEPTION: UnityMain
    2.     Process: com.company.companyunityapp, PID: 6823
    3.     java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    4.     Version '2021.1.0f1 (61a549675243)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
    5.     Build fingerprint: 'OnePlus/OnePlus5/OnePlus5:10/QKQ1.191014.012/2010292059:user/release-keys'
    6.     Revision: '0'
    7.     ABI: 'arm64'
    8.     Timestamp: 2021-03-30 12:08:24+0200
    9.     pid: 6823, tid: 7651, name: UnityMain  >>> com.company.companyunityapp <<<
    10.     uid: 14312
    11.     signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
    12.         x0  0000000000000000  x1  0000000000001de3  x2  0000000000000006  x3  00000070013bcef0
    13.         x4  000000000000000a  x5  000000000000000a  x6  000000000000000a  x7  000000000000000a
    14.         x8  00000000000000f0  x9  070d7931049703f8  x10 0000000000000001  x11 0000000000000000
    15.         x12 fffffff0fffffbdf  x13 6c495c6e69616d5c  x14 0000000000000068  x15 0000000000000000
    16.         x16 00000070fed138c0  x17 00000070fecef900  x18 000000700091c000  x19 0000000000001aa7
    17.         x20 0000000000001de3  x21 00000000ffffffff  x22 00000070013be560  x23 00000070013c0020
    18.         x24 00000070013be560  x25 0000000000000001  x26 00000070013be120  x27 00000070013bd790
    19.         x28 00000070013bdbd0  x29 00000070013bcf90
    20.         sp  00000070013bced0  lr  00000070feca10c4  pc  00000070feca10f0
    21.    
    22.     backtrace:
    23.           #00 pc 00000000000830f0  /apex/com.android.runtime/lib64/bionic/libc.so (abort+160) (BuildId: e55e6e4c631509598633769798683023)
    24.           #01 pc 000000000076b804  /data/app/com.company.companyunityapp-AdSCx8mhwAe1p8LXuqaLhA==/lib/arm64/libil2cpp.so (il2cpp::os::COM::CreateFreeThreadedMarshaler(Il2CppIUnknown*, Il2CppIUnknown**)) (BuildId: dc393dbbfc4bdc03e4ee311273c70d0f9041b118)
    25.           #02 pc 00000000007cd104  /data/app/com.company.companyunityapp-AdSCx8mhwAe1p8LXuqaLhA==/lib/arm64/libil2cpp.so (GetGenericParameterFromIndexInternal(int)+152) (BuildId: dc393dbbfc4bdc03e4ee311273c70d0f9041b118)
    26.           #03 pc 00000000007c8824  /data/app/com.company.companyunityapp-AdSCx8mhwAe1p8LXuqaLhA==/lib/arm64/libil2cpp.so (InitializeGenericParameterHandle(Il2CppType*)+24) (BuildId: dc393dbbfc4bdc03e4ee311273c70d0f9041b118)
    27.           #04 pc 00000000007c87b8  /data/app/com.company.companyunityapp-AdSCx8mhwAe1p8LXuqaLhA==/lib/arm64/libil2cpp.so (ProcessIl2CppTypeDefinitions(void (*)(Il2CppType*), void (*)(Il2CppType*))+292) (BuildId: dc393dbbfc4bdc03e4ee311273c70d0f9041b118)
    28.           #05 pc 00000000007c8490  /data/app/com.company.companyunityapp-AdSCx8mhwAe1p8LXuqaLhA==/lib/arm64/libil2cpp.so (il2cpp::vm::GlobalMetadata::Initialize(int*, int*)+504) (BuildId: dc393dbbfc4bdc03e4ee311273c70d0f9041b118)
    29.           #06 pc 00000000007d3534  /data/app/com.company.companyunityapp-AdSCx8mhwAe1p8LXuqaLhA==/lib/arm64/libil2cpp.so (il2cpp::vm::MetadataCache::Initialize()+64) (BuildId: dc393dbbfc4bdc03e4ee311273c70d0f9041b118)
    30.           #07 pc 00000000007b74ec  /data/app/com.company.companyunityapp-AdSCx8mhwAe1p8LXuqaLhA==/lib/arm64/libil2cpp.so (il2cpp::vm::Runtime::Init(char const*)+412) (BuildId: dc393dbbfc4bdc03e4ee311273c70d0f9041b118)
    31.           #08 pc 000000000076070c  /data/app/com.company.companyunityapp-AdSCx8mhwAe1p8LXuqaLhA==/lib/arm64/libil2cpp.so (il2cpp_init+44) (BuildId: dc393dbbfc4bdc03e4ee311273c70d0f9041b118)
    32.           #09 pc 0000000000632404  /data/app/com.company.companyunityapp-AdSCx8mhwAe1p8LXuqaLhA==/lib/arm64/libunity.so (BuildId: a4066277acf9d678d139323c41d7c77750c5db31)
    33.           #10 pc 00000000006a242c  /data/app/com.company.companyunityapp-AdSCx8mhwAe1p8LXuqaLhA==/lib/arm64/libunity.so (BuildId: a4066277acf9d678d139323c41d7c77750c5db31)
    34.           #11 pc 00000000006a2ff0  /data/app/com.company.companyunityapp-AdSCx8mhwAe1p8LXuqaLhA==/lib/arm64/libunity.so (BuildId: a4066277acf9d678d139323c41d7c77750c5db31)
    35.           #12 pc 00000000006b875c  /data/app/com.company.companyunityapp-AdSCx8mhwAe1p8LXuqaLhA==/lib/arm64/libunity.so (BuildId: a4066277acf9d678d139323c41d7c77750c5db31)
    36.           #13 pc 000000000013f350  /apex/com.android.runtime/lib64/libart.so (art_quick_generic_jni_trampoline+144) (BuildId: d700c52998d7d76cb39e2001d670e654)
    37. E/AndroidRuntime:       #14 pc 0000000000136334  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: d700c52998d7d76cb39e2001d670e654)
    38.           #15 pc 0000000000144fec  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244) (BuildId: d700c52998d7d76cb39e2001d670e654)
    39.           #16 pc 00000000002e2928  /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+384) (BuildId: d700c52998d7d76cb39e2001d670e654)
    40.           #17 pc 00000000002ddb88  /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+892) (BuildId: d700c52998d7d76cb39e2001d670e654)
    41.           #18 pc 00000000005a2100  /apex/com.android.runtime/lib64/libart.so (MterpInvokeDirect+424) (BuildId: d700c52998d7d76cb39e2001d670e654)
    42.           #19 pc 0000000000130914  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: d700c52998d7d76cb39e2001d670e654)
    43.           #20 pc 00000000005a2b48  /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1040) (BuildId: d700c52998d7d76cb39e2001d670e654)
    44.           #21 pc 0000000000130994  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: d700c52998d7d76cb39e2001d670e654)
    45.           #22 pc 00000000005a18b8  /apex/com.android.runtime/lib64/libart.so (MterpInvokeInterface+1788) (BuildId: d700c52998d7d76cb39e2001d670e654)
    46.           #23 pc 0000000000130a14  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: d700c52998d7d76cb39e2001d670e654)
    47.           #24 pc 00000000005a0098  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1352) (BuildId: d700c52998d7d76cb39e2001d670e654)
    48.           #25 pc 0000000000130814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: d700c52998d7d76cb39e2001d670e654)
    49.           #26 pc 00000000005a2b48  /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1040) (BuildId: d700c52998d7d76cb39e2001d670e654)
    50.           #27 pc 0000000000130994  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: d700c52998d7d76cb39e2001d670e654)
    51.           #28 pc 00000000002b3c3c  /apex/com.android.runtime/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.18044833378915231953)+240) (BuildId: d700c52998d7d76cb39e2001d670e654)
    52.           #29 pc 0000000000591340  /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1032) (BuildId: d700c52998d7d76cb39e2001d670e654)
    53.           #30 pc 000000000013f468  /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: d700c52998d7d76cb39e2001d670e654)
    54.           #31 pc 0000000000136334  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: d700c52998d7d76cb39e2001d670e654)
    55.           #32 pc 0000000000144fec  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244) (BuildId: d700c52998d7d76cb39e2001d670e654)
    56.           #33 pc 00000000004afd44  /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104) (BuildId: d700c52998d7d76cb39e2001d670e654)
    57.           #34 pc 00000000004b0e58  /apex/com.android.runtime/lib64/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+416) (BuildId: d700c52998d7d76cb39e2001d670e654)
    58.           #35 pc 00000000004f1814  /apex/com.android.runtime/lib64/libart.so (art::Thread::CreateCallback(void*)+1176) (BuildId: d700c52998d7d76cb39e2001d670e654)
    59. E/AndroidRuntime:       #36 pc 00000000000e6890  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: e55e6e4c631509598633769798683023)
    60.           #37 pc 0000000000084b6c  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: e55e6e4c631509598633769798683023)
    61.    
    62.         at libc.abort(abort:160)
    63.         at libil2cpp.il2cpp::os::COM::CreateFreeThreadedMarshaler(Il2CppIUnknown*, Il2CppIUnknown**)(CreateFreeThreadedMarshaler:0)
    64.         at libil2cpp.GetGenericParameterFromIndexInternal(int)(GetGenericParameterFromIndexInternal:152)
    65.         at libil2cpp.InitializeGenericParameterHandle(Il2CppType*)(InitializeGenericParameterHandle:24)
    66.         at libil2cpp.ProcessIl2CppTypeDefinitions(void (*)(Il2CppType*), void (*)(Il2CppType*))(ProcessIl2CppTypeDefinitions:292)
    67.         at libil2cpp.il2cpp::vm::GlobalMetadata::Initialize(int*, int*)(Initialize:504)
    68.         at libil2cpp.il2cpp::vm::MetadataCache::Initialize()(Initialize:64)
    69.         at libil2cpp.il2cpp::vm::Runtime::Init(char const*)(Init:412)
    70.         at libil2cpp.il2cpp_init(il2cpp_init:44)
    71.         at libunity.0x632404(Native Method)
    72.         at libunity.0x6a242c(Native Method)
    73.         at libunity.0x6a2ff0(Native Method)
    74.         at libunity.0x6b875c(Native Method)
    75.         at libart.art_quick_generic_jni_trampoline(art_quick_generic_jni_trampoline:144)
    76.         at libart.art_quick_invoke_stub(art_quick_invoke_stub:548)
    77.         at libart.art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)(Invoke:244)
    78.         at libart.art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)(ArtInterpreterToCompiledCodeBridge:384)
    79.         at libart.bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)(DoCall<false, false>:892)
    80.         at libart.MterpInvokeDirect(MterpInvokeDirect:424)
    81.         at libart.mterp_op_invoke_direct(mterp_op_invoke_direct:20)
    82.         at libart.MterpInvokeStatic(MterpInvokeStatic:1040)
    83.         at libart.mterp_op_invoke_static(mterp_op_invoke_static:20)
    84.         at libart.MterpInvokeInterface(MterpInvokeInterface:1788)
    85.         at libart.mterp_op_invoke_interface(mterp_op_invoke_interface:20)
    86.         at libart.MterpInvokeVirtual(MterpInvokeVirtual:1352)
    87.         at libart.mterp_op_invoke_virtual(mterp_op_invoke_virtual:20)
    88.         at libart.MterpInvokeStatic(MterpInvokeStatic:1040)
    89.         at libart.mterp_op_invoke_static(mterp_op_invoke_static:20)
    90.         at libart.art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.18044833378915231953)(Execute:240)
    91.         at libart.artQuickToInterpreterBridge(artQuickToInterpreterBridge:1032)
    92.         at libart.art_quick_to_interpreter_bridge(art_quick_to_interpreter_bridge:88)
    93.         at libart.art_quick_invoke_stub(art_quick_invoke_stub:548)
    94. E/CRASH: Forwarding signal 6
    95. A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 7651 (UnityMain), pid 6823 (u.companyunityapp)

    libil2cpp.il2cpp::eek:s::COM::CreateFreeThreadedMarshaler seems to be where it fails.
     
  7. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    This probably should provide a better diagnostics than a crash, but IL2CPP does not support COM on Android, so I don't think that this will work.
     
  8. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    Hi Josh,

    Do you know why it's even calling in here? Like what is the root cause, so I can prevent it from happening?
     
  9. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    No, I don't unfortunately. This call stack occurs right when the application starts, so we don't know what code specifically is using COM, and the diagnostics here are not helpful.

    Maybe inspect the code and assemblies in the project and look for a class with the [ComImport] attribute.
     
  10. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    Could I write some C++ code in the il2cpp, which could narrow it down better? Cause the Unity code is quite simple (Using ARFoundation, but nothing fancy), and I don't think I have any ComImport attributes anywhere in there.

    There seems to be a ComImportAttribute in some of the generated il2cpp code - Could that be the culprit? It's specifically inside the
    const Il2CppType* const  g_Il2CppTypeTable[10254]
    in "il2cppTypeDefinitions.c" - But I can't find it anywhere in my code.

    How would I best go around figuring this out? I honestly feel I'm on deep water looking into this.
     
  11. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    I think you are on the write track. We don't have a way to write C++ code to interact with the IL2CPP runtime code. But you can have a look at the generated C++ code. After a build, leave the Unity Editor open. Then in the Temp directory in the project, you should be able to find that il2cppTypeDefinitions.c file, along with the rest of the generated C++ code.

    I'm not sure of the exact directory for Android builds off the top of my head.
     
  12. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    I'm exporting the Android project, and I have the ill2cpp generated code there, which I'm running through. I can change this generated cpp code, since android exported projects compiles this cpp. So I was thinking, maybe I could write out all the types that it runs through. However, I'm not very well versed in the Il2CppType type, and what I can pull from it, or how to write out on Android using c++. I'm currently trying
    __android_log_print(ANDROID_LOG_INFO, "IL2CPPDebug", "%d", type->type );
    in the
    static void InitializeGenericParameterHandle(Il2CppType* type)
    function. Doing this, I get that the type->type is 30 - Is there anything else I could get from the Type, which might give a better indication of which type I'm looking at?
     
  13. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    Oh cool, then you can write a bit of C++ code in there, compile and run it.

    The IL2CppType does not have much information. It is a light weight representation of a type. to learn more about the type, you can dig into the libil2cpp runtime code. On Windows, you will find this code in the Unity Editor installation at Data\il2cpp\libil2cpp.

    You should be able to to call to il2cpp::vm::Class::FromIl2CppType method, which lives in the vm/Class.h header. That method will give you back the Il2CppClass* object for the Il2CppType*, which has much more information, including the name and namespace of the type in managed code.
     
  14. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    Unfortunately trying to get the class provides me with another crash:
    Code (CSharp):
    1. at libil2cpp.il2cpp::vm::GlobalMetadata::GetGenericParameterInfo(___Il2CppMetadataGenericParameterHandle const*)(GetGenericParameterInfo:28)
    2.         at libil2cpp.il2cpp::vm::MetadataCache::GetGenericParameterInfo(___Il2CppMetadataGenericParameterHandle const*)(GetGenericParameterInfo:20)
    3.         at libil2cpp.il2cpp::vm::Class::FromGenericParameter(___Il2CppMetadataGenericParameterHandle const*)(FromGenericParameter:304)
    4.         at libil2cpp.il2cpp::vm::Class::FromIl2CppType(Il2CppType const*, bool)(FromIl2CppType:1532)
    5.         at libil2cpp.InitializeGenericParameterHandle(Il2CppType*)(InitializeGenericParameterHandle:68)
    6.         at libil2cpp.ProcessIl2CppTypeDefinitions(void (*)(Il2CppType*), void (*)(Il2CppType*))(ProcessIl2CppTypeDefinitions:292)
    7.         at libil2cpp.il2cpp::vm::GlobalMetadata::Initialize(int*, int*)(Initialize:504)
    8.         at libil2cpp.il2cpp::vm::MetadataCache::Initialize()(Initialize:64)
    9.         at libil2cpp.il2cpp::vm::Runtime::Init(char const*)(Init:412)
    10.         at libil2cpp.il2cpp_init(il2cpp_init:44)
    11.         at libunity.0x632404(Native Method)
    12.         at libunity.0x6a242c(Native Method)
    13.         at libunity.0x6a2ff0(Native Method)
    14.         at libunity.0x6b875c(Native Method)
    15.         at libart.art_quick_generic_jni_trampoline(art_quick_generic_jni_trampoline:144)
    16.         at libart.art_quick_invoke_stub(art_quick_invoke_stub:548)
    17.         at libart.art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)(Invoke:244)
    18.         at libart.art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)(ArtInterpreterToCompiledCodeBridge:384)
    19.         at libart.bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)(DoCall<false, false>:892)
    20.         at libart.MterpInvokeDirect(MterpInvokeDirect:424)
    21.         at libart.mterp_op_invoke_direct(mterp_op_invoke_direct:20)
    22.         at libart.MterpInvokeStatic(MterpInvokeStatic:1040)
    23.         at libart.mterp_op_invoke_static(mterp_op_invoke_static:20)
    24.         at libart.MterpInvokeInterface(MterpInvokeInterface:1788)
    25.         at libart.mterp_op_invoke_interface(mterp_op_invoke_interface:20)
    26.         at libart.MterpInvokeVirtual(MterpInvokeVirtual:1352)
    27.         at libart.mterp_op_invoke_virtual(mterp_op_invoke_virtual:20)
    28.         at libart.MterpInvokeStatic(MterpInvokeStatic:1040)
    29.         at libart.mterp_op_invoke_static(mterp_op_invoke_static:20)
    30.         at libart.art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.18044833378915231953)(Execute:240)
    31.         at libart.artQuickToInterpreterBridge(artQuickToInterpreterBridge:1032)
    32.         at libart.art_quick_to_interpreter_bridge(art_quick_to_interpreter_bridge:88)
    So it seems this happens so early, that the type isn't hooked up to a class yet? Where do I get more info then?
     
  15. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    You may be able to step into Class::FromIl2CppType. There is a chance that the name of the class is set up before this code it called, so you might be able to at least determine that.
     
  16. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    I couldn't get anything from Class::FromIl2CppType as it seems to get it's data from GlobalMetadata, which hasn't run through the types yet it seems.

    However, trying to write out just something from the 'ProcessIl2CppTypeDefinitions(Il2CppTypeUpdater updateTypeDef, Il2CppTypeUpdater updateGenericParam)' provides me with only 1 item being looked at before it crashes - Which is a generic type (Or at least of type 'IL2CPP_TYPE_MVAR').

    What I don't understand is how 'il2cpp::eek:s::COM::CreateFreeThreadedMarshaler' is called from
    'GetGenericParameterFromIndexInternal'. Like when does it actually call this:
    Code (CSharp):
    1. static Il2CppMetadataGenericParameterHandle GetGenericParameterFromIndexInternal(GenericParameterIndex index)
    2. {
    3.     if (index == kGenericParameterIndexInvalid)
    4.         return NULL;
    5.  
    6.     IL2CPP_ASSERT(index >= 0 && static_cast<uint32_t>(index) <= s_GlobalMetadataHeader->genericParametersCount / sizeof(Il2CppGenericParameter));
    7.     const Il2CppGenericParameter* genericParameters = (const Il2CppGenericParameter*)((const char*)s_GlobalMetadata + s_GlobalMetadataHeader->genericParametersOffset);
    8.     return reinterpret_cast<Il2CppMetadataGenericParameterHandle>(genericParameters + index);
    9. }

    Is the stacktrace actually correct?
     
  17. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    So looking into the data used, I see an static_cast<uint32_t>(index) = 681, s_GlobalMetadataHeader->genericParametersCount = 7536 and sizeof(Il2CppGenericParameter) = 16, meaning the assert is failing, as 7536/16 = 471, and 681 is larger. Could this have something to do with that is going wrong?
     
  18. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    Oh wow no, the call stack seems to be lying to us. Does this crash occur when you use Debug code generation in Android Studio? Try that first to see if we can get a real call stack.
     
  19. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    I'm trying to use debug code, however, as I've also reported in the bug report linked earlier ( 1321798 ), I'm running this through Xamarin's Android Library binding first, and then through a Xamarin Forms project. And I don't know if this does anything weird to be honest.

    If I comment out the asserts related to this, I do not crash in those areas, but I then go a crash in this area:
    Code (CSharp):
    1. [CRASH] *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    2. [CRASH] Version '2021.1.0f1 (61a549675243)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
    3. [CRASH] Build fingerprint: 'OnePlus/OnePlus5/OnePlus5:10/QKQ1.191014.012/2010292059:user/release-keys'
    4. [CRASH] Revision: '0'
    5. [CRASH] ABI: 'arm64'
    6. [CRASH] Timestamp: 2021-03-30 16:44:29+0200
    7. [CRASH] pid: 7325, tid: 10449, name: UnityMain  >>> com.vizgu.vizguunityapp <<<
    8. [CRASH] uid: 14312
    9. [CRASH] signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x6fe02a6000
    10. [CRASH]     x0  0000006fe02a6000  x1  00000000001f7b9c  x2  0000000000000d19  x3  0000006f2fd81b00
    11. [CRASH]     x4  00000070013bbed8  x5  00000070013bbfd8  x6  000000706e62d340  x7  0000006f2fd79600
    12. [CRASH]     x8  0000006fe02a2b9c  x9  0000000000003464  x10 0000000000000004  x11 000000706b37f708
    13. [CRASH]     x12 000000706b37dad0  x13 0000000000000387  x14 0000000000000001  x15 8f4478c05e762530
    14. [CRASH]     x16 0000006fefd14330  x17 00000070fec9d380  x18 0000007000d24000  x19 0000006fee5ba6e4
    15. [CRASH]     x20 00000070013bc6a0  x21 00000070013bd030  x22 00000070013bd560  x23 00000070013bf020
    16. [CRASH]     x24 00000070013bd560  x25 0000000000000001  x26 00000070013bd120  x27 00000070013bc790
    17. [CRASH]     x28 00000070013bcbd0  x29 00000070013bc050
    18. [CRASH]     sp  00000070013bbf90  lr  0000006fee673614  pc  0000006fee673614
    19. [CRASH]
    20. [CRASH] backtrace:
    21. [CRASH]       #00 pc 000000000081c614  /data/app/com.vizgu.vizguunityapp-v_0OeaCBxy8oVWyiH0l9IQ==/lib/arm64/libil2cpp.so (il2cpp::vm::GlobalMetadata::InitializeUnresolvedSignatureTable(Il2CppHashMap<il2cpp::metadata::Il2CppSignature const, void (*)(), il2cpp::metadata::Il2CppSignatureHash, il2cpp::metadata::Il2CppSignatureCompare, std::__ndk1::allocator<std::__ndk1::pair<KeyWrapper<il2cpp::metadata::Il2CppSignature const> const, void (*)()> > >&)+256) (BuildId: f472bcc4d4df70dec465383a523d530a81c4b2aa)
    22. [CRASH]       #01 pc 0000000000826ae8  /data/app/com.vizgu.vizguunityapp-v_0OeaCBxy8oVWyiH0l9IQ==/lib/arm64/libil2cpp.so (il2cpp::vm::MetadataCache::InitializeUnresolvedSignatureTable()+88) (BuildId: f472bcc4d4df70dec465383a523d530a81c4b2aa)
    23. [CRASH]       #02 pc 00000000008267a4  /data/app/com.vizgu.vizguunityapp-v_0OeaCBxy8oVWyiH0l9IQ==/lib/arm64/libil2cpp.so (il2cpp::vm::MetadataCache::Initialize()+1056) (BuildId: f472bcc4d4df70dec465383a523d530a81c4b2aa)
    24. [CRASH]       #03 pc 000000000080a548  /data/app/com.vizgu.vizguunityapp-v_0OeaCBxy8oVWyiH0l9IQ==/lib/arm64/libil2cpp.so (il2cpp::vm::Runtime::Init(char const*)+412) (BuildId: f472bcc4d4df70dec465383a523d530a81c4b2aa)
    25. [CRASH]       #04 pc 000000000076070c  /data/app/com.vizgu.vizguunityapp-v_0OeaCBxy8oVWyiH0l9IQ==/lib/arm64/libil2cpp.so (il2cpp_init+44) (BuildId: f472bcc4d4df70dec465383a523d530a81c4b2aa)
    26. [CRASH]       #05 pc 0000000000632404  /data/app/com.vizgu.vizguunityapp-v_0OeaCBxy8oVWyiH0l9IQ==/lib/arm64/libunity.so (BuildId: a4066277acf9d678d139323c41d7c77750c5db31)
    27. [CRASH]       #06 pc 00000000006a242c  /data/app/com.vizgu.vizguunityapp-v_0OeaCBxy8oVWyiH0l9IQ==/lib/arm64/libunity.so (BuildId: a4066277acf9d678d139323c41d7c77750c5db31)
    28. [CRASH]       #07 pc 00000000006a2ff0  /data/app/com.vizgu.vizguunityapp-v_0OeaCBxy8oVWyiH0l9IQ==/lib/arm64/libunity.so (BuildId: a4066277acf9d678d139323c41d7c77750c5db31)
    29. [CRASH]       #08 pc 00000000006b875c  /data/app/com.vizgu.vizguunityapp-v_0OeaCBxy8oVWyiH0l9IQ==/lib/arm64/libunity.so (BuildId: a4066277acf9d678d139323c41d7c77750c5db31)
    30. [CRASH]       #09 pc 000000000013f350  /apex/com.android.runtime/lib64/libart.so (art_quick_generic_jni_trampoline+144) (BuildId: d700c52998d7d76cb39e2001d670e654)
    31. [CRASH]       #10 pc 0000000000136334  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: d700c52998d7d76cb39e2001d670e654)
    32. [CRASH]       #11 pc 0000000000144fec  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244) (BuildId: d700c52998d7d76cb39e2001d670e654)
    33. [CRASH]       #12 pc 00000000002e2928  /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+384) (BuildId: d700c52998d7d76cb39e2001d670e654)
    34. [CRASH]       #13 pc 00000000002ddb88  /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+892) (BuildId: d700c52998d7d76cb39e2001d670e654)
    35. [CRASH]       #14 pc 00000000005a2100  /apex/com.android.runtime/lib64/libart.so (MterpInvokeDirect+424) (BuildId: d700c52998d7d76cb39e2001d670e654)
    36. [CRASH]       #15 pc 0000000000130914  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: d700c52998d7d76cb39e2001d670e654)
    37. [CRASH]       #16 pc 00000000005a2b48  /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1040) (BuildId: d700c52998d7d76cb39e2001d670e654)
    38. [CRASH]       #17 pc 0000000000130994  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: d700c52998d7d76cb39e2001d670e654)
    39. [CRASH]       #18 pc 00000000005a18b8  /apex/com.android.runtime/lib64/libart.so (MterpInvokeInterface+1788) (BuildId: d700c52998d7d76cb39e2001d670e654)
    40. [CRASH]       #19 pc 0000000000130a14  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: d700c52998d7d76cb39e2001d670e654)
    41. [CRASH]       #20 pc 00000000005a0098  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1352) (BuildId: d700c52998d7d76cb39e2001d670e654)
    42. [CRASH]       #21 pc 0000000000130814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: d700c52998d7d76cb39e2001d670e654)
    43. [CRASH]       #22 pc 00000000005a2b48  /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1040) (BuildId: d700c52998d7d76cb39e2001d670e654)
    44. [CRASH]       #23 pc 0000000000130994  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: d700c52998d7d76cb39e2001d670e654)
    45. [CRASH]       #24 pc 00000000002b3c3c  /apex/com.android.runtime/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.18044833378915231953)+240) (BuildId: d700c52998d7d76cb39e2001d670e654)
    46. [CRASH]       #25 pc 0000000000591340  /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1032) (BuildId: d700c52998d7d76cb39e2001d670e654)
    47. [CRASH]       #26 pc 000000000013f468  /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: d700c52998d7d76cb39e2001d670e654)
    48. [CRASH]       #27 pc 0000000000136334  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: d700c52998d7d76cb39e2001d670e654)
    49. [CRASH]       #28 pc 0000000000144fec  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244) (BuildId: d700c52998d7d76cb39e2001d670e654)
    50. [CRASH]       #29 pc 00000000004afd44  /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104) (BuildId: d700c52998d7d76cb39e2001d670e654)
    51. [CRASH]       #30 pc 00000000004b0e58  /apex/com.android.runtime/lib64/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+416) (BuildId: d700c52998d7d76cb39e2001d670e654)
    52. [CRASH]       #31 pc 00000000004f1814  /apex/com.android.runtime/lib64/libart.so (art::Thread::CreateCallback(void*)+1176) (BuildId: d700c52998d7d76cb39e2001d670e654)
    53. [CRASH]       #32 pc 00000000000e6890  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: e55e6e4c631509598633769798683023)
    54. [CRASH]       #33 pc 0000000000084b6c  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: e55e6e4c631509598633769798683023)
     
  20. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    Yeah, something is not lining up here between the metadata that code generation thought it should emit and the metadata that the runtime actually needs. This may indeed be a bug on our side.

    I think we will need to investigate the crash from our side to learn more. I'm unsure how the Unity as as library part of this might play into the issue.
     
    Pequeno likes this.
  21. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    The bugreport has a full repro (in another version of Unity, but it should upgrade without any issues) and description on how to repro this issue. We're very close to launching our App, and this works on iOS, so I would really appreciate finding a solution soon. Is there anything I can help with, investigate or do to help?
     
  22. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    Was there a working version of the App on Android at some point in the recent past? If so, it would be great if you could bisect the cause of the issue down to some change in the Unity project or some Unity version that caused the issue. Our QA team will do the later, bisecting Unity versions with the project submitted, but you might have more specific knowledge and be able to do this faster.
     
  23. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    I have not had a completely working version at any point in time on Android, no. When I build it in our actually project, I can make Unity start in a window, interact, send messages to unity, have it download an asset bundle and show it, and it will then crash after some time (randomly it seems), or when I remove focus from the window and do another 'large' task, as long as I'm debugging. If I'm not debugging, the app just crashes at random points it seems.
    I've tried it in almost every Unity version back to the 2019 LTS. The same problem has persisted throughout in my tests, though there may have been different versions of the stack traces.
     
  24. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    If there are any issues with the repro project, I'm available to help make it work, so we can figure this out.
     
  25. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    Thanks, I think that we will need to have a look at this on our side!
     
    Pequeno likes this.
  26. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    Any news on this? I've updated the bug report with a video of how I reproduce the error (steps to build), but haven't heard anything since.
     
  27. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    It looks like our QA team is still working to reproduce this issue. I see the last update on Wednesday of this week, so I would expect you to hear back today or Monday.
     
  28. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    Still no news? Are there issues with reproducing the issue?
     
  29. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    I'm not sure, I've pinged our QA team directly about it.
     
    Pequeno likes this.
  30. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    I see there was an issue reproducing the bug. I've replied to the issue, and hope that is what was missing in their setup to make it work. Are there any news about if that issue has been resolved?
     
  31. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    Any news by now?
     
  32. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    It's a week ago, I answered the QA about reproduction steps, where they had problems, still no news?
     
  33. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
  34. Fritololo

    Fritololo

    Joined:
    Jun 7, 2021
    Posts:
    1
    @Pequeno We are also looking for setting this up with Unity. Could we contact you about this?
     
  35. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    I don't have a fix for it, so I don't see any reason to contact me specifically. But do go vote on the issuetracker, so Unity can see this is a very used feature, and a serious issue.
     
  36. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    Any news on this?
     
  37. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    Are there any news on this by now, or did Unity go on vacation?
     
  38. chan_unity

    chan_unity

    Joined:
    May 21, 2018
    Posts:
    1
    I am also having a problem with this. Eagerly awaiting news from the fine folk at Unity.
     
  39. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
    Bump - Is anything happening with this?
     
  40. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    Sorry, I don't recall which bug report this is, and I don't see the case number listed in the thread here. @Pequeno do you happen in know the case number?
     
  41. Pequeno

    Pequeno

    Joined:
    Nov 13, 2012
    Posts:
    32
  42. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936