Access violation editor crash

Occurring 100% of the time. Seems to have something to do with level streaming. We have a completely empty master persistent level and then two child levels. Both are loaded all the time. After loading the master level with these two sub levels and playing the game in the editor viewport, this crash happens when leaving the game with ESC. Pretty much stops me from working now.

MachineId:A368913A4B7A0994CD4081BF81D6FC25
EpicAccountId:a5f84b6e2f6f455abafef1d4f33542c9

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

UE4Editor_Engine!UWorld::IsGameWorld() + 0 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\world.cpp:4987]
UE4Editor_Engine!ARecastNavMesh::OnStreamingLevelRemoved() + 466 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\ai\navigation\recastnavmesh.cpp:1459]
UE4Editor_Engine!UNavigationSystem::OnLevelRemovedFromWorld() + 194 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\ai\navigation\navigationsystem.cpp:3093]
UE4Editor_Engine!TBaseUObjectMethodDelegateInstance<0,UNavigationSystem,void __cdecl(ULevel * __ptr64,UWorld * __ptr64)>::ExecuteIfSafe() + 243 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:772]
UE4Editor_Engine!TBaseMulticastDelegate<void,ULevel * __ptr64,UWorld * __ptr64>::Broadcast() + 172 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\public\delegates\delegatesignatureimpl_variadics.inl:1030]
UE4Editor_Engine!UWorld::RemoveFromWorld() + 2344 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\world.cpp:1857]
UE4Editor_Engine!UWorld::UpdateLevelStreamingInner() + 603 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\world.cpp:2270]
UE4Editor_Engine!UWorld::UpdateLevelStreaming() + 592 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\world.cpp:2306]
UE4Editor_Engine!UWorld::FlushLevelStreaming() + 160 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\world.cpp:2335]
UE4Editor_UnrealEd!UEditorEngine::TeardownPlaySession() + 1576 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\playlevel.cpp:442]
UE4Editor_UnrealEd!UEditorEngine::EndPlayMap() + 2396 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\playlevel.cpp:182]
UE4Editor_UnrealEd!UEditorEngine::Tick() + 804 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\editor.cpp:966]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() + 22 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\editor\unrealed\private\unrealedengine.cpp:347]
UE4Editor!FEngineLoop::Tick() + 4179 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launchengineloop.cpp:2257]
UE4Editor!GuardedMain() + 1404 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launch.cpp:142]
UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

Seems to happen here in World.cpp

bool UWorld::IsGameWorld() const
{
	return WorldType == EWorldType::Game || WorldType == EWorldType::PIE;
}

Hi, do you have navigation bounds volumes in the streaming levels? It seems like it crashing trying to unload navigation data.

Could you tell me how you stream sub-levels? They are marked as “Always Loaded” or you are using blueprints to load them?

Indeed, one of the sub levels has a navigation volume. Just tested moving it to the empty persistent level but still crashes.

Sub levels are set to always loaded at the moment.

Could you delete all Recast actors in all levels, then place navigation volume in the persistent level and then Build->Build Paths? It should help. Also as a last option you can set RebuildAtRuntime property in Recast actor to ‘true’.

Alright, deleting everything nav-related in the sub level and then putting an new navigation volume into the persistent level has fixed the crash. Thanks a lot.

Is this expected or just buggy?

Hm, sounds more like this is expected. An Access Violation is a NULL pointer exception. So you are trying to access to a pointer variable that is empty (NULL). But ddvlost can explain better to you why exactly this is happening at this point (:

Good to know that this workaround works for you. This crash is not expected, and was caused by a stale Recast actor in the streaming level. Recast actors should exist only in the persistent level. We will make proper fix for 4.8.

Hi all,

For internal reference, this is logged as UE-12532.