Mini dump is not generated on shipping build!

mini dump is not generated on shipping build (Windows platform)!

The problem is due to the Logs folder that doesn’t exist (AppData/Local/…/Saved/Logs, because the shipping version doen’t have logs) and so the WriteMinidump() fails when try to create the file (.dmp)

thanks a lot,
Martin

Howdy hurricane86,

Thank you for reporting this issue. I am going to need a bit more information on this issue before I am able to look into what may be happening. What version of UE4 are you currently on? Also, are you able to see any log files by following this route: AppData\Local\Microsoft\Windows\WER\ReportQueue ?

Any additional information would be greatly appreciated.

Thanks and have a great day!

Hi Sean,

im working with UE 4.5.1 .
Yes in that folder there are some files (Report.wer and a metadata) but no dump… BUT if you, by hand, create the Logs folder the dump is created!

the line that fails is:

HANDLE FileHandle = CreateFileW(Path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);

in WindowsPlatformExceptionHandling:40

because the Path is not valid (Logs folder doesn’t exist!)

It does look like it uses the log directory and if the log system isn’t initialized then it will not create by default.
Seems to me if the MiniDumpFilenameW is going to be set to the GameLogDir then it should create the directory at the same time.
I’m going to test out this change and submit in the next couple of days.
I changed LaunchEngineLoop.cpp Search for “MiniDumpFilenameW” and modify as below

#if PLATFORM_WINDOWS

	// make sure that the log directory exists //added
	IFileManager::Get().MakeDirectory( *FPaths::GameLogDir() ); //added

	// update the mini dump filename now that we have enough info to point it to the log folder even in installed builds
	FCString::Strcpy(MiniDumpFilenameW, *IFileManager::Get().ConvertToAbsolutePathForExternalAppForWrite(*FString::Printf(TEXT("%sunreal-v%i-%s.dmp"), *FPaths::GameLogDir(), GEngineVersion.GetChangelist(), *FDateTime::Now().ToString())));
#endif

I’ll submit into Main, it won’t make it for 4.6 but should be in 4.7.

Hi, I still encountered this problem with 4.7.6 (a crash occured during gameplay, so far after any system initialization).

Implementing a custom FDefaultGameModuleImpl and adding:

void MyGameModuleImpl::StartupModule()
{
	IPlatformFile& PF = FPlatformFileManager::Get().GetPlatformFile();
	if (!PF.DirectoryExists(*FPaths::GameLogDir()))
	{
		PF.CreateDirectory(*FPaths::GameLogDir());
	}
}

solved it.

Glad to hear that you have found a workaround for this Kafu!!

I have just looked into the Jira ticket that was created for this issue and it has been closed out as the logs not being generated is by design, but can be overridden. Thank you for providing this workaround.

Thanks and have a great day!