ptitSeb / box86

Box86 - Linux Userspace x86 Emulator with a twist, targeted at ARM Linux devices
https://box86.org
MIT License
3.33k stars 229 forks source link

bf1942 linux i386 server crash when changing map #180

Closed arrowgent closed 2 years ago

arrowgent commented 4 years ago

edit: Raspberry Pi 4B using Raspbian Debian 10 Buster

each time i change the map it crashes box86 back to the terminal

couldn't restart server: No such file or directory

ive tried changing +restart 0 and removing any arg tried running box86 from the same folder, all kinds of things the server runs fine on my linux laptop (intel x64 with x64 debian)

two bianry files provided for the server: bf1942_lnxded.dynamic <-dynamic libraries bf1942_lnxded.static <- bundled static libraries ive tested both, im using dynamic because it loads faster and has less cpu usage

the Monitor loads and the server runs, players can connect and everything is fine change the map and it crashes.

start.sh

#!/bin/bash
cd /home/pi/Games/s_bf1942/
BOX86_PATH=./:bin/:/home/pi/.local/bin:/home/pi/Games/s_bf1942/ BOX86_LD_LIBRARY_PATH=.:lib:lib/lib:x86:lib32:/usr/i686-linux-gnu/lib:/usr/lib/arm-linux-gnueabihf:/home/pi/Games/s_bf1942/pb/:/home/pi/Games/s_bf1942/lib_i386/ BOX86_EMULATED_LIBS=libgcc_s.so.1:libstdc++.so.5 exec box86 /home/pi/Games/s_bf1942/bf1942_lnxded "+restart 1 +statusMonitor 1 +dedicated 1 +hostServer 1"

kill $1
exit 0
Dynarec for ARM, with extension: HALF FAST_MULT EDSP NEON VFPv4 IDIVA PageSize:4096
BOX86_LD_LIBRARY_PATH: ./:lib/:lib/lib/:x86/:lib32/:/usr/i686-linux-gnu/lib/:/usr/lib/arm-linux-gnueabihf/:/home/pi/Games/s_bf1942/lib/:/home/pi/Games/s_bf1942/lib_i386/
BOX86 will force the used of emulated libs for libgcc_s.so.1 libstdc++.so.5 
BOX86_PATH: ./:bin/:/home/pi/Games/s_bf1942/:/home/pi/.local/bin/
Counted 48 Env var
Looking for /home/pi/Games/s_bf1942/bf1942_lnxded
argv[1]="+restart 0 +statusMonitor 1 +dedicated 1 +hostServer 1"
Using native(wrapped) libdl.so.2
Using native(wrapped) libncurses.so.5
Using native(wrapped) libtinfo.so.5
Using emulated /home/pi/Games/s_bf1942/lib_i386/libstdc++.so.5
Using native(wrapped) libm.so.6
Using emulated /home/pi/Games/s_bf1942/lib_i386/libgcc_s.so.1
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) librt.so.1
Warning, jump to 0x0 at 0x8052b64 (0x8052b63)
Using emulated /home/pi/Games/s_bf1942/pb/pbsv.so

couldn't restart server: No such file or directory

any suggestions specific for box86?? im a loss server files if you want to test the server binary (requries some folder and files management to get started)

ptitSeb commented 4 years ago

There must be some file access or function call used to get the name of the running app that goes wrong...

Try to use BOX_LOG=2 to trace all function called. Warning, as this will generate a lot of line. You can redirect to a file with BOX86_TRACE_FILE=trace.txt (but again, the file will be big). This can help better understand what is happening with the restart.

arrowgent commented 4 years ago

if by very large you mean over 2gb..... i think it goes into loop and doesnt start the server, no ports become open/in use i could trim the first 10248 output lines if you wish

arrowgent commented 4 years ago

one interesting thing to note: on linux x64 the server never asks for ./pb/pbsv.so library (punkbuster) but in box86 it does, so i found this and put it in the folder, it doesnt complain about missing:

Using emulated /home/pi/Games/s_bf1942/pb/pbsv.so
arrowgent commented 4 years ago

https://github.com/arrowgent/box86/blob/master/trace10000.txt

i am willing to upload a 1gb file with the first 1,000,000 lines to googledrive if you like...

arrowgent commented 4 years ago

for reference: Using emulated /home/pi/Games/s_bf1942/lib_i386/libstdc++.so.5 Using emulated /home/pi/Games/s_bf1942/lib_i386/libgcc_s.so.1 are both directly from debian 10 buster stable repository for i386 the .deb is unpacked then the files put into /lib_i386

edit: Raspberry Pi 4B using Raspbian Debian 10 Buster

arrowgent commented 4 years ago

also wanted to note, whatever you've been working on is great i downloaded and compiled master about 2 hours before you posted v0.1.2 release so i went back and tested v0.1.0 release source and all instances segfault keep up the good work

arrowgent commented 4 years ago

hypothetical as you mentioned:

There must be some file access or function call used to get the name of the running app that goes wrong...

the server appears to be designed to exit then restart itself for every map change that would mean it starts a new process

this would affect any program that closes and opens another binary? im not sure how it could be imlpented to intercept this while still being in the box86 enviornment

ptitSeb commented 3 years ago

Do you still have issues with this or can this ticket be close?

ptitSeb commented 2 years ago

No news for 2 years+... closing the ticket.