Page 1 of 1

[2.1.14] Crash under debugger, reproducible

Posted: Thu Aug 20, 2026 5:04 am
by hgschmie
Mods loaded: base, EditorExtensions, EvenPickierDollies, fiber-optics

Chasing a bug in a mod, here is what I did:

- put a breakpoint in an event handler that runs out of on_tick
- single stepped the handler. It jumped to the right place in control.lua, which in turn calls another function in a different source file (scripts/other.lua)
- stepped into this, source file did not change. Debugger showed the right line number but still in control.lua, not in scripts/other.lua
- weird. Put a breakpoint into scripts/other.lua at the right place, pressed continue.

Game crashed all the way down to MacOS error reporting.

100% reproducible. Retried with trace = true (dap-trace.log attached)

Re: [2.1.14] Game crash while under debugger (reproducible)

Posted: Thu Aug 20, 2026 7:20 am
by EvilPLa
Yesterday I a had similar thing happening while debugging within on_tick, but didn't pay attention how and why.

My Linux told me: vscodium window does not respond. And I did press "close" after three times "continue waiting".
It happend 3 to 4 times before I had found my bug.

After reading this post I tried to reproduce the problem, but had no luck with that.

Factorio 2.1.14, fmtk 2.1.9, vscodium 1.126

Re: [2.1.14] Crash under debugger, reproducible

Posted: Thu Aug 20, 2026 8:02 pm
by justarandomgeek
hmm, looks like i fell into a loop trying to describe some value (possibly an error object?). will have to dig a little to say more than that though...

Re: [2.1.14] Crash under debugger, reproducible

Posted: Fri Aug 21, 2026 2:31 pm
by justarandomgeek
oh wow this is extremely stupid:
  1. While trying to describe a value
  2. I try to call its __tostring for it to describe itself
  3. and when that fails, i then try to describe the value again for the error message
  4. which repeats the attemped __tostring 🤦
should be a fairly straightforward fix though! (and you can avoid it in the meantime by fixing the __tostring that throws)

Re: [2.1.14] Crash under debugger, reproducible

Posted: Tue Aug 25, 2026 12:30 am
by justarandomgeek
fixed for 2.1.17

Re: [2.1.14] Crash under debugger, reproducible

Posted: Thu Aug 27, 2026 4:00 am
by hgschmie
Did this fix make it into 2.1.17? There was no mentioning of it in the release notes.

Re: [2.1.14] Crash under debugger, reproducible

Posted: Thu Aug 27, 2026 4:46 am
by justarandomgeek
yes