Page 1 of 1

[2.1.9] Crash in helpers.recv_udp(0) with headless server

Posted: Sat Jul 04, 2026 7:46 pm
by ancorehraq
I haven't tried it with the GUI. This is from Claude messing with the dedicated server.

Trivial mod to call recv_udp:
script.on_event(defines.events.on_tick, function()
helpers.recv_udp(0)
end)
Start the server:
factorio --start-server repro.zip --enable-lua-udp 34199
Send a packet:
python3 -c "import socket; socket.socket(socket.AF_INET, socket.SOCK_DGRAM).sendto(b'hello', ('127.0.0.1', 34199))"
Boom:
(nil) (0): Logging::logAndAbortOrThrow(char const*, unsigned int, LogLevel, char const*, ...)
(nil) (0): TickClosure::add(InputAction&&)
(nil) (0): NetworkInputListener::tryToSendNextTickClosure(unsigned char)
(nil) (0): non-virtual thunk to ServerMultiplayerManager::updateMultiplayerInputInternal()
(nil) (0): MainLoop::gameUpdateStep(MultiplayerManagerBase*, Scenario*, AppManager*, MainLoop::HeavyMode)
...
17.423 Error TickClosure.cpp:91: Trying to add invalid input action to the closure.
I found a write_file crash viewtopic.php?p=697640 that sounds vaguely related?

Re: [2.1.9] Crash in helpers.recv_udp(0) with headless server

Posted: Sun Jul 05, 2026 3:08 pm
by justarandomgeek
i believe this is distinct from those linked crashes, i will be looking into this deeper shortly; i think it should be a relatively easy fix, but i have to set up some quick tests first to verify i've understood the situation!

Re: [2.1.9] Crash in helpers.recv_udp(0) with headless server

Posted: Sun Jul 05, 2026 4:03 pm
by justarandomgeek
i posted a fix for this, pending review fixed for next release :)