ensure condition failed: UStaticMesh::WaitUntilAsyncPropertyReleased()

LogInit: Display: LogOutputDevice: Error: Ensure condition failed: false [File:E:\UnrealEngine\Engine\Source\Runtime\Engine\Private\StaticMesh.cpp] [Line: 3901]

LogInit: Display: LogOutputDevice: Error: Accessing property HiResSourceModel of the StaticMesh while it is still being built asynchronously is only supported on the game-thread. To avoid any race-condition, consider finishing the compilation before pushing tasks to other threads or making higher-level game-thread code async aware so it schedules the task only when the static mesh’s compilation is finished. If this is a blocker, you can disable async static mesh from the editor experimental settings.

LogInit: Display: LogOutputDevice: Error: Stack:

LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffa35081026 UnrealEditor-Engine.dll!UStaticMesh::WaitUntilAsyncPropertyReleased() [E:\UnrealEngine\Engine\Source\Runtime\Engine\Private\StaticMesh.cpp:3895]

LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffa3505b973 UnrealEditor-Engine.dll!UStaticMesh::IsHiResMeshDescriptionValid() [E:\UnrealEngine\Engine\Source\Runtime\Engine\Private\StaticMesh.cpp:6024]

LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffa2704f1c9 UnrealEditor-MeshBuilder.dll!FStaticMeshBuilder::BuildMeshVertexPositions() [E:\UnrealEngine\Engine\Source\Developer\MeshBuilder\Private\StaticMeshBuilder.cpp:918]

LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffa2704f065 UnrealEditor-MeshBuilder.dll!FMeshBuilderModule::BuildMeshVertexPositions() [E:\UnrealEngine\Engine\Source\Developer\MeshBuilder\Private\MeshBuilderModule.cpp:64]

LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffa33d03674 UnrealEditor-Engine.dll!FDistanceFieldVolumeData::CacheDerivedData() [E:\UnrealEngine\Engine\Source\Runtime\Engine\Private\DistanceFieldAtlas.cpp:227]

LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffa35020f0a UnrealEditor-Engine.dll!FStaticMeshRenderData::Cache() [E:\UnrealEngine\Engine\Source\Runtime\Engine\Private\StaticMesh.cpp:3676]

LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffa35021cf5 UnrealEditor-Engine.dll!UStaticMesh::CacheDerivedData() [E:\UnrealEngine\Engine\Source\Runtime\Engine\Private\StaticMesh.cpp:6305]

LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffa35034d1e UnrealEditor-Engine.dll!UStaticMesh::ExecutePostLoadInternal() [E:\UnrealEngine\Engine\Source\Runtime\Engine\Private\StaticMesh.cpp:7085]

LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffa350322ac UnrealEditor-Engine.dll!FAsyncTask<FStaticMeshAsyncBuildWorker>::DoTaskWork() [E:\UnrealEngine\Engine\Source\Runtime\Core\Public\Async\AsyncWork.h:626]

LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffa332929dd UnrealEditor-Engine.dll!FAsyncTaskBase::DoWork() [E:\UnrealEngine\Engine\Source\Runtime\Core\Public\Async\AsyncWork.h:289]

LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffa332924fe UnrealEditor-Engine.dll!FAsyncTaskBase::DoThreadedWork() [E:\UnrealEngine\Engine\Source\Runtime\Core\Public\Async\AsyncWork.h:313]

LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffa3d703343 UnrealEditor-Core.dll!FQueuedThreadPoolWrapper::FScheduledWork::DoThreadedWork()

重现步骤

Hello,

The line numbers for a couple of functions in the stack do not match the engine code. Did you customize the code in StaticMeshBuilder.cpp or StaticMesh.cpp?

Regards

Yes, how to check the race-condition?

We have some classes that can help hunt race problems. You can look at the MTAccessDetector code. The end of the header declares a couple of header macros to simplify the usage. You should be able to find usage examples through the engine sources.