Description

The licensee has reported, and I was able to reproduce, that specifically in package builds targeting Development configuration, trying to toggle the SmartLinkEnabled state of a NavLinkProxy will crash the game. When running in either the Editor or Shipping configurations the error does not manifest and there is no crash.
I've checked NavigationSystem.cpp and there are a few #if !UE_BUILD_SHIPPING, what could be related to the different behavior, but calling SetSmartLinkEnabled works fine in the Editor. The crash goes up to RegisterElementWithNavOctree() and the game closes with a Fatal Error message. The behavior is not dependent on enabling or disabling the SmartLink of the NavLinkProxy, the game crashes either way.

Another client has also responded with a different callstack on the ticket, and there is an associated ticket here: https://udn.unrealengine.com/s/case/500QP00000XsXTuYAN/crash-in-fnavigationdatahandlerregisterelementwithnavoctree

Steps to Reproduce

Using the attached repro project:
Unzip and open MyProject2
Package project as Development
Run the generated executable and observe the crash after 2 seconds
(Optionally run the executable with -waitfordebugger and attach Visual Studio to have access to the crash call stack)

From scratch:
Create a project using the Top Down template
Open TopDownMap and verify it's the default game map going to ProjectSettings>Maps&Modes>GameDefaultMap so it opens after packaging
There is no need to add a NavMeshBoundsVolume to the level since the template comes with one
Add a NavLinkProxy and set both PointLinks away from each other (ideally one on top of the platform with a ramp and the other on the floor)
With the created NavLinkProxy selected, open the Level Blueprint, right click and Create a Reference to NavLinkProxy
Right click and type Begin Play, add the event
Pull from NavLinkProxy and type Set Smart Link Enabled
Pull from NavLinkProxy and type IsSmartLinkEnabled
Pull from IsSmartLinkEnabled and type ! - select NOT Boolean
Connect the result from the NOT node to the SetSmartLinkEnabled Enabled pin effectively toggling whatever state the NavLinkProxy originally had
Pull from the Event BeginPlay and add a Delay (set it to 2 seconds)
Pull from the Delay node to the SetSmartLinkEnabled so it is called 2 seconds after the game starts
Back to TopDownMap press Platforms>Windows> and in Binary Configuration confirming it's building as Development, press Package Project
Select a target folder and wait for it to finish, run the executable afterwards

Expected result: the game would run normally
Actual result: the game will crash after 2 seconds

If we either run the project in the Editor or create a Shipping build the crash does not happen and not error are logged.

Callstack

Crash callstack:
MyProject2.exe!FNavigationDataHandler::RegisterElementWithNavOctree(class TSharedRef<struct FNavigationElement const ,1> const &,int) C++
MyProject2.exe!FNavigationDataHandler::UpdateNavOctreeParentChain(class TSharedRef<struct FNavigationElement const ,1> const &,bool) C++
MyProject2.exe!FNavigationDataHandler::UnregisterElementWithNavOctree(class TSharedRef<struct FNavigationElement const ,1> const &,int) C++
MyProject2.exe!FNavigationDataHandler::UpdateNavOctreeElement(struct FNavigationElementHandle,class TSharedRef<struct FNavigationElement const ,1> const &,int) C++
MyProject2.exe!UNavigationSystemV1::CalcTimeSlicedUpdateData(class TArray<double,class TSizedDefaultAllocator<32> > &,class TArray<bool,class TSizedDefaultAllocator<32> > &,bool &,class TArray<int,class TSizedInlineAllocator<8,32,class TSizedDefaultAllocator<32> > > &) C++
MyProject2.exe!UNavigationSystemV1::UpdateNavRelevantObjectInNavOctreeStatic(class INavRelevantInterface const &,class UObject const &,class UNavigationSystemV1 *,class TFunctionRef<void (class UNavigationSystemV1 &,class TSharedRef<struct FNavigationElement const ,1> const &)>) C++
MyProject2.exe!UNavigationSystemV1::UpdateComponentInNavOctree(class UActorComponent &) C++
MyProject2.exe!FNavigationSystem::UpdateComponentData(class UActorComponent &) C++
MyProject2.exe!UNavLinkCustomComponent::SetEnabled(bool) C++
MyProject2.exe!ANavLinkProxy::execSetSmartLinkEnabled(class UObject *,struct FFrame &,void * const) C++
MyProject2.exe!UFunction::Invoke(class UObject *,struct FFrame &,void * const) C++
MyProject2.exe!UObject::CallFunction(struct FFrame &,void * const,class UFunction *) C++
MyProject2.exe!UObject::ProcessContextOpcode(struct FFrame &,void * const,bool) C++
MyProject2.exe!ProcessLocalScriptFunction(class UObject *,struct FFrame &,void * const) C++
MyProject2.exe!UObject::ProcessInternal(class UObject *,struct FFrame &,void * const) C++
MyProject2.exe!UFunction::Invoke(class UObject *,struct FFrame &,void * const) C++
MyProject2.exe!UObject::ProcessEvent(class UFunction *,void *) C++
MyProject2.exe!AActor::ProcessEvent(class UFunction *,void *) C++
MyProject2.exe!FLatentActionManager::TickLatentActionForObject(float,class TMultiMap<int,class FPendingLatentAction *,class FDefaultSetAllocator,struct TDefaultMapHashableKeyFuncs<int,class FPendingLatentAction *,1> > &,class UObject *) C++
MyProject2.exe!FLatentActionManager::ProcessLatentActions(class UObject *,float) C++
MyProject2.exe!UWorld::Tick(enum ELevelTick,float) C++
MyProject2.exe!UGameEngine::Tick(float,bool) C++
MyProject2.exe!FEngineLoop::Tick(void) C++
MyProject2.exe!GuardedMain(wchar_t const *) C++
MyProject2.exe!GuardedMainWrapper(wchar_t const *) C++
MyProject2.exe!LaunchWindowsStartup(struct HINSTANCE__ *,struct HINSTANCE__ *,char *,int,wchar_t const *) C++
MyProject2.exe!WinMain() C++
> [Inline Frame] MyProject2.exe!invoke_main() Line 102 C++
MyProject2.exe!__scrt_common_main_seh() Line 288 C++
kernel32.dll!00007ffb994f7374() Unknown
ntdll.dll!00007ffb9ad9cc91() Unknown

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-239911 in the post.

10
Login to Vote

Fixed
ComponentUE - AI - Navigation
Affects Versions5.5.1
Target Fix5.6
Fix Commit38614204
CreatedJan 24, 2025
ResolvedFeb 17, 2025
UpdatedFeb 17, 2025
View Jira Issue