Page 1 of 1

[2.0.38] Crash with FPS Friendly Thrusters mod (DrawEngine::prepareThrusterJetFlames)

Posted: Tue Mar 04, 2025 5:54 pm
by eugenekay
Minimal reproduction case attached, crashes in 2.0.38; does not crash in 2.0.37.

What did you do?
Loaded a Testing Scenario created in 2.0.37.

What happened?
pic

Code: Select all

  70.818 Error CrashHandler.cpp:641: Received SIGSEGV
Factorio crashed. Generating symbolized stacktrace, please wait ...
C:\Users\build\AppData\Local\Temp\factorio-build-w4ctiU\libraries\StackWalker\StackWalker.cpp(924): StackWalker::ShowCallstack
C:\Users\build\AppData\Local\Temp\factorio-build-w4ctiU\src\Util\Logger.cpp(337): Logger::writeStacktrace
C:\Users\build\AppData\Local\Temp\factorio-build-w4ctiU\src\Util\Logger.cpp(379): Logger::logStacktrace
C:\Users\build\AppData\Local\Temp\factorio-build-w4ctiU\src\Util\CrashHandler.cpp(183): CrashHandler::writeStackTrace
C:\Users\build\AppData\Local\Temp\factorio-build-w4ctiU\src\Util\CrashHandler.cpp(654): CrashHandler::SignalHandler
minkernel\crts\ucrt\src\appcrt\misc\exception_filter.cpp(219): _seh_filter_exe
D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(304): `__scrt_common_main_seh'::`1'::filt$0
D:\a\_work\1\s\src\vctools\crt\vcruntime\src\eh\riscchandler.cpp(389): __C_specific_handler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFBD8983F0F)
00007FFBD8983F0F (ntdll): (filename not available): _chkstk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFBD8833B78)
00007FFBD8833B78 (ntdll): (filename not available): RtlWow64GetCurrentCpuArea
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFBD898384E)
00007FFBD898384E (ntdll): (filename not available): KiUserExceptionDispatcher
C:\Users\build\AppData\Local\Temp\factorio-build-w4ctiU\src\Graphics\DrawEngine.cpp(125): 
C:\Users\build\AppData\Local\Temp\factorio-build-w4ctiU\src\Graphics\DrawEngine.cpp(108): DrawEngine::prepare
C:\Users\build\AppData\Local\Temp\factorio-build-w4ctiU\src\Graphics\GameRenderer.cpp(102): GameRenderer::prepare
C:\Users\build\AppData\Local\Temp\factorio-build-w4ctiU\src\GameView.cpp(1533): GameView::prepareRender
C:\Users\build\AppData\Local\Temp\factorio-build-w4ctiU\src\Game.cpp(331): Game::prepareRender
C:\Users\build\AppData\Local\Temp\factorio-build-w4ctiU\src\MainLoop.cpp(1144): MainLoop::prepare
C:\Users\build\AppData\Local\Temp\factorio-build-w4ctiU\src\MainLoop.cpp(710): MainLoop::mainLoopStep
C:\Users\build\AppData\Local\Temp\factorio-build-w4ctiU\src\MainLoop.cpp(414): MainLoop::run
C:\Users\build\AppData\Local\Temp\factorio-build-w4ctiU\src\Main.cpp(1357): fmain
C:\Users\build\AppData\Local\Temp\factorio-build-w4ctiU\src\Main.cpp(1379): wmain
D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(288): __scrt_common_main_seh
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFBD738E8D7)
00007FFBD738E8D7 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFBD88DBF2C)
00007FFBD88DBF2C (ntdll): (filename not available): RtlUserThreadStart
Stack trace logging done
  72.228 Error CrashHandler.cpp:190: Map tick at moment of crash: 7925
  72.285 Info CrashHandler.cpp:318: Executable CRC: 3358767809
  72.285 Error Util.cpp:95: Unexpected error occurred. If you're running the latest version of the game you can help us solve the problem by posting the contents of the log file on the Factorio forums.
Please also include the save file(s), any mods you may be using, and any steps you know of to reproduce the crash.
What did you expect to happen instead? It might be obvious to you, but do it anyway!
Game would show Mod Error instead of Crashing.

Does it happen always, once, or sometimes?
- Scenario crashes immediately when Played as a New Game or when loading Autosave
- Scenario crashes when switching to a Platform
- Does not crash in Scenario Editor if you stay on Nauvis, even while "Ticking"

The stack log from the crash seems to indicate that it is in the DrawEngine/GameRenderer; disabling the mod FPS Friendly Thrusters stops the Crash from occurring.

Re: [2.0.38] Scenario Editor

Posted: Tue Mar 04, 2025 5:56 pm
by eugenekay

Re: [2.0.38] Scenario Editor Crash - Graphical Mod

Posted: Tue Mar 04, 2025 6:02 pm
by boskid
Ok i can reproduce the crash, but that requires having `FPS_Friendly_Thrusters` mod installed. Scenario itself it not relevant, its just having a thruster visible on screen.

Re: [2.0.38] Scenario Editor Crash - Graphical Mod

Posted: Tue Mar 04, 2025 6:07 pm
by eugenekay
boskid wrote: Tue Mar 04, 2025 6:02 pm Ok i can reproduce the crash, but that requires having `FPS_Friendly_Thrusters` mod installed. Scenario itself it not relevant, its just having a thruster visible on screen.
The point of the scenario is that the crash does not occur if you stay on Nauvis while the game is running.
When loading a savegame with a Thruster it crashes instantly.

This behavior difference suggests to me that the Thruster graphic is being rendered when loading the game normally even though there are no Thrusters on-screen anywhere - ie, this is a possible Performance Optimization.

Re: [2.0.38] Crash with FPS Friendly Thrusters mod (DrawEngine::prepareThrusterJetFlames)

Posted: Tue Mar 04, 2025 10:33 pm
by Rseding91
You are correct, by not defining the plume effect and the subsequent bounding box in it, it will always be rendered. When they are defined the bounding box will stop it from rendering when that area is not on screen.

Essentially, remove the mod and it will fix the crash and still have identical performance.

Also, the crash is fixed for the next release.