Searching the default UE4 save path crashes the engine

Hi All

I’m assuming this is a bug;

If I try and use an object library to locate asset registry exposed properties of save files, the engine crashes immediately. I’m writing this;

UObjectLibrary* MetaSaveLibrary = UObjectLibrary::CreateLibrary(URRMetaSaveGame::StaticClass(), false, GIsEditor);
MetaSaveLibrary->AddToRoot();

MetaSaveLibrary->LoadAssetDataFromPath(TEXT("/Saved/SaveGames"));

This location has two .sav files in it, which the engine put there using the UGameplayStatics function. I got the “Path does not map to any roots error”…

Thanks!

EDIT:
Unknown exception - code 00000001 (first/second chance not available)

"Fatal error: [File:C:\Users\Robbie\Documents\GitHub\UnrealEngine\Engine\Source\Runtime\CoreUObject\Private\Misc\PackageName.cpp] [Line: 345] 
LongPackageNameToFilename fail

UE4Editor_Core!FDebug::AssertFailed() [c:\users\robbie\documents\github\unrealengine\engine\source\runtime\core\private\misc\outputdevice.cpp:374]
UE4Editor_CoreUObject!FPackageName::LongPackageNameToFilename() [c:\users\robbie\documents\github\unrealengine\engine\source\runtime\coreuobject\private\misc\packagename.cpp:347]
UE4Editor_AssetRegistry!FAssetDataGatherer::DiscoverFilesToSearch() [c:\users\robbie\documents\github\unrealengine\engine\source\runtime\assetregistry\private\assetdatagatherer.cpp:379]
UE4Editor_AssetRegistry!FAssetDataGatherer::Run() [c:\users\robbie\documents\github\unrealengine\engine\source\runtime\assetregistry\private\assetdatagatherer.cpp:96]
UE4Editor_AssetRegistry!FAssetDataGatherer::FAssetDataGatherer() [c:\users\robbie\documents\github\unrealengine\engine\source\runtime\assetregistry\private\assetdatagatherer.cpp:34]
UE4Editor_AssetRegistry!FAssetRegistry::ScanPathsSynchronous_Internal() [c:\users\robbie\documents\github\unrealengine\engine\source\runtime\assetregistry\private\assetregistry.cpp:1654]
UE4Editor_Engine!UObjectLibrary::LoadAssetDataFromPaths() [c:\users\robbie\documents\github\unrealengine\engine\source\runtime\engine\private\objectlibrary.cpp:303]
UE4Editor_Engine!UObjectLibrary::LoadAssetDataFromPath() [c:\users\robbie\documents\github\unrealengine\engine\source\runtime\engine\classes\engine\objectlibrary.h:139]
UE4Editor_ErrorRepro!AErrorReproGameMode::PopulateSaveList() [c:\users\robbie\documents\unreal projects\errorrepro\source\errorrepro\errorreprogamemode.cpp:28]
UE4Editor_Engine!UWorld::BeginPlay() [c:\users\robbie\documents\github\unrealengine\engine\source\runtime\engine\private\world.cpp:3082]
UE4Editor_Engine!UGameInstance::StartPIEGameInstance() [c:\users\robbie\documents\github\unrealengine\engine\source\runtime\engine\private\gameinstance.cpp:274]
UE4Editor_UnrealEd!UEditorEngine::CreatePIEGameInstance() [c:\users\robbie\documents\github\unrealengine\engine\source\editor\unrealed\private\playlevel.cpp:3012]
UE4Editor_UnrealEd!UEditorEngine::PlayInEditor() [c:\users\robbie\documents\github\unrealengine\engine\source\editor\unrealed\private\playlevel.cpp:2259]
UE4Editor_UnrealEd!UEditorEngine::StartQueuedPlayMapRequest() [c:\users\robbie\documents\github\unrealengine\engine\source\editor\unrealed\private\playlevel.cpp:1048]
UE4Editor_UnrealEd!UEditorEngine::Tick() [c:\users\robbie\documents\github\unrealengine\engine\source\editor\unrealed\private\editorengine.cpp:1244]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() [c:\users\robbie\documents\github\unrealengine\engine\source\editor\unrealed\private\unrealedengine.cpp:361]
UE4Editor!FEngineLoop::Tick() [c:\users\robbie\documents\github\unrealengine\engine\source\runtime\launch\private\launchengineloop.cpp:2427]
UE4Editor!GuardedMain() [c:\users\robbie\documents\github\unrealengine\engine\source\runtime\launch\private\launch.cpp:142]
UE4Editor!GuardedMainWrapper() [c:\users\robbie\documents\github\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() [c:\users\robbie\documents\github\unrealengine\engine\source\runtime\launch\private\windows\launchwindows.cpp:200]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
kernel32
ntdll

Hey robbiecooper-

Are you referring to saving a project or trying to save a game? If you’re able to reproduce this in a new project can you project the sample or project and/or list the steps you used? Additionally, can you provide the callstack and log files from the crash for more information.

Cheers

Hi , I’ve edited the question to show the call stack. I have a project for error repros and have reproduced it in that. I’m uploading it to dropbox and sending a link to your forum account. .

In the sample project, is the crash when pressing play the crash you’re referring to here? I saw the DebugSaveGame class which did not have anything added to it. I created a class based on SaveGame in the same manor however I did not crash when I clicked the play button. Is there further setup required to cause the crash? Knowing how the crash is caused will help narrow down exactly where the crash is coming from.

Yes, thats it. If you look at the ErrorRepro game mode, the crash is being caused by these lines in PopulateSaveList function;

UObjectLibrary* MetaSaveLibrary = UObjectLibrary::CreateLibrary(UDebugSaveGame::StaticClass(), false, GIsEditor);
	MetaSaveLibrary->AddToRoot();
	 
	MetaSaveLibrary->LoadAssetDataFromPath(TEXT("/Saved/SaveGames"));

After testing the sample project and reviewing the documentation for LoadAssetDataFromPath (https://docs.unrealengine.com/latest/INT/Programming/Assets/AsyncLoading/index.html) I noticed that the call you make to LoadAssetDataFromPath() is missing “/Game” at the beginning of the path name. Adding this and recompiling the code should fix the crash.

Hey , it did fix the crash. However, that isnt the default save location. The object library isnt finding anything in that location…

I’ve entered a bug report (UE-23689) for investigation into the cause of the crash.

Hey robbiecooper,

This was returned as a ‘Won’t Fix’ as /Saved/SaveGames is not a valid UE4 path. UE4 does not define or recognize /Saved/ root folder. Valid options are:
/Engine/
/Game/
/Script/
/Temp/ ← this is the one that maps to Saved folder

Let me know if you have further questions.

Thank you,