Skip to content

Seg-fault when using FlyTo BT node in sub-level BTs with Recalculate Path Tolerance enabled #21

Description

@chillpert

The following trivial BT setup causes a crash:

  • Main BT: ROOT → Selector (empty) → Run Behavior (sub-level BT)
  • Sub-level BT: ROOT → Selector (empty) → Don's Fly To Node (Flight Location Key: PlayerLocation; Recalculate Path Tolerance: true)

Only within a few seconds on an empty map with just one flying AI-enabled pawn and a player character, the following segmentation fault can be observed:

Caught signal 11 Segmentation fault

libUnrealEditor-DonAINavigation.so!UBTTask_FlyTo::OnBlackboardValueChange(UBlackboardComponent const&, unsigned char) [/home/TheGame/Plugins/DonAINavigation/Source/DonAINavigation/Private/BehaviorTree/BTTask_FlyTo.cpp:466]
libUnrealEditor-AIModule.so!UBlackboardComponent::NotifyObservers(unsigned char) const [/mnt/data/unrealengine/Engine/Source/./Runtime/AIModule/Private/BehaviorTree/BlackboardComponent.cpp:425]
libUnrealEditor-AIModule.so!bool UBlackboardComponent::SetValue<UBlackboardKeyType_Vector>(unsigned char, UBlackboardKeyType_Vector::FDataType) [/mnt/data/unrealengine/Engine/Source/Runtime/AIModule/Classes/BehaviorTree/BlackboardComponent.h:348]
libUnrealEditor-Utility.so!UAILibrary::SetBlackboardValueAsVector(AAIController*, FString const&, UE::Math::TVector<double> const&) [/home/TheGame/Source/Utility/Private/AILibrary.cpp:60]
libUnrealEditor-Utility.so!UAILibrary::execSetBlackboardValueAsVector(UObject*, FFrame&, void*) [/home/TheGame/Intermediate/Build/Linux/B4D820EA/UnrealEditor/Inc/Utility/AILibrary.gen.cpp:37]
libUnrealEditor-CoreUObject.so!UObject::execCallMathFunction(UObject*, FFrame&, void*) [/mnt/data/unrealengine/Engine/Source/./Runtime/CoreUObject/Private/UObject/ScriptCore.cpp:945]
libUnrealEditor-CoreUObject.so!ProcessLocalScriptFunction(UObject*, FFrame&, void*) [/mnt/data/unrealengine/Engine/Source/./Runtime/CoreUObject/Private/UObject/ScriptCore.cpp:1109]
libUnrealEditor-CoreUObject.so!void ProcessScriptFunction<void (*)(UObject*, FFrame&, void*)>(UObject*, UFunction*, FFrame&, void*, void (*)(UObject*, FFrame&, void*)) [/mnt/data/unrealengine/Engine/Source/./Runtime/CoreUObject/Private/UObject/ScriptCore.cpp:909]
libUnrealEditor-CoreUObject.so!ProcessLocalFunction(UObject*, UFunction*, FFrame&, void*) [/mnt/data/unrealengine/Engine/Source/./Runtime/CoreUObject/Private/UObject/ScriptCore.cpp:1143]
libUnrealEditor-CoreUObject.so!ProcessLocalScriptFunction(UObject*, FFrame&, void*) [/mnt/data/unrealengine/Engine/Source/./Runtime/CoreUObject/Private/UObject/ScriptCore.cpp:1109]
libUnrealEditor-CoreUObject.so!void ProcessScriptFunction<void (*)(UObject*, FFrame&, void*)>(UObject*, UFunction*, FFrame&, void*, void (*)(UObject*, FFrame&, void*)) [/mnt/data/unrealengine/Engine/Source/./Runtime/CoreUObject/Private/UObject/ScriptCore.cpp:909]
libUnrealEditor-CoreUObject.so!ProcessLocalFunction(UObject*, UFunction*, FFrame&, void*) [/mnt/data/unrealengine/Engine/Source/./Runtime/CoreUObject/Private/UObject/ScriptCore.cpp:1143]
libUnrealEditor-CoreUObject.so!ProcessLocalScriptFunction(UObject*, FFrame&, void*) [/mnt/data/unrealengine/Engine/Source/./Runtime/CoreUObject/Private/UObject/ScriptCore.cpp:1109]
libUnrealEditor-CoreUObject.so!UFunction::Invoke(UObject*, FFrame&, void*) [/mnt/data/unrealengine/Engine/Source/./Runtime/CoreUObject/Private/UObject/Class.cpp:5912]
libUnrealEditor-CoreUObject.so!UObject::ProcessEvent(UFunction*, void*) [/mnt/data/unrealengine/Engine/Source/./Runtime/CoreUObject/Private/UObject/ScriptCore.cpp:2001]
libUnrealEditor-Engine.so!AActor::ProcessEvent(UFunction*, void*) [/mnt/data/unrealengine/Engine/Source/./Runtime/Engine/Private/Actor.cpp:1030]
libUnrealEditor-Engine.so!AActor::ReceiveTick(float) [/mnt/data/unrealengine/Engine/Source/./../Intermediate/Build/Linux/B4D820EA/UnrealEditor/Inc/Engine/Actor.gen.cpp:2053]
libUnrealEditor-Engine.so!AActor::Tick(float) [/mnt/data/unrealengine/Engine/Source/./Runtime/Engine/Private/Actor.cpp:1370]
libUnrealEditor-AIModule.so!AAIController::Tick(float) [/mnt/data/unrealengine/Engine/Source/./Runtime/AIModule/Private/AIController.cpp:56]
libUnrealEditor-Engine.so!FActorTickFunction::ExecuteTick(float, ELevelTick, ENamedThreads::Type, TRefCountPtr<FGraphEvent> const&) [/mnt/data/unrealengine/Engine/Source/./Runtime/Engine/Private/Actor.cpp:197]
libUnrealEditor-Engine.so!FTickFunctionTask::DoTask(ENamedThreads::Type, TRefCountPtr<FGraphEvent> const&) [/mnt/data/unrealengine/Engine/Source/./Runtime/Engine/Private/TickTaskManager.cpp:284]
libUnrealEditor-Engine.so!TGraphTask<FTickFunctionTask>::ExecuteTask(TArray<FBaseGraphTask*, TSizedDefaultAllocator<32> >&, ENamedThreads::Type, bool) [/mnt/data/unrealengine/Engine/Source/Runtime/Core/Public/Async/TaskGraphInterfaces.h:975]
libUnrealEditor-Core.so!FNamedTaskThread::ProcessTasksNamedThread(int, bool) [/mnt/data/unrealengine/Engine/Source/./Runtime/Core/Private/Async/TaskGraph.cpp:753]
libUnrealEditor-Core.so!FNamedTaskThread::ProcessTasksUntilQuit(int) [/mnt/data/unrealengine/Engine/Source/./Runtime/Core/Private/Async/TaskGraph.cpp:641]
libUnrealEditor-Core.so!FTaskGraphCompatibilityImplementation::ProcessThreadUntilRequestReturn(ENamedThreads::Type) [/mnt/data/unrealengine/Engine/Source/./Runtime/Core/Private/Async/TaskGraph.cpp:2114]
libUnrealEditor-Core.so!FTaskGraphCompatibilityImplementation::WaitUntilTasksComplete(TArray<TRefCountPtr<FGraphEvent>, TSizedInlineAllocator<4u, 32, TSizedDefaultAllocator<32> > > const&, ENamedThreads::Type) [/mnt/data/unrealengine/Engine/Source/./Runtime/Core/Private/Async/TaskGraph.cpp:2168]
libUnrealEditor-Engine.so!FTickTaskSequencer::ReleaseTickGroup(ETickingGroup, bool) [/mnt/data/unrealengine/Engine/Source/./Runtime/Engine/Private/TickTaskManager.cpp:564]
libUnrealEditor-Engine.so!FTickTaskManager::RunTickGroup(ETickingGroup, bool) [/mnt/data/unrealengine/Engine/Source/./Runtime/Engine/Private/TickTaskManager.cpp:1591]
libUnrealEditor-Engine.so!UWorld::Tick(ELevelTick, float) [/mnt/data/unrealengine/Engine/Source/./Runtime/Engine/Private/LevelTick.cpp:1531]
libUnrealEditor-UnrealEd.so!UEditorEngine::Tick(float, bool) [/mnt/data/unrealengine/Engine/Source/./Editor/UnrealEd/Private/EditorEngine.cpp:1775]
libUnrealEditor-UnrealEd.so!UUnrealEdEngine::Tick(float, bool) [/mnt/data/unrealengine/Engine/Source/./Editor/UnrealEd/Private/UnrealEdEngine.cpp:471]
UnrealEditor!FEngineLoop::Tick() [/mnt/data/unrealengine/Engine/Source/./Runtime/Launch/Private/LaunchEngineLoop.cpp:5209]
UnrealEditor!GuardedMain(char16_t const*) [/mnt/data/unrealengine/Engine/Source/./Runtime/Launch/Private/Launch.cpp:185]
libUnrealEditor-UnixCommonStartup.so!CommonUnixMain(int, char**, int (*)(char16_t const*), void (*)()) [/mnt/data/unrealengine/Engine/Source/Runtime/Unix/UnixCommonStartup/Private/UnixCommonStartup.cpp:264]
libc.so.6!UnknownFunction(0x2328f)
libc.so.6!__libc_start_main(+0x89)
UnrealEditor!_start()

It works fine if you use the Fly To node in the 'root' BT instead of the sub-level BT. The player location is valid, gets updated every frame, and is within the navigation volume at all times.

I am using this fork of the plugin but from my testing the issue also occurs with the original plugin (after fixing up compilation errors). In case you are using the original plugin, the crash happens at BTTask_FlyTo.cpp:456 with the same callstack. With my limited knowledge on the C++ side of BTs and the plugin itself, I was not able to fix this issue yet, so any help is highly appreciated.

Tested on Windows 10 and Linux with UE-5.0.3.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions