[2.0.23] SIGSEGV on headless server startup with x86_64 emulator
Posted: Sat Dec 07, 2024 12:00 am
by nna-hime
I've been successfully running a headless server on my Raspberry Pi 4 Model B through the box64 emulator at least until version 1.1.100, but now I'm running into issues at this step of the startup process
4.216 Info HttpSharedState.cpp:58: Downloading https://auth.factorio.com/generate-server-padlock-2?api_version=6
I hadn't been running the server for since a few versions now, I came across this issue after updating to version 2.0.0 and have been running into it with every version after that, but after rolling back to 1.1.100 and trying to run it, the same issue came up, which means there was probably some change beyond version number.
I've opened an issue on the box64 issue tracker and have been told that it can't be reproduced on a different arm64 device, which means it's probably specific to the Raspberry Pi 4 Model B.
The issue seems to be with some cryptography function in the generation of the server padlock.
I'd like to know what changes there might have been to that, which was done succesfully at the time of version 1.1.100 but not since at least version 2.0.0, so that I can tell the developer of box64 and hopefully have it fixed.
The performance was great for games with up to 6 players at the same time, even with the emulation overhead, any help overcoming this issue would be really appreciated.
If factorio could eventually support an arm64 GNU/Linux version that would be really cool too.
In the spoiler below are logs running in version 2.0.23 and 1.1.100 (the program also crashes with SIGSEGV when trying to upload the crashfiles)
Dynarec for ARM64, with extension: ASIMD CRC32 PageSize:4096 Running on Cortex-A72 with 4 Cores
Will use Hardware counter measured at 54.0 MHz emulating 3.4 GHz
Params database has 96 entries
Params database has 97 entries
Box64 with Dynarec v0.3.2 b735a866 built on Dec 6 2024 18:34:10
BOX64: Didn't detect 48bits of address space, considering it's 39bits
Counted 25 Env var
BOX64 LIB PATH: BOX64 BIN PATH: ./:bin/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/usr/local/games/:/usr/games/
Looking for bin/x64/factorio
Apply RC params for factorio
Applying BOX64_DYNAREC_BIGBLOCK=2
Applying BOX64_DYNAREC_FASTROUND=0
Applying BOX64_DYNAREC_SAFEFLAGS=0
Applying BOX64_DYNAREC_CALLRET=1
Applying BOX64_DYNAREC_ALIGNED_ATOMICS=1
Appling BOX64_DYNAREC_FORWARD=1024
argv[1]="--start-server"
argv[2]="data/saves/map.zip"
argv[3]="--server-settings"
argv[4]="server-settings.json"
argv[5]="--bind"
argv[6]="192.168.1.11:34197"
Rename process to "factorio"
Using native(wrapped) libdl.so.2
Using native(wrapped) librt.so.1
Using native(wrapped) libresolv.so.2
Using native(wrapped) libm.so.6
Using native(wrapped) libpthread.so.0
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libutil.so.1
Using native(wrapped) libbsd.so.0
Look for __res_nquery in loaded elfs
Found symbol with version GLIBC_2.17, value = 0x7f8bfdbcb0
Look for __dn_expand in loaded elfs
Found symbol with version GLIBC_2.17, value = 0x7f8bfd4760
0.010 2024-12-06 20:53:39; Factorio 2.0.23 (build 80769, linux64, headless, space-age)
0.029 Operating system: Linux (Debian 12)
0.035 Program arguments: "bin/x64/factorio" "--start-server" "data/saves/map.zip" "--server-settings" "server-settings.json" "--bind" "192.168.1.11:34197"
0.035 Config path: /home/steam/factorio/config/config.ini
0.035 Read data path: /home/steam/factorio/data
0.036 Write data path: /home/steam/factorio [11111/29391MB]
0.036 Binaries path: /home/steam/factorio/bin
0.127 System info: [CPU: Box64 on Cortex-A72 @1.80 GHz, 4 cores, RAM: 7809 MB]
0.131 Environment: DISPLAY=<unset> WAYLAND_DISPLAY=<unset> DESKTOP_SESSION=<unset> XDG_SESSION_DESKTOP=<unset> XDG_CURRENT_DESKTOP=<unset> SDL_VIDEODRIVER=<unset> __GL_FSAA_MODE=<unset> __GL_LOG_MAX_ANISO=<unset> __GL_SYNC_TO_VBLANK=<unset> __GL_SORT_FBCONFIGS=<unset> __GL_YIELD=<unset>
0.180 Running in headless mode
0.180 Audio is disabled
0.241 Info ModManager.cpp:434: FeatureFlag expansion-shaders = false
0.241 Info ModManager.cpp:434: FeatureFlag freezing = false
0.241 Info ModManager.cpp:434: FeatureFlag quality = false
0.241 Info ModManager.cpp:434: FeatureFlag rail-bridges = false
0.241 Info ModManager.cpp:434: FeatureFlag segmented-units = false
0.241 Info ModManager.cpp:434: FeatureFlag space-travel = false
0.241 Info ModManager.cpp:434: FeatureFlag spoiling = false
0.389 Loading mod core 0.0.0 (data.lua)
0.476 Loading mod base 2.0.23 (data.lua)
1.277 Loading mod base 2.0.23 (data-updates.lua)
1.536 Checksum for core: 2271797277
1.536 Checksum of base: 2653859856
3.222 Prototype list checksum: 2902124721
3.402 Info PlayerData.cpp:66: Local player-data.json available, timestamp 1730807675
3.402 Info PlayerData.cpp:73: Cloud player-data.json unavailable
3.655 Factorio initialised
3.671 Info ServerSynchronizer.cpp:20: nextHeartbeatSequenceNumber(0) initialized Synchronizer nextTickClosureTick(0).
3.672 Info ServerMultiplayerManager.cpp:806: updateTick(18446744073709551615) changing state from(Ready) to(PreparedToHostGame)
3.672 Info ServerMultiplayerManager.cpp:806: updateTick(18446744073709551615) changing state from(PreparedToHostGame) to(CreatingGame)
3.680 Loading map /home/steam/factorio/data/saves/map.zip: 1717594 bytes.
3.736 Loading level.dat: 888027 bytes.
3.752 Info Scenario.cpp:178: Map version 2.0.8-1
4.275 Blueprint storage "blueprint-storage-2.dat" was not found, trying to load previous version storage "blueprint-storage.dat"
4.341 Loading script.dat: 1224 bytes.
4.443 Checksum for script __level__/control.lua: 758477413
4.476 Info UDPSocket.cpp:32: Opening socket at (IP ADDR:({192.168.1.11:34197}))
4.479 Hosting game at IP ADDR:({192.168.1.11:34197})
4.487 Info HttpSharedState.cpp:55: Downloading https://auth.factorio.com/generate-server-padlock-2?api_version=6
936794|SIGSEGV @0x351695e4 (???(bin/x64/factorio+0x9695e4)) (x64pc=0x300502f3/"???", rsp=0x7f8ab75e78, stack=0x7f8a37b000:0x7f8ab7b000 own=(nil) fp=0x7f8ab75ec0), for accessing 0xa (code=1/prot=0), db=(nil)((nil):(nil)/(nil):(nil)/???:clean, hash:0/0) handler=0x1bba810
RSP-0x20:0x00000000697ae950 RSP-0x18:0x0000007f8ab75e90 RSP-0x10:0x00000000032fb218 RSP-0x08:0x0000007f8ab75eb0
RSP+0x00:0x00000000032fffad RSP+0x08:0x0000007f8ab75ed0 RSP+0x10:0x00000000031da4c0 RSP+0x18:0x0000000069c85cf0
RAX:0x0000000069c85e50 RCX:0x00000000031da4c0 RDX:0x0000000069c85e40 RBX:0x0000000069c85cf0
RSP:0x0000007f8ab75e78 RBP:0x0000007f8ab75ec0 RSI:0x0000000069c85e40 RDI:0x0000000069c85e50
R8:0x00000000032d0d58 R9:0x00000000ffffffff R10:0x0000000000000000 R11:0x000000000000004c
R12:0x0000000068ac4600 R13:0x0000000068ac5088 R14:0x000000006c2a8140 R15:0x0000000069150570
ES:0x002b CS:0x0033 SS:0x002b DS:0x002b FS:0x0043 GS:0x0053 x64opcode=C3 00 00 E9 0B 7C 66 00 (opcode=f8667868)
4.841 Error CrashHandler.cpp:641: Received SIGSEGV
Factorio crashed. Generating symbolized stacktrace, please wait ...
^C 7.143 Received SIGINT, shutting down
^C 7.729 Received second SIGINT, terminating immediately
The save files used to reproduce the crash were generated with factorio --create map.zip --map-gen-settings data/map-gen-settings.example.json so I don't think I need to attach them.
Re: [2.0.23] SIGSEGV on headless server startup with x86_64 emulator
Posted: Sat Dec 07, 2024 12:28 am
by nna-hime
Nevermind, this seems to be a regression in box64, I've just found an old version and everything works. Sorry for wasting the time of anyone who reads this.
Although having an arm64 GNU/Linux version would be really cool.