[2.1.20] Debugger jumps forward when changing breakpoints

Post your bugs and problems so we can fix them.
User avatar
hgschmie
Fast Inserter
Fast Inserter
Posts: 244
Joined: Tue Feb 06, 2024 5:18 am
Contact:

[2.1.20] Debugger jumps forward when changing breakpoints

Post by hgschmie »

When debugging code, sometimes execution jumps forward while adding or removing breakpoints. The behavior is not deterministic, I seen it most with breakpoints in early runtime stage (on_init, on_load, on_configuration_changed).

attached is a video, game log and dap log from a session where this happened.

How to reproduce:

- clone the https://github.com/hgschmie/factorio-el ... ocomotives mod into the mods folder. Check out tag 2.1.1 (not sure that this is relevant but that I what I used to provoke the problem)
- select only the base game, electric-locomotives and EditorExtensions (https://mods.factorio.com/mod/EditorExtensions). This may bring in a library dependency.
- reload the game. This is important so that when loading the map, all mods are already present.
- put breakpoints on line 119 and 140 of control.lua in electric-locomotives
- start the game under the debugger and open the attached map. It will ask for "sync and load" or "load". Do NOT DO "sync and load". Just "load". This ensures that the on_configuration_changed handler is executed
- This should hit the first breakpoint on line 119.

The problem is that this is not wholly deterministic. Sometimes, it is enough now to toggle the breakpoint on line 140 to see the jumping. Sometimes, it requires a single "step over" (F8) or two and the toggling the breakpoint. But I can pretty reliably provoke the behavior in the video by doing so.
Attachments
debugger jump test.zip
(1.04 MiB) Downloaded 6 times
dap-trace.log
(446.23 KiB) Downloaded 5 times
factorio-current.log
(7.68 KiB) Downloaded 7 times
debugger-jumping.mp4
(5.76 MiB) Downloaded 10 times
User avatar
hgschmie
Fast Inserter
Fast Inserter
Posts: 244
Joined: Tue Feb 06, 2024 5:18 am
Contact:

Re: [2.1.20] Debugger jumps forward when changing breakpoints

Post by hgschmie »

FWIW, this is not specific to vscode. I can get the same behavior in IntelliJ as well. This is a video from an intellij session where I actually crashed the game (no dap log captured here, need to figure out how the intellij dap adapter does that).

As this is not from vscode, I don't expect this to be easily reproducible, I have a few more "crashes under debugger" logs but no dap-trace files for those.
Attachments
factorio-current.log
(18.61 KiB) Downloaded 4 times
intellij-crash-video.mp4
(6.91 MiB) Downloaded 13 times
Post Reply

Return to “Bug Reports”