Bugsplat

Expired Player setup
dmilbrath1 [github] · 5 months ago

Issue description

System.ExecutionEngineException: Couldn't create thread. Error 0x5af
at (wrapper managed-to-native) System.Threading.Thread.Thread_internal(System.Threading.Thread,System.MulticastDelegate)
at System.Threading.Thread.StartInternal (System.Object principal, System.Threading.StackCrawlMark& stackMark) [0x0001a]
at System.Threading.Thread.Start (System.Threading.StackCrawlMark& stackMark) [0x00028]
at System.Threading.Thread.Start () [0x00002]
at Mafi.Core.GameLoop.BackgroundTaskRunner.PerformWork (System.Boolean inBackgroundThread) [0x00049]
at Mafi.Core.GameLoop.GameRunner.performSimUpdateWork (System.Boolean idle, System.Boolean inBackgroundThread) [0x0004e]
at Mafi.Core.GameLoop.GameRunner.performSyncAndStartSim (System.Single deltaTimeMs) [0x0012a]
at Mafi.Core.GameLoop.GameRunner.Update (Mafi.Fix32 deltaTimeMs) [0x000c9]
at Mafi.Unity.GamePlayScene+<Initialize>d__25.MoveNext () [0x00122]
at Mafi.Unity.Main+<unloadAndStartNewScene>d__108.MoveNext () [0x0013b]
at Mafi.Unity.Main.stepSceneInitialization () [0x000fd]

Reproduction steps

Loading up game, black screen, flash flash, bug appeared before loading

Game version and build number

v0.8.3a b578

Operating system

Windows

poltime poltime · 5 months ago

The error System.ExecutionEngineException: Couldn't create thread. Error 0x5af points to a critical failure in the runtime environment. It happens when the game tries to spawn a new background thread for simulation but is rejected by the operating system.
The error code 0x5af (decimal 1455) corresponds to the Windows system message: "The paging file is too small for this operation to complete" (ERROR_COMMITMENT_LIMIT).
Insufficient Virtual Memory: Your system has run out of RAM and Page File space to allocate resources for a new thread.
Thread Limit: The application or the OS has reached the maximum number of concurrent threads allowed.
Security Software Interference: Antivirus or firewall software might be blocking the engine from creating new processes/threads.
Corrupted Game Files: An error during stepSceneInitialization could be caused by corrupted data.
Increase the Page File (Virtual Memory)
Go to System Settings -> Advanced -> Performance Settings -> Advanced tab -> Virtual Memory.
Ensure the Page File is enabled. It is recommended to select "System managed size" or manually set it to match your total RAM capacity.
Free Up RAM
Close browsers (especially Chrome) and other heavy background applications before launching the game.
Check Task Manager: if memory usage is above 90%, the game won't have enough overhead to create simulation threads.
Verify Integrity of Game Files (Steam)
Right-click Captain of Industry in your Library -> Properties -> Installed Files -> Verify integrity of game files.
Configure Antivirus
Add the game folder and the Captain of Industry.exe file to the exclusions list of your Antivirus or Windows Defender.
Update Drivers and OS
Make sure you have the latest Windows updates and GPU drivers installed, as older versions can sometimes cause multithreading issues in Unity.

Captain Filip Captain Filip · 15 days ago

Error 0x5af means Windows ran out of virtual memory (the paging file is too small) when the game started a new thread. Setting the paging file to a system managed size fixes this.

Closed as ⏱️ Expired

7 Showing 1–3 of 3