[Unity] OpenXR crash when trying to cross-platform with meta quest

Hi,

I am trying to build a cross platform project for both Meta Quest and MagicLeap. Thing is, my app works perfectly on Meta Quest 3 before trying to add magicleap package. But as soon as I add the com.magicleap.unitysdk package, without changing anything to the scene, player settings, or manifest, the app crashes on startup (right after passthrough loads up) with the following logs :

0001/01/01 00:00:00.000 -1 -1 Info --------- beginning of crash
2024/07/05 11:03:02.313 20896 20948 Fatal libc Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1 in tid 20948 (Thread-2), pid 20896 (////////)
2024/07/05 11:03:02.619 20896 20948 Error CRASH *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2024/07/05 11:03:02.619 20896 20948 Error CRASH Version '2022.3.12f1 (4fe6e059c7ef)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
2024/07/05 11:03:02.619 20896 20948 Error CRASH Build fingerprint: 'oculus/eureka/eureka:12/SQ3A.220605.009.A1/50105210073900510:user/release-keys'
2024/07/05 11:03:02.619 20896 20948 Error CRASH Revision: '0'
2024/07/05 11:03:02.619 20896 20948 Error CRASH ABI: 'arm64'
2024/07/05 11:03:02.619 20896 20948 Error CRASH Timestamp: 2024-07-05 11:03:02.619833251+0200
2024/07/05 11:03:02.619 20896 20948 Error CRASH pid: 20896, tid: 20948, name: Thread-2 >>> /////////////////// <<<
2024/07/05 11:03:02.619 20896 20948 Error CRASH uid: 10401
2024/07/05 11:03:02.619 20896 20948 Error CRASH signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr --------
2024/07/05 11:03:02.619 20896 20948 Error CRASH Cause: null pointer dereference
2024/07/05 11:03:02.619 20896 20948 Error CRASH x0 00000000fffffff4 x1 0000000000000000 x2 0000007e3a24a140 x3 0000007d0101f3f0
2024/07/05 11:03:02.619 20896 20948 Error CRASH x4 0000000000000000 x5 00000000000a4876 x6 30322d312f39322f x7 7f7f7f7f7f7f7f7f
2024/07/05 11:03:02.619 20896 20948 Error CRASH x8 0000000000000001 x9 0000000000000001 x10 0000000000000001 x11 0000000000e10000
2024/07/05 11:03:02.619 20896 20948 Error CRASH x12 0000007e3a24a140 x13 0000000000000001 x14 0000000000000003 x15 000000072aed0198
2024/07/05 11:03:02.619 20896 20948 Error CRASH x16 0000007ec898ece8 x17 0000007ec897f29c x18 0000007cefaf6000 x19 b400007da4fc6bf8
2024/07/05 11:03:02.619 20896 20948 Error CRASH x20 b400007da4fc6c70 x21 b400007da4fc6c78 x22 b400007da4fc6c98 x23 b400007da4fc6c60
2024/07/05 11:03:02.619 20896 20948 Error CRASH x24 000000000000000f x25 b400007da52a3580 x26 0000007d001fbcc0 x27 0000007cf000018c
2024/07/05 11:03:02.619 20896 20948 Error CRASH x28 0000007d001fbcc0 x29 0000007d001fb7f0
2024/07/05 11:03:02.619 20896 20948 Error CRASH lr 0000007d01354b1c sp 0000007d001fb1f0 pc 0000007d01354b28 pst 0000000080001000
2024/07/05 11:03:02.619 20896 20948 Error CRASH backtrace:
2024/07/05 11:03:02.619 20896 20948 Error CRASH #00 pc 0000000000090b28 /data/app/~~51lQIrNgpQzy8v8KfiWnKw==///////////////////////////////////-nCU9YkFTsPz8zP23z2ePnQ==/lib/arm64/libUnityOpenXR.so (BuildId: 80e0b02d1d1625434890497e73eaaeb25b1fea15)
2024/07/05 11:03:02.619 20896 20948 Error CRASH #01 pc 000000000005564c /data/app/~~51lQIrNgpQzy8v8KfiWnKw==///////////////////////////////////-nCU9YkFTsPz8zP23z2ePnQ==/lib/arm64/libUnityOpenXR.so (BuildId: 80e0b02d1d1625434890497e73eaaeb25b1fea15)
2024/07/05 11:03:02.619 20896 20948 Error CRASH #02 pc 00000000000581ac /data/app/~~51lQIrNgpQzy8v8KfiWnKw==///////////////////////////////////-nCU9YkFTsPz8zP23z2ePnQ==/lib/arm64/libUnityOpenXR.so (BuildId: 80e0b02d1d1625434890497e73eaaeb25b1fea15)
2024/07/05 11:03:02.619 20896 20948 Error CRASH #03 pc 000000000098623c /data/app/~~51lQIrNgpQzy8v8KfiWnKw==///////////////////////////////////-nCU9YkFTsPz8zP23z2ePnQ==/lib/arm64/libunity.so (BuildId: 973973a0835afbe9)
2024/07/05 11:03:02.619 20896 20948 Error CRASH #04 pc 0000000000abd590 /data/app/~~51lQIrNgpQzy8v8KfiWnKw==///////////////////////////////////-nCU9YkFTsPz8zP23z2ePnQ==/lib/arm64/libunity.so (BuildId: 973973a0835afbe9)
2024/07/05 11:03:02.619 20896 20948 Error CRASH #05 pc 0000000000c61254 /data/app/~~51lQIrNgpQzy8v8KfiWnKw==///////////////////////////////////-nCU9YkFTsPz8zP23z2ePnQ==/lib/arm64/libunity.so (BuildId: 973973a0835afbe9)
2024/07/05 11:03:02.619 20896 20948 Error CRASH #06 pc 0000000000c59514 /data/app/~~51lQIrNgpQzy8v8KfiWnKw==///////////////////////////////////-nCU9YkFTsPz8zP23z2ePnQ==/lib/arm64/libunity.so (BuildId: 973973a0835afbe9)
2024/07/05 11:03:02.620 20896 20948 Error CRASH #07 pc 0000000000c5925c /data/app/~~51lQIrNgpQzy8v8KfiWnKw==///////////////////////////////////-nCU9YkFTsPz8zP23z2ePnQ==/lib/arm64/libunity.so (BuildId: 973973a0835afbe9)
2024/07/05 11:03:02.620 20896 20948 Error CRASH #08 pc 00000000005a5014 /data/app/~~51lQIrNgpQzy8v8KfiWnKw==////////////////////////////////////-nCU9YkFTsPz8zP23z2ePnQ==/lib/arm64/libunity.so (BuildId: 973973a0835afbe9)
2024/07/05 11:03:02.620 20896 20948 Error CRASH #09 pc 00000000000dffd0 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+132) (BuildId: f3ddd3149abda19010fe3f4a2be24415)
2024/07/05 11:03:02.620 20896 20948 Error CRASH #10 pc 000000000008c55c /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: f3ddd3149abda19010fe3f4a2be24415)
2024/07/05 11:03:02.779 20896 20948 Error CRASH Forwarding signal 11
2024/07/05 11:03:02.779 20896 20948 Fatal libc Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1 in tid 20948 (Thread-2), pid 20896 (////////////////////)

I know Quest 3 and MagicLeap2 aren't supposed to be in the same project, but I feel like it is that close to work. Mind that I've posted the same question to the Meta forums in hope to have a workaround.

Thanks

(Other packages installed : Meta XR All-In-One SDK, MRTK3, OpenXR-meta)

Unity Editor version: 2022.3.12f1
Unity SDK version: 2.2.0
Host OS: Windows

Hi @Sashell
I think the problem is that the android plugins are going to be mutually exclusive due to the different architectures. Quest is an ARM64 chipset, whereas MagicLeap is a x86-64 chipset. I don't know that there is a clean work around for this other than separate branches.
-Sidney

Hi,

After debugging, i foudn out that the magicleap sdk forces my unity openxr plugin package to update from 1.8.2 (the one installed by MRTK3) to 1.10.0.

So i've tried running the app on quest without magicleap sdk but with openxr plugin 1.10.0 instead of 1.8.2, and : it crashes.

So the issue comes from MRTK3 + openXR version with meta support i guess ?

My question is (i'm working on meta and MRTK side but i'll consider every parallel lead), is there a magicleap sdk version that works with openxr 1.8.2 ?

thanks

Unfortunately I cannot speak to Quest compatibility, but for MRTK3 and OpenXR you will need to use ML2 Unity SDK ver 2.1.0 or higher MRTK Dependency Matrix | MagicLeap Developer Documentation
The 1.8.2 Unity openXR plugin is also quite old, I do not believe we support it.
We do recommend using the latest available OS and SDK

1 Like

Thanks.

Update : forcing OpenXR plugin to v.1.11.0 (package manager didn't notify me about an update being available) seems to have solved the issue.