Steps to reproduce:
1. Somehow make PersistentDataPath contain non-ascii characters (either a create a Windows user with a non-ASCII name, or hack the source code);
2. Run the Windows player with DX12
3. Close the player
4. Observe a crash
Callstack:
KernelBase.dll!RaiseException() Unknown
vcruntime140d_app.dll!_CxxThrowException() + 288 bytes Unknown
UnityPlayer.dll!std::filesystem::_Throw_fs_error(const char * _Op, const std::error_code & _Error, const std::filesystem::path & _Path1) Line 1841 C++
UnityPlayer.dll!std::filesystem::create_directories(const std::filesystem::path & _Path) Line 3846 C++
UnityPlayer.dll!PipelineUtilities::WriteData::__l2::<lambda>() Line 26 C++
UnityPlayer.dll!std::call_once<void <lambda>(void)>(std::once_flag & Once, PipelineUtilities::WriteData::_l2::void <lambda>(void) && _Fx) Line 104 C++
UnityPlayer.dll!PipelineUtilities::WriteData(const char * name, const void * data, unsigned __int64 size) Line 30 C++
UnityPlayer.dll!D3D12PipelineCacheLibrary::SaveCache() Line 104 C++
UnityPlayer.dll!D3D12PipelineCache::SavePipelineCache() Line 117 C++
UnityPlayer.dll!D3D12PipelineCache::~D3D12PipelineCache() Line 69 C++
UnityPlayer.dll!GfxDeviceD3D12::~GfxDeviceD3D12() Line 1251 C++
UnityPlayer.dll!GfxDeviceD3D12::`scalar deleting destructor'(unsigned int) C++
UnityPlayer.dll!DestroyRealGfxDevice() Line 320 C++
UnityPlayer.dll!GfxDeviceWorker::~GfxDeviceWorker() Line 152 C++
UnityPlayer.dll!GfxDeviceWorker::`scalar deleting destructor'(unsigned int) C++
UnityPlayer.dll!GfxDeviceClient::~GfxDeviceClient() Line 253 C++
UnityPlayer.dll!GfxDeviceClient::`scalar deleting destructor'(unsigned int) C++
UnityPlayer.dll!GfxDeviceClientPool::ReleaseThreadedDevices(GfxDevice * mainClient) Line 79 C++
UnityPlayer.dll!DestroyGfxDevice() Line 232 C++
Reproducible with versions: 6000.1.0b1
Not reproducible with versions: 6000.1.0a7
Tested on (OS): Windows 11 24H2
Notes This issue affects every game as it will crash in the wild when distributed.