Crash UCrowdManager::BeginDestroy, 4.4 compiled sources

Hi
I got crash in UCrowdManager::BeginDestroy:

Engine version 4.4 compiled from sources.

Stacktrace:

>	UE4Editor-AIModule-Win64-Debug.dll!UCrowdManager::BeginDestroy() Line 168	C++
 	UE4Editor-CoreUObject-Win64-Debug.dll!UObject::ConditionalBeginDestroy() Line 532	C++
 	UE4Editor-CoreUObject-Win64-Debug.dll!CollectGarbage(EObjectFlags KeepFlags, bool bPerformFullPurge) Line 1156	C++
 	UE4Editor-UnrealEd-Win64-Debug.dll!UEditorEngine::EndPlayMap() Line 196	C++
 	UE4Editor-UnrealEd-Win64-Debug.dll!UEditorEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 837	C++
 	UE4Editor-UnrealEd-Win64-Debug.dll!UUnrealEdEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 252	C++
 	UE4Editor-Win64-Debug.exe!FEngineLoop::Tick() Line 2098	C++
 	UE4Editor-Win64-Debug.exe!EngineTick() Line 54	C++
 	UE4Editor-Win64-Debug.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 136	C++
 	UE4Editor-Win64-Debug.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 190	C++

Crash’s place in the code:

// cleanup allocated link filters
for (auto It = ActiveAgents.CreateConstIterator(); It; ++It)
{
	const FCrowdAgentData& AgentData = It.Value();
delete AgentData.LinkFilter; <----- HERE!
}

+		LinkFilter	0xcccccccccccccccc {...}	dtQuerySpecialLinkFilter *
		PrevPoly	0	unsigned __int64
		AgentIndex	-1	int
		PathOptRemainingTime	0.000000000	float
		bIsSimulated	0	unsigned int
		bWantsPathOptimization	0	unsigned int

LinkFilter is unitialized and I think it should be zeroed in FCrowdAgentData constructor. and be checked before deleting.

Hi,

Does this crash happen for you in a new project? If so, can you provide the steps that you follow from creating to the project to when the crash happens?

Hi ,
I haven’t checked I don’t have time. The thing is pretty complicated in setup, because you need crowd AI, big map, big navmeshes.

You should pass this crash report to a programmer he will know what to do.

Still crashing in 4.5.

Repro steps:

  1. Load an example map without editor, example map have navmeshes but the engine reports that he need rebuild them.
  2. Open another map “open FooMap”
  3. Wait for crash

The engine is trying to delete AgentData.LinkFilter; from memory but pointer is invalid!

Hi,

This has been fixed in our latest internal build, and will be corrected in a future release version of the Engine. If you would like to test the fix yourself, you can find it here. This commit includes a large number of files, but the only ones that concern this issue are CrowdManager.h and CrowdManager.cpp. If you merge the changes to those two files in this commit into your Engine source code, you should see that this crash has been corrected.