Search Issue Tracker

Fixed in 2022.1.X

Fixed in 2020.3.X, 2021.2.X

Votes

19

Found in

2020.1

2020.1.14f1

2020.2

Issue ID

1295472

Regression

No

AsyncGPUReadback.RequestIntoNativeArray causes InvalidOperationException on NativeArray

Visual Effects

-

How to reproduce:
1. Open the attached project named "Case_129547"
2. Open the TestScene2 in the Scenes folder
3. Enter Play mode
4. Observe the Console Window

Expected result: No errors are thrown on entering the Play mode
Actual result: InvalidOperationException on NativeArray error is thrown

Reproducible with: 2020.1.17f1, 2020.2.1f1, 2021.1.0a10
Could not test with: 2018.4.30f1, 2019.4.17f1(Missing script references)

Reproducible with graphics APIs: D3D11, D3D12, Vulkan, OpenGLCore

Notes:
1. Does not reproduce on all machines

  1. Resolution Note (fix version 2022.1):

    Fixed in: 2022.1.0a12

  2. Resolution Note (fix version 2021.2):

    Fixed in Unity 2021.2.2f1

  3. Resolution Note (fix version 2020.3):

    Fixed in - 2020.3.23f1

Comments (18)

  1. jodaiCaignie

    Nov 14, 2025 12:54

    This issue is not resolved. Encountered it on 6000.2.7f2

  2. intermike

    May 02, 2025 11:51

    Still persists: Unity 6000.1.0f1

    1. AsyncGPUReadback.RequestIntoNativeArray
    2. Read in jobs in next frame after Callback is triggered <- Mandatory to trigger an error later
    3. AsyncGPUReadback.RequestIntoNativeArray -> Error

    During consequence calls after receiving callback:
    AsyncGPUReadback - NativeArray does not have read/write access
    UnityEngine.Rendering.AsyncGPUReadback:RequestIntoNativeArray<Unity.Mathematics.float3>
    AsyncGPUReadback - NativeArray should not be undisposable
    UnityEngine.Rendering.AsyncGPUReadback:RequestIntoNativeArray<Unity.Mathematics.float3>

    And on Dispose during Destroy
    InvalidOperationException: The Unity.Collections.NativeArray1[Unity.Mathematics.float3] has been set to undisposable and cannot be deallocated.
    -> And a leak at the end as dispose failed.

  3. Drumsmasher17

    Dec 14, 2024 22:13

    Am getting this error on Unity 6000.0.19f1

    InvalidOperationException: The Unity.Collections.NativeArray`1[GPUDecalUtils+ReadableVertex] can no longer be accessed, since its owner has been invalidated. You can simply Dispose() the container and create a new one.
    Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckWriteAndThrowNoEarlyOut (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) (at <c01ea92c157f4fadb827b390bd34dd65>:0)
    Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckWriteAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) (at <c01ea92c157f4fadb827b390bd34dd65>:0)
    Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafePtr[T] (Unity.Collections.NativeArray`1[T] nativeArray) (at <c01ea92c157f4fadb827b390bd34dd65>:0)
    UnityEngine.Rendering.AsyncRequestNativeArrayData.CreateAndCheckAccess[T] (Unity.Collections.NativeArray`1[T] array) (at <c01ea92c157f4fadb827b390bd34dd65>:0)
    UnityEngine.Rendering.CommandBuffer.RequestAsyncReadbackIntoNativeArray[T] (Unity.Collections.NativeArray`1[T]& output, UnityEngine.ComputeBuffer src, System.Action`1[T] callback) (at <c01ea92c157f4fadb827b390bd34dd65>:0)

  4. thebarryman

    Sep 13, 2023 02:20

    Still appears to be broken.

  5. nicbarkeragain

    May 11, 2023 03:25

    This is still happening when trying to read a rendertexture to a nativearray in 2021.3.15f1.

  6. gregoire_unity128

    Jun 07, 2022 15:29

    I just encountered this issue, too. On 2022.1.3f1. lots of trouble for array copy, guys...

  7. LooperVFX

    Oct 09, 2021 01:54

    "Hi all, the fix has finally landed in 2022.1.0a12.
    This means the backports will now be unblocked and can land in the main releases."
    - richardkettlewell @ Unity Technologies, Monday October 4th 2021

  8. wusticality

    Sep 01, 2021 21:31

    Is there any update on this? The status hasn't changed since May.

  9. qijen

    Aug 18, 2021 04:29

    Need to be fixed on 2019.4.

  10. iamarugin

    Aug 06, 2021 08:44

    2020.3 when?

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.