Context
Projects can turn on the project setting bDoFullyAsyncNavDataGathering to execute navigation mesh building tasks on worker threads. Some of these tasks will access the NavOctree, whose lifetime is managed by UNavigationSystemV1.
Problem
When the user exits the application, UNavigationSystemV1::CleanUp() will immediately execute on the GameThread which destroys the NavOctree and null its reference to it. Navigation tasks may still be executing on other threads and they are not prepared for the NavOctree to be destroyed while the task is running. This is a race condition that can result in null pointer access from the worker thread running the nav task. A licensee has provided one worker thread callstack where this happened.
check(NavSys.GetNavOctree()); FPlatformProcess::Sleep(5.0f); check(NavSys.GetNavOctree());
Callstack of null pointer access (non-GameThread, fatal):
FNavigationOctree::DemandLazyDataGathering (NavigationOctree.cpp:76)
FNavigationDataHandler::DemandLazyDataGathering (NavigationDataHandler.cpp:585)
UNavigationSystemV1::DemandLazyDataGathering (NavigationSystem.cpp:3352)
FRecastTileGenerator::GatherNavigationDataGeometry (RecastNavMeshGenerator.cpp:2092)
FRecastTileGenerator::GatherGeometryFromSources (RecastNavMeshGenerator.cpp:1945)
FRecastTileGenerator::DoWork (RecastNavMeshGenerator.cpp:1875)
FAsyncTaskBase::DoWork (AsyncWork.h:288)
FAsyncTaskBase::DoThreadedWork (AsyncWork.h:312)
Example callstack where NavOctree got nulled before (GameThread, non-fatal):
UnrealEditor-NavigationSystem.dll!UNavigationSystemV1::CleanUp(const FNavigationSystem::ECleanupMode Mode) Line 5054 C++
UnrealEditor-NavigationSystem.dll!UNavigationSystemV1::OnBeginTearingDown(UWorld * World) Line 1271 C++
[External Code]
UnrealEditor-UnrealEd.dll!UEditorEngine::TeardownPlaySession(FWorldContext & PieWorldContext) Line 690 C++
UnrealEditor-UnrealEd.dll!UEditorEngine::EndPlayMap() Line 344 C++
UnrealEditor-UnrealEd.dll!UEditorEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 2475 C++
UnrealEditor-UnrealEd.dll!UUnrealEdEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 546 C++
UnrealEditor.exe!FEngineLoop::Tick() Line 5872 C++
[Inline Frame] UnrealEditor.exe!EngineTick() Line 69 C++
UE-74991 also affects Valve Index
I am not able to find world outliner how to enable it?
How can i modify the param name in EQS node
I'm working on a VR Project and I cannot add Nav Mesh to the stairs??
What method is used to fill polygonal regions when drawing spline mesh at run time?
Undefined sysmbol: typeinfo for AActor when cross-compile linux dedicated server on windows
How to achieve HLSL Multiple Render Target in Material blueprints?
How to properly terminate the DoWork thread function in FAsyncTask?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-229415 in the post.
1 |
Component | UE - AI - Navigation |
---|---|
Affects Versions | 5.4.4 |
Target Fix | 5.6 |
Fix Commit | 37791385 |
---|
Created | Nov 1, 2024 |
---|---|
Resolved | Nov 5, 2024 |
Updated | Nov 23, 2024 |