Page 1 of 1

[Genhis] [2.0.9] Crash when debugging lua code using FMTK during an exception.

Posted: Wed Oct 23, 2024 5:16 pm
by Radjack
This occured when I have launched Factorio in Instrument Mode with FMTK through Visual Stuido Code to debug an exception in the Jetpack mod.

The setup is this: Have a character using a Jetpack on Vulcanus, then open Remote View to look at Nauvis. Press the J key to cause the Jetpack mod to switch back to the landed character state. When the mod attempts to swap the controller to the landed character model it encounters a Lua exception stating that the game expected an entity on the Nauvis surface rather than the Vulcanus surface and FMTK catches the excpetion to allow me to work out what I need to change in the mod.

The crash occurs when I attempt to explore the properties of the LuaEntity that I am setting to the character argument of the set_controller call.

I have attached a save file ready to cause the crash, to reproduce, start Factorio using FMTK in VSCode hooked to the Jetpack mod, load the attached save, open the Remote View, look at Nauvis and then press J. The Lua exception will fire, then in VSCode attempt to look at the properties of the "new" variable (the LuaEntity we're passing to the character argument of set_controller), this will cause Factorio to crash. The generated log file and dump file from this crash are also attached.

Re: [Genhis] [2.0.9] Crash when debugging lua code using FMTK during an exception.

Posted: Thu Oct 24, 2024 3:21 pm
by Genhis
Thanks for the report, it's fixed for the next release. This should hopefully be the last bug from this series (116484 and 116516), I checked the rest of LuaControl functions for similar issues.