Packaging fatal error when cooking

I have a cooking problem. There are 3 modules Client, Server, and Default Project Module

Output Log Window

UATHelper: Cooking (Windows): Script Stack (0 frames):
UATHelper: Cooking (Windows): LogWindows: Error: begin: stack for UAT
UATHelper: Cooking (Windows): LogWindows: Error: === Critical error: ===
UATHelper: Cooking (Windows): LogWindows: Error:
UATHelper: Cooking (Windows): LogWindows: Error: Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp] [Line: 105]
UATHelper: Cooking (Windows): LogWindows: Error: SECURE CRT: Invalid parameter detected.
UATHelper: Cooking (Windows): LogWindows: Error: Expression: Unknown Function: Unknown. File: Unknown Line: 0
UATHelper: Cooking (Windows): LogWindows: Error:
UATHelper: Cooking (Windows): LogWindows: Error:
UATHelper: Cooking (Windows): LogWindows: Error:
UATHelper: Cooking (Windows): LogWindows: Error:
UATHelper: Cooking (Windows): LogWindows: Error:
UATHelper: Cooking (Windows): LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION 0x00007ffb10494660
UATHelper: Cooking (Windows): LogWindows: Error:
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffb10494660 UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffb3ad5eebe UnrealEditor-CoreUObject.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffb3ad4014a UnrealEditor-CoreUObject.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffb3abf8245 UnrealEditor-CoreUObject.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffb356da5e2 UnrealEditor-Core.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffb356fe583 UnrealEditor-Core.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffb4094aaf6 UnrealEditor-Projects.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffb4094ae31 UnrealEditor-Projects.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ff736bb53cb UnrealEditor-Cmd.exe!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ff736bb866e UnrealEditor-Cmd.exe!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ff736bb0bbd UnrealEditor-Cmd.exe!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ff736bb0e8a UnrealEditor-Cmd.exe!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ff736bb3c4d UnrealEditor-Cmd.exe!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ff736bc5534 UnrealEditor-Cmd.exe!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ff736bc7842 UnrealEditor-Cmd.exe!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffc1ab854e0 KERNEL32.DLL!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffc1b16485b ntdll.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error:
UATHelper: Cooking (Windows): LogWindows: Error: end: stack for UAT
PackagingResults: Error: begin: stack for UAT
PackagingResults: Error: === Critical error: ===
PackagingResults: Error: Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp] [Line: 105]
PackagingResults: Error: SECURE CRT: Invalid parameter detected.
PackagingResults: Error: Expression: Unknown Function: Unknown. File: Unknown Line: 0
PackagingResults: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION 0x00007ffb10494660
PackagingResults: Error: [Callstack] 0x00007ffb10494660 UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffb3ad5eebe UnrealEditor-CoreUObject.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffb3ad4014a UnrealEditor-CoreUObject.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffb3abf8245 UnrealEditor-CoreUObject.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffb356da5e2 UnrealEditor-Core.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffb356fe583 UnrealEditor-Core.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffb4094aaf6 UnrealEditor-Projects.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffb4094ae31 UnrealEditor-Projects.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ff736bb53cb UnrealEditor-Cmd.exe!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ff736bb866e UnrealEditor-Cmd.exe!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ff736bb0bbd UnrealEditor-Cmd.exe!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ff736bb0e8a UnrealEditor-Cmd.exe!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ff736bb3c4d UnrealEditor-Cmd.exe!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ff736bc5534 UnrealEditor-Cmd.exe!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ff736bc7842 UnrealEditor-Cmd.exe!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffc1ab854e0 KERNEL32.DLL!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffc1b16485b ntdll.dll!UnknownFunction []
PackagingResults: Error: end: stack for UAT
UATHelper: Cooking (Windows): Took 11.0353864s to run UnrealEditor-Cmd.exe, ExitCode=3
UATHelper: Cooking (Windows): ERROR: Cook failed.
UATHelper: Cooking (Windows):        (see C:\Users\tugru\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+UE_5.0\Log.txt for full exception trace)
PackagingResults: Error: Cook failed.
UATHelper: Cooking (Windows): AutomationTool executed for 0h 0m 13s
UATHelper: Cooking (Windows): AutomationTool exiting with ExitCode=25 (Error_UnknownCookFailure)
UATHelper: Cooking (Windows): BUILD FAILED
LogDerivedDataCache: C:/Users/tugru/AppData/Local/UnrealEngine/Common/DerivedDataCache: Maintenance finished in +00:00:03.822 and deleted 0 file(s) with total size 0 MiB.
LogTurnkeySupport: Display: Adding device menu item for TUGRUL

File: C:\Users\tugru\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+UE_5.0\Log.txt

Script Stack (0 frames):

LogWindows: Error: begin: stack for UAT
LogWindows: Error: === Critical error: ===
LogWindows: Error:
LogWindows: Error: Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp] [Line: 105]
LogWindows: Error: SECURE CRT: Invalid parameter detected.
LogWindows: Error: Expression: Unknown Function: Unknown. File: Unknown Line: 0
LogWindows: Error:
LogWindows: Error:
LogWindows: Error:
LogWindows: Error:
LogWindows: Error:
LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION 0x00007ffb10494660
LogWindows: Error:
LogWindows: Error: [Callstack] 0x00007ffb10494660 UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffb3ad5eebe UnrealEditor-CoreUObject.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffb3ad4014a UnrealEditor-CoreUObject.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffb3abf8245 UnrealEditor-CoreUObject.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffb356da5e2 UnrealEditor-Core.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffb356fe583 UnrealEditor-Core.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffb4094aaf6 UnrealEditor-Projects.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffb4094ae31 UnrealEditor-Projects.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff736bb53cb UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff736bb866e UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff736bb0bbd UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff736bb0e8a UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff736bb3c4d UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff736bc5534 UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff736bc7842 UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffc1ab854e0 KERNEL32.DLL!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffc1b16485b ntdll.dll!UnknownFunction []
LogWindows: Error:
LogWindows: Error: end: stack for UAT
Took 11.0353864s to run UnrealEditor-Cmd.exe, ExitCode=3
SafeDeleteFile C:\Users\tugru\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+UE_5.0\Cook-2022.04.26-15.17.36.txt
SafeCopyFile C:\UE_5.0\Engine\Programs\AutomationTool\Saved\Cook-2022.04.26-15.17.24.txt C:\Users\tugru\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+UE_5.0\Cook-2022.04.26-15.17.36.txt
SafeDeleteFile C:\UE_5.0\Engine\Programs\AutomationTool\Saved\Cook-2022.04.26-15.17.24.txt
==============================================================================
ERROR: Cook failed.
       (see C:\Users\tugru\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+UE_5.0\Log.txt for full exception trace)

CommandletException: Editor terminated with exit code 3 while running Cook for C:\Users\tugru\desktop\T\ThreeEmpires\ThreeEmpires.uproject; see log C:\Users\tugru\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+UE_5.0\Cook-2022.04.26-15.17.36.txt
   at AutomationTool.CommandUtils.RunCommandlet(FileReference ProjectName, String UnrealExe, String Commandlet, String Parameters, String& DestLogFile, Int32 ErrorLevel) in D:\build\++UE5\Sync\Engine\Source\Programs\AutomationTool\AutomationUtils\CommandletUtils.cs:line 425
   at AutomationTool.CommandUtils.CookCommandlet(FileReference ProjectName, String UnrealExe, String[] Maps, String[] Dirs, String InternationalizationPreset, String[] CulturesToCook, String TargetPlatform, String Parameters) in D:\build\++UE5\Sync\Engine\Source\Programs\AutomationTool\AutomationUtils\CommandletUtils.cs:line 91
   at AutomationScripts.Project.Cook(ProjectParams Params) in D:\build\++UE5\Sync\Engine\Source\Programs\AutomationTool\Scripts\CookCommand.Automation.cs:line 268Wrapped by AutomationException: Cook failed.
   at AutomationScripts.Project.Cook(ProjectParams Params) in D:\build\++UE5\Sync\Engine\Source\Programs\AutomationTool\Scripts\CookCommand.Automation.cs:line 284
   at BuildCookRun.DoBuildCookRun(ProjectParams Params) in D:\build\++UE5\Sync\Engine\Source\Programs\AutomationTool\Scripts\BuildCookRun.Automation.cs:line 206
   at BuildCookRun.ExecuteBuild() in D:\build\++UE5\Sync\Engine\Source\Programs\AutomationTool\Scripts\BuildCookRun.Automation.cs:line 41
   at AutomationTool.BuildCommand.Execute() in D:\build\++UE5\Sync\Engine\Source\Programs\AutomationTool\AutomationUtils\BuildCommand.cs:line 344
   at AutomationTool.Automation.Execute(List`1 CommandsToExecute, Dictionary`2 Commands) in D:\build\++UE5\Sync\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:line 254
   at AutomationTool.Automation.Process(ParsedCommandLine AutomationToolCommandLine, StartupTraceListener StartupListener, HashSet`1 ScriptModuleAssemblies) in D:\build\++UE5\Sync\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:line 153
==============================================================================
AutomationTool executed for 0h 0m 13s
AutomationTool exiting with ExitCode=25 (Error_UnknownCookFailure)

C:\Users\tugru\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+UE_5.0\Cook-2022.04.26-15.17.36.txt

Script Stack (0 frames):

LogWindows: Windows GetLastError: The operation completed successfully. (0)
LogWindows: Failed to load 'C:/Users/tugru/desktop/T/ThreeEmpires/Binaries/Win64/UnrealEditor-Client.dll' (GetLastError=1114)
LogWindows: Error: begin: stack for UAT
LogWindows: Error: === Critical error: ===
LogWindows: Error: 
LogWindows: Error: Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp] [Line: 105] 
LogWindows: Error: SECURE CRT: Invalid parameter detected.
LogWindows: Error: Expression: Unknown Function: Unknown. File: Unknown Line: 0
LogWindows: Error: 
LogWindows: Error: 
LogWindows: Error: 
LogWindows: Error: 
LogWindows: Error: 
LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION 0x00007ffb10494660
LogWindows: Error: 
LogWindows: Error: [Callstack] 0x00007ffb10494660 UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffb3ad5eebe UnrealEditor-CoreUObject.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffb3ad4014a UnrealEditor-CoreUObject.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffb3abf8245 UnrealEditor-CoreUObject.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffb356da5e2 UnrealEditor-Core.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffb356fe583 UnrealEditor-Core.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffb4094aaf6 UnrealEditor-Projects.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffb4094ae31 UnrealEditor-Projects.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff736bb53cb UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff736bb866e UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff736bb0bbd UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff736bb0e8a UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff736bb3c4d UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff736bc5534 UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff736bc7842 UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffc1ab854e0 KERNEL32.DLL!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffc1b16485b ntdll.dll!UnknownFunction []
LogWindows: Error: 
LogWindows: Error: end: stack for UAT
LogExit: Executing StaticShutdownAfterError
LogWindows: FPlatformMisc::RequestExit(1)
LogWindows: FPlatformMisc::RequestExitWithStatus(1, 3)
LogCore: Engine exit requested (reason: Win RequestExit)
Log file closed, 04/26/22 15:17:30

I checked everything, when I try to use anything in my own static library in any module, the project is unable to be cooked. I before used my lib in 4.27.2 and there was no problem.

  • I have no problem compiling the project, the problem is cooking when packaging.
  • I rebuilt my static lib in Windows 11 Visual Studio 2022 (same as my UE5 project).
LogWindows: Failed to load 'C:/Users/tugru/desktop/T/ThreeEmpires/Binaries/Win64/UnrealEditor-Client-0023.dll' (GetLastError=1114)
Message dialog closed, result: Ok, title: Message, text: The game module 'ThreeEmpires' could not be loaded. There may be an operating system error, the module may not be properly set up, or a plugin which has been included into the build has not been turned on.
LogCore: Engine exit requested (reason: EngineExit() was called)
LogStaticMesh: Abandoning remaining async distance field tasks for shutdown
LogStaticMesh: Abandoning remaining async card representation tasks for shutdown
LogExit: Preparing to exit.
LogUObjectArray: CloseDisregardForGC: 0/0 objects in disregard for GC pool
LogDemo: Cleaned up 0 splitscreen connections with owner deletion
LogUObjectArray: Warning: Other object in slot
LogWindows: Error: Error reentered: Assertion failed: IsValidLowLevel() [File:D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Obj.cpp] [Line: 967] 


LogWindows: Error: begin: stack for UAT
LogWindows: Error: === Critical error: ===
LogWindows: Error: 
LogWindows: Error: Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp] [Line: 105] 
LogWindows: Error: SECURE CRT: Invalid parameter detected.
LogWindows: Error: Expression: Unknown Function: Unknown. File: Unknown Line: 0
LogWindows: Error: 
LogWindows: Error: 
LogWindows: Error: 
LogWindows: Error: [Callstack] 0x00007ffbd6f92011 UnrealEditor-CoreUObject.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffbd6f7144c UnrealEditor-CoreUObject.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffbd6f110fa UnrealEditor-CoreUObject.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffbd6fc565e UnrealEditor-CoreUObject.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffbd6e2e617 UnrealEditor-CoreUObject.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff75a897f7d UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff75a897897 UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff75a8a0097 UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff75a8a0e2b UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff75a8a0e8a UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff75a8a3c4d UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff75a8b5534 UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ff75a8b7842 UnrealEditor-Cmd.exe!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffc1ab854e0 KERNEL32.DLL!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffc1b16485b ntdll.dll!UnknownFunction []
LogWindows: Error: 
LogWindows: Error: end: stack for UAT
LogExit: Executing StaticShutdownAfterError
LogWindows: FPlatformMisc::RequestExit(1)
LogWindows: FPlatformMisc::RequestExitWithStatus(1, 3)
LogCore: Engine exit requested (reason: Win RequestExit; note: exit was already requested)
Log file closed, 04/26/22 16:56:30

I tried my library in another project

UATHelper: Cooking (Windows): LogOutputDevice: Warning:
UATHelper: Cooking (Windows): Script Stack (0 frames):
UATHelper: Cooking (Windows): LogWindows: Error: begin: stack for UAT
UATHelper: Cooking (Windows): LogWindows: Error: === Critical error: ===
UATHelper: Cooking (Windows): LogWindows: Error:
UATHelper: Cooking (Windows): LogWindows: Error: Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp] [Line: 105]
UATHelper: Cooking (Windows): LogWindows: Error: SECURE CRT: Invalid parameter detected.
UATHelper: Cooking (Windows): LogWindows: Error: Expression: Unknown Function: Unknown. File: Unknown Line: 0
UATHelper: Cooking (Windows): LogWindows: Error:
UATHelper: Cooking (Windows): LogWindows: Error:
UATHelper: Cooking (Windows): LogWindows: Error:
UATHelper: Cooking (Windows): LogWindows: Error:
UATHelper: Cooking (Windows): LogWindows: Error:
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ff7c21f117c UnrealEditor-Cmd.exe!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffcbf0b8774 ucrtbase.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffcbf0b86b0 ucrtbase.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffcbf0b8679 ucrtbase.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffcbf0e5d32 ucrtbase.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffcbf094a00 ucrtbase.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffcbf09301b ucrtbase.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffcbf092f3b ucrtbase.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffcbf092eeb ucrtbase.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffbfc61398b UnrealEditor-MyProject-6471.dll!printf() [C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\stdio.h:963]
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffbfc6149b1 UnrealEditor-MyProject-6471.dll!KT::Logger::operator()<1,0,char const * __ptr64,char const * __ptr64,char const * __ptr64>() []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffbfc615b67 UnrealEditor-MyProject-6471.dll!KT::Logger::Init() []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffbfc612cd9 UnrealEditor-MyProject-6471.dll!AMyActor::AMyActor() [C:\Users\tugru\desktop\MyProject\Source\MyProject\MyActor.cpp:12]
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffc36eac4fd UnrealEditor-CoreUObject.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffc3718044d UnrealEditor-CoreUObject.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffc3716027b UnrealEditor-CoreUObject.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffc37018245 UnrealEditor-CoreUObject.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffc35e3a5e2 UnrealEditor-Core.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffc35e5e957 UnrealEditor-Core.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffc384daaf6 UnrealEditor-Projects.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffc384dae31 UnrealEditor-Projects.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ff7c21f53cb UnrealEditor-Cmd.exe!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ff7c21f866e UnrealEditor-Cmd.exe!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ff7c21f0bbd UnrealEditor-Cmd.exe!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ff7c21f0e8a UnrealEditor-Cmd.exe!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ff7c21f3c4d UnrealEditor-Cmd.exe!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ff7c2205534 UnrealEditor-Cmd.exe!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ff7c2207842 UnrealEditor-Cmd.exe!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffcc09054e0 KERNEL32.DLL!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error: [Callstack] 0x00007ffcc1ba485b ntdll.dll!UnknownFunction []
UATHelper: Cooking (Windows): LogWindows: Error:
UATHelper: Cooking (Windows): LogWindows: Error: end: stack for UAT
PackagingResults: Error: begin: stack for UAT
PackagingResults: Error: === Critical error: ===
PackagingResults: Error: Fatal error: [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp] [Line: 105]
PackagingResults: Error: SECURE CRT: Invalid parameter detected.
PackagingResults: Error: Expression: Unknown Function: Unknown. File: Unknown Line: 0
PackagingResults: Error: [Callstack] 0x00007ff7c21f117c UnrealEditor-Cmd.exe!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffcbf0b8774 ucrtbase.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffcbf0b86b0 ucrtbase.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffcbf0b8679 ucrtbase.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffcbf0e5d32 ucrtbase.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffcbf094a00 ucrtbase.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffcbf09301b ucrtbase.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffcbf092f3b ucrtbase.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffcbf092eeb ucrtbase.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffbfc61398b UnrealEditor-MyProject-6471.dll!printf() [C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\stdio.h:963]
PackagingResults: Error: [Callstack] 0x00007ffbfc6149b1 UnrealEditor-MyProject-6471.dll!KT::Logger::operator()<1,0,char const * __ptr64,char const * __ptr64,char const * __ptr64>() []
PackagingResults: Error: [Callstack] 0x00007ffbfc615b67 UnrealEditor-MyProject-6471.dll!KT::Logger::Init() []
PackagingResults: Error: [Callstack] 0x00007ffbfc612cd9 UnrealEditor-MyProject-6471.dll!AMyActor::AMyActor() [C:\Users\tugru\desktop\MyProject\Source\MyProject\MyActor.cpp:12]
PackagingResults: Error: [Callstack] 0x00007ffc36eac4fd UnrealEditor-CoreUObject.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffc3718044d UnrealEditor-CoreUObject.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffc3716027b UnrealEditor-CoreUObject.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffc37018245 UnrealEditor-CoreUObject.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffc35e3a5e2 UnrealEditor-Core.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffc35e5e957 UnrealEditor-Core.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffc384daaf6 UnrealEditor-Projects.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffc384dae31 UnrealEditor-Projects.dll!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ff7c21f53cb UnrealEditor-Cmd.exe!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ff7c21f866e UnrealEditor-Cmd.exe!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ff7c21f0bbd UnrealEditor-Cmd.exe!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ff7c21f0e8a UnrealEditor-Cmd.exe!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ff7c21f3c4d UnrealEditor-Cmd.exe!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ff7c2205534 UnrealEditor-Cmd.exe!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ff7c2207842 UnrealEditor-Cmd.exe!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffcc09054e0 KERNEL32.DLL!UnknownFunction []
PackagingResults: Error: [Callstack] 0x00007ffcc1ba485b ntdll.dll!UnknownFunction []
PackagingResults: Error: end: stack for UAT
UATHelper: Cooking (Windows): Took 11.594666499999999s to run UnrealEditor-Cmd.exe, ExitCode=3
UATHelper: Cooking (Windows): ERROR: Cook failed.
UATHelper: Cooking (Windows):        (see C:\Users\tugru\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+UE_5.0\Log.txt for full exception trace)
UATHelper: Cooking (Windows): AutomationTool executed for 0h 0m 14s
UATHelper: Cooking (Windows): AutomationTool exiting with ExitCode=25 (Error_UnknownCookFailure)
UATHelper: Cooking (Windows): BUILD FAILED
PackagingResults: Error: Cook failed.

I use std::enable_if and cpp17, is this a problem for UE5.0.1

		template <ELogType LogType, std::enable_if_t<LogType == ELogType::FATAL, int> = 0, typename... Args>
		void operator()(const char* format, Args... args)
		{
			std::snprintf(log_buffer, log_buffer_size, format, args...);
			std::printf(format, args...);

			log_file << log_buffer;
			log_file.flush();

			Destroy();
			exit(EXIT_FAILURE);
		}

		template <ELogType LogType, std::enable_if_t<LogType == ELogType::NORMAL, int> = 0, typename... Args>
		void operator()(const char* format, Args... args)
		{
			std::snprintf(log_buffer, log_buffer_size, format, args...);
			std::printf(format, args...);
			log_file << log_buffer;
			log_file.flush();
		}

		template <ELogType LogType, std::enable_if_t<LogType == ELogType::PRINT, int> = 0, typename... Args>
		void operator()(const char* format, Args... args)
		{
			std::printf(format, args...);
		}

When i delete this line in Init func of logger.cpp in my library, I no longer get the error.

log_info((*this), "Log system is started %s/%s.", folder_name.c_str(), file_name.c_str());
  • log_info is a macro.

Then I checked what this macro does,

std::printf(format, args...);

if constexpr(LogType == ELogType::NORMAL || LogType == ELogType::FATAL)
{
	if (!is_initialized)
		Init("log", "LogSystem_NotInitialized");

	std::snprintf(log_buffer, log_buffer_size, format, args...);
	log_file << log_buffer;
	log_file.flush();

	if constexpr (LogType == ELogType::FATAL)
	{
		.....
	}
}

I deleted this std::printf line, and there is no error anymore. I think it is about std::print function. But when i try to use this function in another actor function , i get no error. It gives error only in Init funtion.

It can be related to that;

Paul.Tankard
Feb '17
For completeness sake I’ve found the actual cause of this, it’s trivial but was a pain to find.

As already mentioned, you can disable the CRT checks but you will lose the code that will check for any malformed strings. The real problem is caused by UE forcing stdout to UTF-8, when packaging, I’m not sure why this is needed.

When stdout is set to UTF-8, you can’t use printf or std::cout, it will fail this check _VALIDATE_STREAM_ANSI_RETURN.

The correct fix would be to replace printf / std::cout with wprintf / std::wcout, you can change any %s instanced in your printf calls to %hs to avoid having to change more code than needed. If it’s a third-party supplied dll/lib, it might be worth relaying the information.

After I test it one more time, I’ll reply if it is solved

I found this post searching for the same crash happening in a packaged Shipping game. Other search results point to Windows Defender’s Ransomware Protection potentially being faulty/crashing during a scan/check. Use at your own risk, but adding an exception to the UE binaries or disabling ransomware protection altogether may fix this issue (untested)

I found this topic from googling, as I was having the same problem, albeit I had accidentally fixed it once. However I am testing some “startup” scripts for my own project so I am constantly re-dling it from scratch and the problem came back.

The problem does seem to be related to “printf” family of functions. I just had a stupid print in a destructor and my baking failed.

However, merely removing the printf didn’t fix the issue. And infact, I put the printf back in. However, what seems to have fixed the issue was causing that file to recompile, and relaunching the UE5 editor completely (in my case, from VS as I am compiling UE5 as well as my project locally.

Hope this helps someone who finds this in the future :slight_smile: