EXCEPTION_ACCESS_VIOLATION reading address 0x00000000

For my project I have been building ontop of ShooterGame since 4.1 and currently have updated all of my code to work with 4.6.1

Recently I have implemented bots by way of a blueprint behavior tree, nav mesh and target point nodes spread out across the level that serve as waypoints for the bots to make their way around the map.

Everything works fine in the course of a round until the round ends and the level restarts. I find that when the map reloads after server travel all of the bots no longer have their TeamNum set and are considered by my code to be ‘spectators’ (TeamNum == -1). As a quick hack to try to fix this I iterated through all AIControllers in GameMode’s InitGame() and simply set ShooterPlayerState’s TeamNum manually to a teamNum. Doing this immediately causes the game to crash, the notable section here:

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000000

UE4Editor-Navmesh.dll!UnknownFunction (0x000007feee296992) + 0 bytes [UnknownFile:0]
UE4Editor-Navmesh.dll!UnknownFunction (0x000007feee28a353) + 0 bytes [UnknownFile:0]
UE4Editor-Engine.dll!UnknownFunction (0x000007feea6aa7b5) + 0 bytes [UnknownFile:0]
UE4Editor-Engine.dll!UnknownFunction (0x000007feea6aa07e) + 0 bytes [UnknownFile:0]
UE4Editor-AIModule.dll!UnknownFunction (0x000007fee8afdc20) + 0 bytes [UnknownFile:0]
UE4Editor-AIModule.dll!UnknownFunction (0x000007fee8ab8ec4) + 0 bytes [UnknownFile:0]
UE4Editor-AIModule.dll!UnknownFunction (0x000007fee8ab3313) + 0 bytes [UnknownFile:0]
UE4Editor-AIModule.dll!UnknownFunction (0x000007fee8ab1de0) + 0 bytes [UnknownFile:0]
UE4Editor-AIModule.dll!UnknownFunction (0x000007fee8aee61b) + 0 bytes [UnknownFile:0]
UE4Editor-AIModule.dll!UnknownFunction (0x000007fee8af802d) + 0 bytes [UnknownFile:0]
UE4Editor-AIModule.dll!UnknownFunction (0x000007fee8aabea8) + 0 bytes [UnknownFile:0]
UE4Editor-AIModule.dll!UnknownFunction (0x000007fee8aad1b8) + 0 bytes [UnknownFile:0]
UE4Editor-AIModule.dll!UnknownFunction (0x000007fee8afcd4c) + 0 bytes [UnknownFile:0]
UE4Editor-AIModule.dll!UnknownFunction (0x000007fee8b269a1) + 0 bytes [UnknownFile:0]
UE4Editor-Engine.dll!UnknownFunction (0x000007fee9dcd423) + 0 bytes [UnknownFile:0]
UE4Editor-Engine.dll!UnknownFunction (0x000007fee9df13bc) + 0 bytes [UnknownFile:0]
UE4Editor-Engine.dll!UnknownFunction (0x000007feea500e86) + 0 bytes [UnknownFile:0]
UE4Editor-Engine.dll!UnknownFunction (0x000007feea508410) + 0 bytes [UnknownFile:0]
UE4Editor-Core.dll!UnknownFunction (0x000007feec7ce483) + 0 bytes [UnknownFile:0]
UE4Editor-Core.dll!UnknownFunction (0x000007feec7ce67d) + 0 bytes [UnknownFile:0]
UE4Editor-Core.dll!UnknownFunction (0x000007feec7edc75) + 0 bytes [UnknownFile:0]
UE4Editor-Engine.dll!UnknownFunction (0x000007feea53c7c5) + 0 bytes [UnknownFile:0]
UE4Editor-Engine.dll!UnknownFunction (0x000007feea527ad0) + 0 bytes [UnknownFile:0]
UE4Editor-Engine.dll!UnknownFunction (0x000007feea52a337) + 0 bytes [UnknownFile:0]
UE4Editor-Engine.dll!UnknownFunction (0x000007feea1e57e6) + 0 bytes [UnknownFile:0]
UE4Editor-Engine.dll!UnknownFunction (0x000007feea1eca43) + 0 bytes [UnknownFile:0]
UE4Editor-Engine.dll!UnknownFunction (0x000007feea033ce3) + 0 bytes [UnknownFile:0]
UE4Editor.exe!FEngineLoop::Tick() (0x000000013fb4cd94) + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\launch\private\launchengineloop.cpp:2214]
UE4Editor.exe!GuardedMain() (0x000000013fb4089f) + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\launch\private\launch.cpp:131]
UE4Editor.exe!GuardedMainWrapper() (0x000000013fb4090a) + 5 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor.exe!WinMain() (0x000000013fb4e3d9) + 17 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
UE4Editor.exe!__tmainCRTStartup() (0x000000013fb4f319) + 21 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]
kernel32.dll!UnknownFunction (0x00000000778859ed) + 0 bytes [UnknownFile:0]
ntdll.dll!UnknownFunction (0x0000000077abc541) + 0 bytes [UnknownFile:0]
ntdll.dll!UnknownFunction (0x0000000077abc541) + 0 bytes [UnknownFile:0]

I’ve attached the crash log and dump to this post.

I have found that this crash does not occur if I clear the BehaviorTree from the ‘Bot Behavior’ of my BotPawn. This leads me to believe that the issue is somehow related to the NavMesh/AI code.

My solution for now is to just delete any bots/AIControllers from the game in GameMode’s InitGame() and re-add them manually until this crash can be fixed. But note, even removing and then re-adding the bots within InitGame() triggers this crash too. So I believe this has nothing to do with TeamNum and more about triggering bot behavior at a fragile point.

Please let me know if there is anything else I can provide

I’m a bit worried about your AIControllers living past destruction of the world they have been created in… but that’s beside the point.

The callstack you’ve attached is useless due to missing debug symbols. Would you mind preparing one with debug info? Thanks in advance!

MieszkoZ,

Ah sorry, I just blindly followed the instructions laid out here: How do I report a bug? - Programming & Scripting - Unreal Engine Forums

Might you be able to direct me to where I can read about preparing a callstack with useful debug symbols?

Best,
George

The easiest way would be to run your game from the VS and just wait for the crash :slight_smile: And once it happens just copy-paste the callstack from the Callstack window :smiley:

Access violation - code c0000005 (first/second chance not available)

UE4Editor_Navmesh + 158098 bytes
UE4Editor_Navmesh + 107347 bytes
UE4Editor_Engine + 10594229 bytes
UE4Editor_Engine + 10592382 bytes
UE4Editor_AIModule + 908320 bytes
UE4Editor_AIModule + 626372 bytes
UE4Editor_AIModule + 602899 bytes
UE4Editor_AIModule + 597472 bytes
UE4Editor_AIModule + 845339 bytes
UE4Editor_AIModule + 884781 bytes
UE4Editor_AIModule + 573096 bytes
UE4Editor_AIModule + 577976 bytes
UE4Editor_AIModule + 904524 bytes
UE4Editor_AIModule + 1075617 bytes
UE4Editor_Engine + 1299491 bytes
UE4Editor_Engine + 1446844 bytes
UE4Editor_Engine + 8851078 bytes
UE4Editor_Engine + 8881168 bytes
UE4Editor_Core + 713859 bytes
UE4Editor_Core + 714365 bytes
UE4Editor_Core + 842869 bytes
UE4Editor_Engine + 9095109 bytes
UE4Editor_Engine + 9009872 bytes
UE4Editor_Engine + 9020215 bytes
UE4Editor_Engine + 5593062 bytes
UE4Editor_Engine + 5622339 bytes
UE4Editor_Engine + 3816675 bytes
UE4Editor!FEngineLoop::Tick() + 3876 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\launch\private\launchengineloop.cpp:2214]
UE4Editor!GuardedMain() + 479 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\launch\private\launch.cpp:131]
UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

Is this of any more help?

I was able to retrieve the relevant information from the dmp file. It looks like the bug is in code that has already been removed. Can you try reproing this issue in 4.7?

Cheers,

–mieszko