Search Unity

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

Bug Random crashes in D3D12 memory allocator (2020.2.0b10)

Discussion in '2020.2 Beta' started by Hyp-X, Nov 9, 2020.

  1. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    421
    Hi,

    We are having random crashes with an unknown repro rate (way below 100%, but not super rare), in our game version testing Unity 2020.2.0b10

    Here's 3 callstack I got, notice that they are not identical, but super close:

    Code (CSharp):
    1. 0x00007FFD2E9A853B (UnityPlayer) tlsf_free
    2. 0x00007FFD2D5DA6FE (UnityPlayer) DynamicHeapAllocator::Deallocate
    3. 0x00007FFD2D5BBFD0 (UnityPlayer) MemoryManager::Deallocate
    4. 0x00007FFD2D5CC77A (UnityPlayer) free_alloc_internal
    5. 0x00007FFD2D0494C5 (UnityPlayer) core::hash_set<int,core::hash<int>,std::equal_to<int> >::grow
    6. 0x00007FFD2D042C76 (UnityPlayer) core::hash_set<int,core::hash<int>,std::equal_to<int> >::insert<int & __ptr64>
    7. 0x00007FFD2DED3FEE (UnityPlayer) GfxDeviceStats::AddUsedTexture
    8. 0x00007FFD2D48B95E (UnityPlayer) GfxDeviceD3D12Base::SetTextures
    9. 0x00007FFD2DED4204 (UnityPlayer) GpuProgram::ApplyTextureParameters
    10. 0x00007FFD2D4799E6 (UnityPlayer) D3D12CommonShader::ApplyGpuProgram
    11. 0x00007FFD2D4546E0 (UnityPlayer) D3D12ImmediateContext::BindShaders
    12. 0x00007FFD2D48B6C8 (UnityPlayer) GfxDeviceD3D12Base::SetShadersThreadable
    13. 0x00007FFD2E67BA61 (UnityPlayer) GfxDeviceWorker::RunCommand
    14. 0x00007FFD2E6851DD (UnityPlayer) GfxDeviceWorker::RunExt
    15. 0x00007FFD2E6852D5 (UnityPlayer) GfxDeviceWorker::RunGfxDeviceWorker
    16. 0x00007FFD2DDF9CBD (UnityPlayer) Thread::RunThreadWrapper
    17. 0x00007FFD9F467BD4 (KERNEL32) BaseThreadInitThunk
    18. 0x00007FFDA064CE51 (ntdll) RtlUserThreadStart
    Code (CSharp):
    1. 0x00007FFD2E9A8571 (UnityPlayer) tlsf_free
    2. 0x00007FFD2D5DA6FE (UnityPlayer) DynamicHeapAllocator::Deallocate
    3. 0x00007FFD2D5BBFD0 (UnityPlayer) MemoryManager::Deallocate
    4. 0x00007FFD2D5CC77A (UnityPlayer) free_alloc_internal
    5. 0x00007FFD2D0494C5 (UnityPlayer) core::hash_set<int,core::hash<int>,std::equal_to<int> >::grow
    6. 0x00007FFD2D042C76 (UnityPlayer) core::hash_set<int,core::hash<int>,std::equal_to<int> >::insert<int & __ptr64>
    7. 0x00007FFD2DED3FEE (UnityPlayer) GfxDeviceStats::AddUsedTexture
    8. 0x00007FFD2D48B95E (UnityPlayer) GfxDeviceD3D12Base::SetTextures
    9. 0x00007FFD2DED4204 (UnityPlayer) GpuProgram::ApplyTextureParameters
    10. 0x00007FFD2D4799E6 (UnityPlayer) D3D12CommonShader::ApplyGpuProgram
    11. 0x00007FFD2D4546E0 (UnityPlayer) D3D12ImmediateContext::BindShaders
    12. 0x00007FFD2D48B6C8 (UnityPlayer) GfxDeviceD3D12Base::SetShadersThreadable
    13. 0x00007FFD2E67BA61 (UnityPlayer) GfxDeviceWorker::RunCommand
    14. 0x00007FFD2E6851DD (UnityPlayer) GfxDeviceWorker::RunExt
    15. 0x00007FFD2E6852D5 (UnityPlayer) GfxDeviceWorker::RunGfxDeviceWorker
    16. 0x00007FFD2DDF9CBD (UnityPlayer) Thread::RunThreadWrapper
    17. 0x00007FFD9F467BD4 (KERNEL32) BaseThreadInitThunk
    18. 0x00007FFDA064CE51 (ntdll) RtlUserThreadStart
    Code (CSharp):
    1. 0x00007FFDC7378132 (UnityPlayer) block_remove
    2. 0x00007FFDC7378594 (UnityPlayer) tlsf_free
    3. 0x00007FFDC5FAA6FE (UnityPlayer) DynamicHeapAllocator::Deallocate
    4. 0x00007FFDC5F8BFD0 (UnityPlayer) MemoryManager::Deallocate
    5. 0x00007FFDC5F9C77A (UnityPlayer) free_alloc_internal
    6. 0x00007FFDC5A194C5 (UnityPlayer) core::hash_set<int,core::hash<int>,std::equal_to<int> >::grow
    7. 0x00007FFDC5A12C76 (UnityPlayer) core::hash_set<int,core::hash<int>,std::equal_to<int> >::insert<int & __ptr64>
    8. 0x00007FFDC68A3FEE (UnityPlayer) GfxDeviceStats::AddUsedTexture
    9. 0x00007FFDC5E5B95E (UnityPlayer) GfxDeviceD3D12Base::SetTextures
    10. 0x00007FFDC68A4204 (UnityPlayer) GpuProgram::ApplyTextureParameters
    11. 0x00007FFDC5E499E6 (UnityPlayer) D3D12CommonShader::ApplyGpuProgram
    12. 0x00007FFDC5E246E0 (UnityPlayer) D3D12ImmediateContext::BindShaders
    13. 0x00007FFDC5E5B6C8 (UnityPlayer) GfxDeviceD3D12Base::SetShadersThreadable
    14. 0x00007FFDC704BA61 (UnityPlayer) GfxDeviceWorker::RunCommand
    15. 0x00007FFDC70551DD (UnityPlayer) GfxDeviceWorker::RunExt
    16. 0x00007FFDC70552D5 (UnityPlayer) GfxDeviceWorker::RunGfxDeviceWorker
    17. 0x00007FFDC67C9CBD (UnityPlayer) Thread::RunThreadWrapper
    18. 0x00007FFE2C8E7C24 (KERNEL32) BaseThreadInitThunk
    19. 0x00007FFE2DE4CEA1 (ntdll) RtlUserThreadStart
    The reason we started testing D3D12 is because we got D3D12 specific crashes on Xbox One.
    That one also crashes in the tlsf allocator.
    I have a thread open for that in the Xbox One forums.

    The levels (4 out of 10) that crashes on Xbox One also crash on PS4.

    None of these crashes occur on Unity 2020.1.12f1.

    My question to Unity if you can answer:
    - Was there some cross platform change in 2020.2 in the GPU memory allocation system on platforms where memory allocation is done by Unity (D3D12, PS4...)?
     
  2. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    421
    And the PS4 version also crashes in tlsf. I'll post details into the related forums.
     
    LeonhardP likes this.