Search Unity

Bug SegFault in XRCpuImage.Convert

Discussion in 'AR' started by J_Kost, Sep 7, 2021.

  1. J_Kost

    J_Kost

    Joined:
    Feb 16, 2021
    Posts:
    32
    I am developing an App for android that switches between camera configurations in the ARCameraManager at runtime and uses the full resolution image from the current XRCpuImage. This XRCpuImage is obtained using TryAcquireLatestCpuImage in SampleFrame() (see code below), which is called on each Application.onBeforeRender.
    I am running into SegFaults that I don't understand. I don't believe that I am allocating the wrong buffer sizes and I am not receiving buffer size related exceptions from Convert() itself:
    convert_schreenshot.PNG
    So I think this might quite possibly be a bug. I would be grateful if you could take a look at the issue description, code and logs below and help me figure out how to best tackle this issue.

    Issue
    :
    App crashes with SIGSEGV; SEGV_MAPERR (Mono) or SEGV_ACCERR (IL2CPP) when trying to Convert() from XRCpuImages while running camera configurations with resolutions other than 640x480.
    Crashes occur when using any camera configuration with a resolution other than 640x480. They can occur right away (after the first few new frames), some time later or not at all. They are generally reproducible and happen the majority of times within 10s of starting to actually run SampleFrame() past the first if() block.

    Affected code:

    Registered to
    Application.onBeforeRender
    using:
    Application.onBeforeRender += SampleFrame;

    Code (CSharp):
    1. private void SampleFrame()
    2. {
    3.     if (... skip cases here are irrelevant to the issue ...)
    4.     {
    5.         //sometimes the following code is skipped
    6.         return;
    7.     }
    8.     XRCameraIntrinsics intrinsics;
    9.     if (!this.cameraManager.TryGetIntrinsics(out intrinsics))
    10.     {
    11.         return;
    12.     }
    13.     XRCpuImage image;
    14.     if (!this.cameraManager.TryAcquireLatestCpuImage(out image))
    15.     {
    16.         return;
    17.     }
    18.     frameNumber += 1;
    19.     try
    20.     {
    21.         EmitFullCPUImage(image, frameNumber); //CRASHES HERE, SEE CODE BELOW
    22.     }
    23.     catch (InvalidOperationException e)
    24.     {
    25.         image.Dispose();
    26.         if (e.Source == "ARFoundationRemote.Editor")
    27.         {
    28.             Debug.LogWarning(e);
    29.         }
    30.         else
    31.         {
    32.             //unexpected exception. throw so I notice this.
    33.             throw e;
    34.         }
    35.         return;
    36.     }
    37.     ... some more things that don't matter ...
    38. }
    Code (CSharp):
    1.         unsafe void EmitFullCPUImage(XRCpuImage image, int frameNumber)
    2.         {
    3.             Texture2D texture = null;
    4.             TextureFormat format = TextureFormat.RGBA32;
    5.             XRCpuImage.ConversionParams conversionParams = new XRCpuImage.ConversionParams(
    6.                 image, format, XRCpuImage.Transformation.MirrorX);
    7.             conversionParams.outputDimensions = new Vector2Int(image.width, image.height);
    8.             int size = image.GetConvertedDataSize(conversionParams);
    9.             NativeArray<byte> buffer = new NativeArray<byte>(size, Allocator.Persistent);
    10.             //CRASHES HERE, SEE LOGS BELOW
    11.             image.Convert(conversionParams, new IntPtr(buffer.GetUnsafePtr()), buffer.Length); // <<<
    12.             texture = new Texture2D(
    13.                 conversionParams.outputDimensions.x,
    14.                 conversionParams.outputDimensions.y,
    15.                 conversionParams.outputFormat,
    16.                 false);
    17.             texture.LoadRawTextureData(buffer);
    18.             texture.Apply();
    19.        
    20.             buffer.Dispose();
    21.             //emit frame
    22.             OnNewCPUimage?.Invoke(texture, frameNumber);
    23.         }
    Attempted Workarounds (unsuccessful):
    1. Configuring player settings as recommended for ARFoundation in the ARCore Documentation.
      Including switching the scripting backend from Mono to IL2CPP & enabling ARM64
      Capture.PNG
    2. Built & ran on different phone using IL2CPP.
    Error logs from LogCat:
    --------------------Mono --------------------
    09-05 18:40:48.534: E/mono-rt(24906): =================================================================
    09-05 18:40:48.534: E/mono-rt(24906): Got a SIGSEGV while executing native code. This usually indicates
    09-05 18:40:48.534: E/mono-rt(24906): a fatal error in the mono runtime or one of the native libraries
    09-05 18:40:48.534: E/mono-rt(24906): used by your application.
    09-05 18:40:48.534: E/mono-rt(24906): =================================================================
    09-05 18:40:48.561: E/CRASH(24906): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    09-05 18:40:48.561: E/CRASH(24906): Version '2020.3.13f1 (71691879b7f5)', Build type 'Development', Scripting Backend 'mono', CPU 'armeabi-v7a'
    09-05 18:40:48.561: E/CRASH(24906): Build fingerprint: 'motorola/odessa_retaile/odessa:10/QPAS30.19-Q3-32-50-7/62c2e:user/release-keys'
    09-05 18:40:48.561: E/CRASH(24906): Revision: 'pvt'
    09-05 18:40:48.561: E/CRASH(24906): ABI: 'arm'
    09-05 18:40:48.561: E/CRASH(24906): Timestamp: 2021-09-05 18:40:48+0200
    09-05 18:40:48.561: E/CRASH(24906): pid: 24906, tid: 24933, name: UnityMain >>> com.DefaultCompany.AR_Foundation_Protoype <<<
    09-05 18:40:48.561: E/CRASH(24906): uid: 10397
    09-05 18:40:48.561: E/CRASH(24906): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x9b0c0703
    09-05 18:40:48.561: E/CRASH(24906): r0 00000000 r1 00000000 r2 00000000 r3 000000ff
    09-05 18:40:48.561: E/CRASH(24906): r4 00000662 r5 00000000 r6 9fffb854 r7 00000812
    09-05 18:40:48.561: E/CRASH(24906): r8 9b0c0700 r9 0003ffff r10 00000001 r11 000004a8
    09-05 18:40:48.561: E/CRASH(24906): ip 00000280 sp c727a890 lr b4625414 pc b4625458
    09-05 18:40:48.561: E/CRASH(24906): backtrace:
    09-05 18:40:48.561: E/CRASH(24906): #00 pc 00019458 /data/app/com.DefaultCompany.AR_Foundation_Protoype-Yfb2GthwAXrf3oXIb8rl3A==/lib/arm/libUnityARCore.so (BuildId: 87ad8fc07fd03af69b94102f8ab57a29170ed30c)
    09-05 18:40:48.561: E/CRASH(24906): #01 pc 000166b8 /data/app/com.DefaultCompany.AR_Foundation_Protoype-Yfb2GthwAXrf3oXIb8rl3A==/lib/arm/libUnityARCore.so (BuildId: 87ad8fc07fd03af69b94102f8ab57a29170ed30c)
    09-05 18:40:48.561: E/CRASH(24906): #02 pc 0000fcd0 /data/app/com.DefaultCompany.AR_Foundation_Protoype-Yfb2GthwAXrf3oXIb8rl3A==/lib/arm/libUnityARCore.so (BuildId: 87ad8fc07fd03af69b94102f8ab57a29170ed30c)
    09-05 18:40:48.561: E/CRASH(24906): #03 pc 0000f210 /data/app/com.DefaultCompany.AR_Foundation_Protoype-Yfb2GthwAXrf3oXIb8rl3A==/lib/arm/libUnityARCore.so (CameraImageApi::TryConvertImage(CameraImageApi::ImageData const&, CameraImageApi::ConversionParams const&, unsigned char*, int, bool)+552) (BuildId: 87ad8fc07fd03af69b94102f8ab57a29170ed30c)
    09-05 18:40:48.561: E/CRASH(24906): #04 pc 0000ec50 /data/app/com.DefaultCompany.AR_Foundation_Protoype-Yfb2GthwAXrf3oXIb8rl3A==/lib/arm/libUnityARCore.so (CameraImageApi::TryConvertImage(CameraImageApi::Handle<int, CameraImageApi::Image>, CameraImageApi::ConversionParams const&, unsigned char*, int)+52) (BuildId: 87ad8fc07fd03af69b94102f8ab57a29170ed30c)
    09-05 18:40:48.561: E/CRASH(24906): #05 pc 0002218c /data/app/com.DefaultCompany.AR_Foundation_Protoype-Yfb2GthwAXrf3oXIb8rl3A==/lib/arm/libUnityARCore.so (UnityARCore_Camera_TryConvert+60) (BuildId: 87ad8fc07fd03af69b94102f8ab57a29170ed30c)
    09-05 18:40:48.561: E/CRASH(24906): #06 pc 0000406e <anonymous:a9cd2000>
    09-05 18:40:48.561: E/CRASH(24906): managed backtrace:
    09-05 18:40:48.561: E/CRASH(24906): #00 (wrapper managed-to-native) UnityEngine.XR.ARCore.ARCoreCameraSubsystem/NativeApi:UnityARCore_Camera_TryConvert (int,UnityEngine.XR.ARSubsystems.XRCpuImage/ConversionParams,intptr,int)
    09-05 18:40:48.561: E/CRASH(24906): #01 UnityEngine.XR.ARCore.ARCoreCameraSubsystem/ARCoreCpuImageApi:TryConvert (int,UnityEngine.XR.ARSubsystems.XRCpuImage/ConversionParams,intptr,int) <C:\Users\U6JAKOST\unityFoo\AR_Foundation_Protoype\Library\PackageCache\com.unity.xr.arcore@4.0.12\Runtime\ARCoreCameraSubsystem.cs:507>
    09-05 18:40:48.561: E/CRASH(24906): #02 UnityEngine.XR.ARSubsystems.XRCpuImage:Convert (UnityEngine.XR.ARSubsystems.XRCpuImage/ConversionParams,intptr,int) <C:\Users\U6JAKOST\unityFoo\AR_Foundation_Protoype\Library\PackageCache\com.unity.xr.arsubsystems@4.1.7\Runtime\XRCpuImage\XRCpuImage.cs:357>
    09-05 18:40:48.561: E/CRASH(24906): #03 Visometry.VisionLib.SDK.ARFoundation.XRCamera:EmitFullCPUImage (UnityEngine.XR.ARSubsystems.XRCpuImage,int) <C:\Users\U6JAKOST\unityFoo\AR_Foundation_Protoype\Library\PackageCache\com.visometry.visionlib.sdk.arfoundation@b13bc49e60f7-1626882011948\Scripts\XRCamera.cs:112>
    09-05 18:40:48.561: E/CRASH(24906): #04 Visometry.VisionLib.SDK.ARFoundation.XRCamera:SampleFrame () <C:\Users\U6JAKOST\unityFoo\AR_Foundation_Protoype\Library\PackageCache\com.visometry.visionlib.sdk.arfoundation@b13bc49e60f7-1626882011948\Scripts\XRCamera.cs:173>

    09-05 18:40:48.562: E/CRASH(24906): #05 (wrapper delegate-invoke) <Module>:invoke_void ()
    09-05 18:40:48.562: E/CRASH(24906): #06 UnityEngine.BeforeRenderHelper:Invoke () </Users/bokken/buildslave/unity/build/Runtime/Export/Graphics/BeforeRenderHelper.cs:92>
    09-05 18:40:48.562: E/CRASH(24906): #07 UnityEngine.Application:InvokeOnBeforeRender () </Users/bokken/buildslave/unity/build/Runtime/Export/Application/Application.cs:314>
    09-05 18:40:48.562: E/CRASH(24906): #08 (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
    09-05 18:40:48.567: E/CRASH(24906): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    09-05 18:40:48.567: E/CRASH(24906): Version '2020.3.13f1 (71691879b7f5)', Build type 'Development', Scripting Backend 'mono', CPU 'armeabi-v7a'
    09-05 18:40:48.567: E/CRASH(24906): Build fingerprint: 'motorola/odessa_retaile/odessa:10/QPAS30.19-Q3-32-50-7/62c2e:user/release-keys'
    09-05 18:40:48.567: E/CRASH(24906): Revision: 'pvt'
    09-05 18:40:48.567: E/CRASH(24906): ABI: 'arm'
    09-05 18:40:48.567: E/CRASH(24906): Timestamp: 2021-09-05 18:40:48+0200
    09-05 18:40:48.567: E/CRASH(24906): pid: 24906, tid: 25178, name: UnityMain >>> com.DefaultCompany.AR_Foundation_Protoype <<<
    09-05 18:40:48.567: E/CRASH(24906): uid: 10397
    09-05 18:40:48.567: E/CRASH(24906): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8ccd0000
    09-05 18:40:48.567: E/CRASH(24906): r0 00000071 r1 00000000 r2 8ccd0000 r3 8ccd0001
    09-05 18:40:48.567: E/CRASH(24906): r4 00000662 r5 00000000 r6 9fffb854 r7 00000812
    09-05 18:40:48.567: E/CRASH(24906): r8 9b0b1700 r9 0003ffff r10 00000001 r11 000004a8
    09-05 18:40:48.567: E/CRASH(24906): ip 00000280 sp 9e8ab188 lr b4625414 pc b4625448
    09-05 18:40:48.567: E/CRASH(24906): backtrace:
    09-05 18:40:48.567: E/CRASH(24906): #00 pc 00019448 /data/app/com.DefaultCompany.AR_Foundation_Protoype-Yfb2GthwAXrf3oXIb8rl3A==/lib/arm/libUnityARCore.so (BuildId: 87ad8fc07fd03af69b94102f8ab57a29170ed30c)
    09-05 18:40:48.567: E/CRASH(24906): #01 pc 00017268 /data/app/com.DefaultCompany.AR_Foundation_Protoype-Yfb2GthwAXrf3oXIb8rl3A==/lib/arm/libUnityARCore.so (BuildId: 87ad8fc07fd03af69b94102f8ab57a29170ed30c)
    09-05 18:40:48.567: E/CRASH(24906): #02 pc 000301eb /data/app/com.DefaultCompany.AR_Foundation_Protoype-Yfb2GthwAXrf3oXIb8rl3A==/lib/arm/libUnityARCore.so (BuildId: 87ad8fc07fd03af69b94102f8ab57a29170ed30c)
    09-05 18:40:48.567: E/CRASH(24906): #03 pc 000a6137 /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+20) (BuildId: e34a88191293e6b428ddfb3fe432fbc6)
    09-05 18:40:48.567: E/CRASH(24906): #04 pc 00060141 /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) (BuildId: e34a88191293e6b428ddfb3fe432fbc6)
    09-05 18:40:48.568: E/CRASH(24906): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    09-05 18:40:48.568: E/CRASH(24906): Version '2020.3.13f1 (71691879b7f5)', Build type 'Development', Scripting Backend 'mono', CPU 'armeabi-v7a'
    09-05 18:40:48.568: E/CRASH(24906): Build fingerprint: 'motorola/odessa_retaile/odessa:10/QPAS30.19-Q3-32-50-7/62c2e:user/release-keys'
    09-05 18:40:48.568: E/CRASH(24906): Revision: 'pvt'
    09-05 18:40:48.568: E/CRASH(24906): ABI: 'arm'
    09-05 18:40:48.568: E/CRASH(24906): Timestamp: 2021-09-05 18:40:48+0200
    09-05 18:40:48.568: E/CRASH(24906): pid: 24906, tid: 25179, name: UnityMain >>> com.DefaultCompany.AR_Foundation_Protoype <<<
    09-05 18:40:48.568: E/CRASH(24906): uid: 10397
    09-05 18:40:48.568: E/CRASH(24906): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8ccd2800
    09-05 18:40:48.568: E/CRASH(24906): r0 00000076 r1 00000000 r2 8ccd2800 r3 8ccd2801
    09-05 18:40:48.568: E/CRASH(24906): r4 00000662 r5 00000000 r6 9fffb854 r7 00000812
    09-05 18:40:48.568: E/CRASH(24906): r8 9b0ac700 r9 0003ffff r10 00000001 r11 000004a8
    09-05 18:40:48.568: E/CRASH(24906): ip 00000280 sp 9e7aa188 lr b4625414 pc b4625448
    09-05 18:40:48.568: E/CRASH(24906): backtrace:
    09-05 18:40:48.568: E/CRASH(24906): #00 pc 00019448 /data/app/com.DefaultCompany.AR_Foundation_Protoype-Yfb2GthwAXrf3oXIb8rl3A==/lib/arm/libUnityARCore.so (BuildId: 87ad8fc07fd03af69b94102f8ab57a29170ed30c)
    09-05 18:40:48.568: E/CRASH(24906): #01 pc 00017268 /data/app/com.DefaultCompany.AR_Foundation_Protoype-Yfb2GthwAXrf3oXIb8rl3A==/lib/arm/libUnityARCore.so (BuildId: 87ad8fc07fd03af69b94102f8ab57a29170ed30c)
    09-05 18:40:48.568: E/CRASH(24906): #02 pc 000301eb /data/app/com.DefaultCompany.AR_Foundation_Protoype-Yfb2GthwAXrf3oXIb8rl3A==/lib/arm/libUnityARCore.so (BuildId: 87ad8fc07fd03af69b94102f8ab57a29170ed30c)
    09-05 18:40:48.568: E/CRASH(24906): #03 pc 000a6137 /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+20) (BuildId: e34a88191293e6b428ddfb3fe432fbc6)
    09-05 18:40:48.568: E/CRASH(24906): #04 pc 00060141 /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) (BuildId: e34a88191293e6b428ddfb3fe432fbc6)

    Error Logs from Tombstones:

    --------------------Mono --------------------
    *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    Version '2020.3.13f1 (71691879b7f5)', Build type 'Development', Scripting Backend 'mono', CPU 'armeabi-v7a'
    Build fingerprint: 'motorola/odessa_retaile/odessa:10/QPAS30.19-Q3-32-50-7/62c2e:user/release-keys'
    Revision: 'pvt'
    ABI: 'arm'
    Timestamp: 2021-09-05 18:40:48+0200
    pid: 24906, tid: 24933, name: UnityMain >>> com.DefaultCompany.AR_Foundation_Protoype <<<
    uid: 10397
    signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x9b0c0703
    r0 00000000 r1 00000000 r2 00000000 r3 000000ff
    r4 00000662 r5 00000000 r6 9fffb854 r7 00000812
    r8 9b0c0700 r9 0003ffff r10 00000001 r11 000004a8
    ip 00000280 sp c727a890 lr b4625414 pc b4625458

    backtrace:
    #00 pc 00019458 /data/app/com.DefaultCompany.AR_Foundation_Protoype-Yfb2GthwAXrf3oXIb8rl3A==/lib/arm/libUnityARCore.so (BuildId: 87ad8fc07fd03af69b94102f8ab57a29170ed30c)
    #01 pc 000166b8 /data/app/com.DefaultCompany.AR_Foundation_Protoype-Yfb2GthwAXrf3oXIb8rl3A==/lib/arm/libUnityARCore.so (BuildId: 87ad8fc07fd03af69b94102f8ab57a29170ed30c)
    #02 pc 0000fcd0 /data/app/com.DefaultCompany.AR_Foundation_Protoype-Yfb2GthwAXrf3oXIb8rl3A==/lib/arm/libUnityARCore.so (BuildId: 87ad8fc07fd03af69b94102f8ab57a29170ed30c)
    #03 pc 0000f210 /data/app/com.DefaultCompany.AR_Foundation_Protoype-Yfb2GthwAXrf3oXIb8rl3A==/lib/arm/libUnityARCore.so (CameraImageApi::TryConvertImage(CameraImageApi::ImageData const&, CameraImageApi::ConversionParams const&, unsigned char*, int, bool)+552) (BuildId: 87ad8fc07fd03af69b94102f8ab57a29170ed30c)
    #04 pc 0000ec50 /data/app/com.DefaultCompany.AR_Foundation_Protoype-Yfb2GthwAXrf3oXIb8rl3A==/lib/arm/libUnityARCore.so (CameraImageApi::TryConvertImage(CameraImageApi::Handle<int, CameraImageApi::Image>, CameraImageApi::ConversionParams const&, unsigned char*, int)+52) (BuildId: 87ad8fc07fd03af69b94102f8ab57a29170ed30c)
    #05 pc 0002218c /data/app/com.DefaultCompany.AR_Foundation_Protoype-Yfb2GthwAXrf3oXIb8rl3A==/lib/arm/libUnityARCore.so (UnityARCore_Camera_TryConvert+60) (BuildId: 87ad8fc07fd03af69b94102f8ab57a29170ed30c)
    #06 pc 0000406e <anonymous:a9cd2000>

    managed backtrace:
    #00 (wrapper managed-to-native) UnityEngine.XR.ARCore.ARCoreCameraSubsystem/NativeApi:UnityARCore_Camera_TryConvert (int,UnityEngine.XR.ARSubsystems.XRCpuImage/ConversionParams,intptr,int)
    #01 UnityEngine.XR.ARCore.ARCoreCameraSubsystem/ARCoreCpuImageApi:TryConvert (int,UnityEngine.XR.ARSubsystems.XRCpuImage/ConversionParams,intptr,int) <C:\Users\U6JAKOST\unityFoo\AR_Foundation_Protoype\Library\PackageCache\com.unity.xr.arcore@4.0.12\Runtime\ARCoreCameraSubsystem.cs:507>
    #02 UnityEngine.XR.ARSubsystems.XRCpuImage:Convert (UnityEngine.XR.ARSubsystems.XRCpuImage/ConversionParams,intptr,int) <C:\Users\U6JAKOST\unityFoo\AR_Foundation_Protoype\Library\PackageCache\com.unity.xr.arsubsystems@4.1.7\Runtime\XRCpuImage\XRCpuImage.cs:357>
    #03 Visometry.VisionLib.SDK.ARFoundation.XRCamera:EmitFullCPUImage (UnityEngine.XR.ARSubsystems.XRCpuImage,int)
    <C:\Users\U6JAKOST\unityFoo\AR_Foundation_Protoype\Library\PackageCache\com.visometry.visionlib.sdk.arfoundation@b13bc49e60f7-1626882011948\Scripts\XRCamera.cs:112>
    #04 Visometry.VisionLib.SDK.ARFoundation.XRCamera:SampleFrame () <C:\Users\U6JAKOST\unityFoo\AR_Foundation_Protoype\Library\PackageCache\com.visometry.visionlib.sdk.arfoundation@b13bc49e60f7-1626882011948\Scripts\XRCamera.cs:173>
    #05 (wrapper delegate-invoke) <Module>:invoke_void ()
    #06 UnityEngine.BeforeRenderHelper:Invoke () </Users/bokken/buildslave/unity/build/Runtime/Export/Graphics/BeforeRenderHelper.cs:92>
    #07 UnityEngine.Application:InvokeOnBeforeRender () </Users/bokken/buildslave/unity/build/Runtime/Export/Application/Application.cs:314>
    #08 (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)

    stack:
    c727a850 ffffffff
    c727a854 00000000
    c727a858 00001000
    c727a85c 00000000
    ... etc
    --------------------IL2CPP ------------------
    *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    Version '2020.3.13f1 (71691879b7f5)', Build type 'Development', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
    Build fingerprint: 'samsung/y2sxeea/y2s:10/QP1A.190711.020/G986BXXU3ATG4:user/release-keys'
    Revision: '22'
    ABI: 'arm64'
    Timestamp: 2021-09-07 14:18:33+0200
    pid: 25257, tid: 25292, name: UnityMain >>> com.DefaultCompany.AR_Foundation_Protoype <<<
    uid: 10267
    signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x6fe03fa6a0
    x0 000000715147c090 x1 00000071531cc4a0 x2 0000007151479020 x3 0000000000000000
    x4 0000000000000000 x5 0000000000000000 x6 00000070df3c8d58 x7 00000070df4227f0
    x8 0000006fe03fa6a0 x9 0000006fe03fa6a0 x10 0000000000000800 x11 000000000715106b
    x12 00000000000054c7 x13 00000070dfde4520 x14 00000070dfde44e0 x15 00000070dfde3ea0
    x16 00000070dfde4518 x17 00000070de9453f5 x18 00000070dfdb4080 x19 00000070df43baf0
    x20 00000070df3c9630 x21 00000070df446d10 x22 00000070df43baf8 x23 00000070df442520
    x24 00000070df448128 x25 00000070dfdca806 x26 00000070df422758 x27 00000070df422758
    x28 00000070df43f8c0 x29 00000071531cc550
    sp 00000071531cc260 lr 00000070de4ffa08 pc 00000070de4ffe08

    backtrace:
    #00 pc 00000000046dbe08 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (GC_mark_from+1560) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #01 pc 00000000046d5b90 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (GC_mark_some+912) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #02 pc 00000000046d56d0 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (GC_collect_a_little_inner+244) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #03 pc 00000000046d8934 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (GC_allocobj+264) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #04 pc 00000000046ced04 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (GC_generic_malloc_inner+656) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #05 pc 00000000046d8eec /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (GC_generic_malloc+288) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #06 pc 00000000046dd4f8 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (GC_malloc_kind_global+528) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #07 pc 00000000046dd530 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (GC_malloc_kind+28) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #08 pc 00000000046d91d8 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (GC_malloc_atomic+24) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #09 pc 000000000460b554 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (il2cpp::vm::Object::AllocatePtrFree(unsigned long, Il2CppClass*)+76) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #10 pc 000000000460b25c /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (il2cpp::vm::Array::NewSpecific(Il2CppClass*, unsigned long)+628) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #11 pc 000000000474dbe0 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (SZArrayNew(Il2CppClass*, unsigned int)+36) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #12 pc 0000000003d6253c /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (StringBuilder__ctor_m973465AB5F1591B478FF881D5B9DBC47224F7FBC+2212) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #13 pc 0000000003d61b8c /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (StringBuilder__ctor_mE87B9746FC40A7ECC0149A24685BD0713459FAF1+660) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #14 pc 0000000003d2c404 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (StringBuilder__ctor_mEDFFE2D378A15F6DAB54D52661C84C1B52E7BA2E+240) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #15 pc 00000000014b9100 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (StackTraceUtility_ExtractFormattedStackTrace_m956907F6BE8EFF9BE9847275406FFBBB5FE7F093+4492) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #16 pc 00000000014b7ebc /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (StackTraceUtility_ExtractStackTrace_mDD5E4AEC754FEB52C9FFA3B0675E57088B425EC6+1928) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #17 pc 000000000080c634 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (RuntimeInvoker_FalseRuntimeObject(void (*)(), MethodInfo const*, void*, void**)+48) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #18 pc 0000000004646778 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**)+376) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #19 pc 000000000456ba7c /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (il2cpp_runtime_invoke+132) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #20 pc 0000000000609f48 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libunity.so (ExtractStacktrace(core::basic_string_ref<char>, core::basic_string<char, core::StringStorageDefault<char> >&, core::basic_string<char, core::StringStorageDefault<char> >&, core::basic_string<char, core::StringStorageDefault<char> > const&, int*, int*, int, int, bool)+232) (BuildId: 56fd029cc210940f4b6f2242f03359d353c1cf91)
    #21 pc 0000000000a70020 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libunity.so (DebugStringToFile(DebugStringToFileData const&)+456) (BuildId: 56fd029cc210940f4b6f2242f03359d353c1cf91)
    #22 pc 00000000006e4aa4 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libunity.so (DebugLogHandler::Internal_Log(LogType, LogOption, core::basic_string<char, core::StringStorageDefault<char> >, Object*)+152) (BuildId: 56fd029cc210940f4b6f2242f03359d353c1cf91)
    #23 pc 00000000006e49c8 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libunity.so (DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*)+332) (BuildId: 56fd029cc210940f4b6f2242f03359d353c1cf91)
    #24 pc 0000000001fa4a14 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (DebugLogHandler_Internal_Log_mA1D09B6E813ABFAB6358863B6C2D28E3ACA9E101+116) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #25 pc 0000000001fa4cac /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (DebugLogHandler_LogFormat_mB876FBE8959FC3D9E9950527A82936F779F7A00C+532) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #26 pc 0000000001f9fdcc /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (InterfaceActionInvoker4<int, Object_tF2F3778131EFF286AF62B7B013A170F95A91571A*, String_t*, ObjectU5BU5D_tC1F4EE0DB0B7300255F5FD4AF64FE4C585CF5ADE*>::Invoke(unsigned short, Il2CppClass*, Il2CppObject*, int, Object_tF2F3778131EFF286AF62B7B013A170F95A91571A*, String_t*, ObjectU5BU5D_tC1F4EE0DB0B7300255F5FD4AF64FE4C585CF5ADE*)+860) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #27 pc 0000000001fc8ec4 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (Logger_Log_mBAF75BD87C8B66198F52DEFF72132C42CA369881+1444) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #28 pc 00000000017c4c68 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (InterfaceActionInvoker2<int, Il2CppObject*>::Invoke(unsigned short, Il2CppClass*, Il2CppObject*, int, Il2CppObject*)+844) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #29 pc 0000000001f9daa4 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (Debug_Log_mC26E5AD0D8D156C7FFD173AA15827F69225E9DB8+1120) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)

    #30 pc 000000000431852c /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (XRCamera_EmitFullCPUImage_m86BC3ED12CCBFD38845FB221BE220989B5AF0EE9+5420) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #31 pc 000000000431a1c0 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (XRCamera_SampleFrame_m0707910218B213CA02D8F63B20FEA88C46C746C2+3084) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)

    #32 pc 00000000014f1180 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (UnityAction_Invoke_mFFF1FFE59D8285F8A81350E6D5C4D791F44F6AC9+548) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #33 pc 0000000001f676b8 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (BeforeRenderHelper_Invoke_m30EA54023BDAB65766E9B5FD6FC90E92D75A7026+1780) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #34 pc 0000000001f66f68 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (Application_InvokeOnBeforeRender_mB7267D4900392FD7E09E15DF3F6CE1C15E6598F9+484) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #35 pc 000000000080cf74 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (RuntimeInvoker_FalseVoid_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5(void (*)(), MethodInfo const*, void*, void**)+56) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #36 pc 0000000004646778 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**)+376) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #37 pc 000000000456ba7c /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libil2cpp.so (il2cpp_runtime_invoke+132) (BuildId: 589987395bcb93d7412074283ff95095467bf5e0)
    #38 pc 0000000000609bf0 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libunity.so (scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool)+164) (BuildId: 56fd029cc210940f4b6f2242f03359d353c1cf91)
    #39 pc 000000000061a678 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libunity.so (ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)+156) (BuildId: 56fd029cc210940f4b6f2242f03359d353c1cf91)
    #40 pc 00000000003fc54c /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libunity.so (BuildId: 56fd029cc210940f4b6f2242f03359d353c1cf91)
    #41 pc 00000000003fc4e4 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libunity.so (BuildId: 56fd029cc210940f4b6f2242f03359d353c1cf91)
    #42 pc 00000000003f3c54 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libunity.so (ExecutePlayerLoop(NativePlayerLoopSystem*)+80) (BuildId: 56fd029cc210940f4b6f2242f03359d353c1cf91)
    #43 pc 00000000003f3cac /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libunity.so (ExecutePlayerLoop(NativePlayerLoopSystem*)+168) (BuildId: 56fd029cc210940f4b6f2242f03359d353c1cf91)
    #44 pc 00000000003f3f10 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libunity.so (PlayerLoop()+368) (BuildId: 56fd029cc210940f4b6f2242f03359d353c1cf91)
    #45 pc 00000000006a7ec4 /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libunity.so (UnityPlayerLoop()+716) (BuildId: 56fd029cc210940f4b6f2242f03359d353c1cf91)
    #46 pc 00000000006d59bc /data/app/com.DefaultCompany.AR_Foundation_Protoype-ykUM3-x_NFJj00oguZVNiA==/lib/arm64/libunity.so (nativeRender(_JNIEnv*, _jobject*)+72) (BuildId: 56fd029cc210940f4b6f2242f03359d353c1cf91)
    #47 pc 0000000000140350 /apex/com.android.runtime/lib64/libart.so (art_quick_generic_jni_trampoline+144) (BuildId: 51dd87228cef451ac11e29a52f9bb94c)
    #48 pc 0000000000137334 /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 51dd87228cef451ac11e29a52f9bb94c)
    #49 pc 000000000014606c /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244) (BuildId: 51dd87228cef451ac11e29a52f9bb94c)
    #50 pc 00000000002e0ce0 /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+384) (BuildId: 51dd87228cef451ac11e29a52f9bb94c)
    #51 pc 00000000002dbfc0 /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*)+912) (BuildId: 51dd87228cef451ac11e29a52f9bb94c)
    #52 pc 000000000059c4e8 /apex/com.android.runtime/lib64/libart.so (MterpInvokeDirect+400) (BuildId: 51dd87228cef451ac11e29a52f9bb94c)
    #53 pc 0000000000131914 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: 51dd87228cef451ac11e29a52f9bb94c)
    #54 pc 000000000059cff4 /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1136) (BuildId: 51dd87228cef451ac11e29a52f9bb94c)
    #55 pc 0000000000131994 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 51dd87228cef451ac11e29a52f9bb94c)
    #56 pc 00000000002b192c /apex/com.android.runtime/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.2430230120769319602)+240) (BuildId: 51dd87228cef451ac11e29a52f9bb94c)
    #57 pc 000000000058b750 /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1012) (BuildId: 51dd87228cef451ac11e29a52f9bb94c)
    #58 pc 0000000000140468 /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 51dd87228cef451ac11e29a52f9bb94c)
    #59 pc 000000000201c2cc /memfd:/jit-cache (deleted)

    stack:
    00000071531cc1e0 0000000000000000
    00000071531cc1e8 00000070dfff5ed0

    etc...
     

    Attached Files:

    Last edited: Sep 8, 2021
  2. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,144
    One thing I can recommend is to update ARCore to the verified version. I see from the logs that you use AR Subsystems 4.1.7, but ARCore is version 4.0.12.

    As a side note, it's better to use the Allocator.Temp for short allocations instead of Persistent for performance reasons. But it should not be related to the crash.
     
    Last edited: Sep 8, 2021
    J_Kost likes this.
  3. J_Kost

    J_Kost

    Joined:
    Feb 16, 2021
    Posts:
    32
    I actually switched to persistent just to see whether the temp allocator was the cause. But I realize I was reaching for straws...

    I will have to find out whether I can update the ARCore package version without breaking a plugin I am using. This plugin explicitly requires the combination of AR Subsystems and ARCore versions that I am using.
    Thanks a lot for your input though, I will see whether I can switch. How confident are you that this might be the cause @KirillKuzyk ?
     
  4. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,144
    No confidence at all, but using verified packages is the first go-to in such cases for me.
     
  5. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
  6. J_Kost

    J_Kost

    Joined:
    Feb 16, 2021
    Posts:
    32
    Thank you for your answer. My bug will most likely not be reproducible without an essential plugin that uses a hardware-derived key for licensing. I imagine this will complicate bug reporting? I might be able to get a license file for your QA team from the Plugin vendor, but I can't guarantee this. Either way, this would require me to have at least indirect contact with the QA Engineer invesitgating my issue. Is there a way to establish email contact for a special case such as mine?
     
  7. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    Your but report will allow for some back & forth with the engineer. Please share your concerns with them when filing your bug report, though. :)
     
  8. J_Kost

    J_Kost

    Joined:
    Feb 16, 2021
    Posts:
    32
    Hi,
    I happened to find the cause (albeit vague) by accident while migrating my project to different Unity versions for testing. After deleting the Library folder from the project & letting Unity rebuild it, the SegFaults were gone. Something in there must have been corrupted.