ptitSeb / box86

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

Garry's Mod Dedicated Server: Can't launch with Steam Workshop collection #657

Open 000yesnt opened 2 years ago

000yesnt commented 2 years ago

Not sure if this is a Box86 issue - tested with latest commit as of writing ( f5658a607955e0ee66018bc2f5b0b51fa8910c4b ). it can't launch using the +host_workshop_collection startup parameter, stopping at an assertion error. Running without host_workshop_collection works fine. Running in an Oracle Cloud VPS (CPU: Neoverse N1), in a Debian 11 armhf chroot, using RPI4ARM64 binary.

root@node-a1f-leo:~/gmodds# box86 srcds_linux -ip 0.0.0.0 +host_workshop_collection 2532842110
Debug level is 1
Dynarec is on
Dynarec for ARMv8, with extension: HALF FAST_MULT EDSP NEON VFPv4 IDIVA PageSize:4096
Box86 with Dynarec v0.2.7 f5658a6 built on Jul 15 2022 16:57:44
BOX86_LD_LIBRARY_PATH: ./linux32/:./linux64/:./bin/:./garrysmod/bin/:~/linux32/:~/linux64/
Using default BOX86_PATH: ./:bin/
Counted 20 Env var
Looking for srcds_linux
argv[1]="-ip"
argv[2]="0.0.0.0"
argv[3]="+host_workshop_collection"
argv[4]="2532842110"
BOX86: tcmalloc_minimal.so.4 used, reloading box86 with the lib preladed
ERROR: ld.so: object 'libtcmalloc_minimal.so.4' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Debug level is 1
Dynarec is on
Dynarec for ARMv8, with extension: HALF FAST_MULT EDSP NEON VFPv4 IDIVA PageSize:4096
Box86 with Dynarec v0.2.7 f5658a6 built on Jul 15 2022 16:57:44
BOX86_LD_LIBRARY_PATH: ./linux32/:./linux64/:./bin/:./garrysmod/bin/:~/linux32/:~/linux64/
Using default BOX86_PATH: ./:bin/
Counted 21 Env var
BOX86 try to Preload libtcmalloc_minimal.so.4
Looking for srcds_linux
argv[1]="-ip"
argv[2]="0.0.0.0"
argv[3]="+host_workshop_collection"
argv[4]="2532842110"
BOX86: Using tcmalloc_minimal.so.4, and it's in the LD_PRELOAD command
Rename process to "srcds_linux"
Using native(wrapped) libtcmalloc_minimal.so.4
Using native(wrapped) libdl.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux.so.2
Using native(wrapped) librt.so.1
Using emulated ./bin/libtier0_srv.so
Using emulated /lib/i386-linux-gnu/libstdc++.so.6
Using native(wrapped) libm.so.6
Using emulated /lib/i386-linux-gnu/libgcc_s.so.1
Warning: Weak Symbol _ZGTtnaj not found, cannot apply R_386_JMP_SLOT 0xf736319c (0x6b506)
Warning: Weak Symbol _ZGTtdlPv not found, cannot apply R_386_JMP_SLOT 0xf7363478 (0x6c076)
Warning, resizing of TLS occured! size: 0->8192 / n_elfs: 1->1
Using emulated ./bin/libvstdlib_srv.so
Using emulated ./bin/dedicated_srv.so
Using emulated ./bin/libsteam_api.so
Error initializing native libtinfo.so.5 (last dlerror is libtinfo.so.5: cannot open shared object file: No such file or directory)
Error loading needed lib libtinfo.so.5
Warning: Cannot dlopen("libtinfo.so.5"/0xf5e5e3a5, 2)
Error initializing native libncurses.so.5 (last dlerror is libncurses.so.5: cannot open shared object file: No such file or directory)
Error loading needed lib libncurses.so.5
Warning: Cannot dlopen("libncurses.so.5"/0xf5e5e3b3, 2)

WARNING: Failed to load 32-bit libtinfo.so.5 or libncurses.so.5.
  Please install (lib32tinfo5 / ncurses-libs.i686 / equivalent) to enable readline.

Using emulated /root/gmodds/bin/engine_srv.so
Using emulated /root/gmodds/bin/soundemittersystem_srv.so
Using emulated /root/gmodds/bin/materialsystem_srv.so
Using emulated /root/gmodds/bin/studiorender_srv.so
Using emulated /root/gmodds/bin/vphysics_srv.so
Using emulated /root/gmodds/bin/datacache_srv.so
Using emulated /root/gmodds/bin/shaderapiempty_srv.so
 failed to dlopen /root/gmodds/bin/stdshader_dbg_srv.so error=Cannot dlopen("/root/gmodds/bin/stdshader_dbg_srv.so"/0xf6cd63cc, 2)

 failed to dlopen /root/gmodds/bin/stdshader_dbg_srv.so error=Cannot dlopen("/root/gmodds/bin/stdshader_dbg_srv.so"/0xf6cd63cc, 2)

Error loading needed lib stdshader_dbg_srv.so
Warning: Cannot dlopen("stdshader_dbg_srv.so"/0xf6cd63cc, 2)
 failed to dlopen stdshader_dbg_srv.so error=Cannot dlopen("stdshader_dbg_srv.so"/0xf6cd63cc, 2)

 failed to dlopen /root/gmodds/bin/stdshader_dx6_srv.so error=Cannot dlopen("/root/gmodds/bin/stdshader_dx6_srv.so"/0xf6cd63cc, 2)

 failed to dlopen /root/gmodds/bin/stdshader_dx6_srv.so error=Cannot dlopen("/root/gmodds/bin/stdshader_dx6_srv.so"/0xf6cd63cc, 2)

Error loading needed lib stdshader_dx6_srv.so
Warning: Cannot dlopen("stdshader_dx6_srv.so"/0xf6cd63cc, 2)
 failed to dlopen stdshader_dx6_srv.so error=Cannot dlopen("stdshader_dx6_srv.so"/0xf6cd63cc, 2)

 failed to dlopen /root/gmodds/bin/stdshader_dx7_srv.so error=Cannot dlopen("/root/gmodds/bin/stdshader_dx7_srv.so"/0xf6cd63cc, 2)

 failed to dlopen /root/gmodds/bin/stdshader_dx7_srv.so error=Cannot dlopen("/root/gmodds/bin/stdshader_dx7_srv.so"/0xf6cd63cc, 2)

Error loading needed lib stdshader_dx7_srv.so
Warning: Cannot dlopen("stdshader_dx7_srv.so"/0xf6cd63cc, 2)
 failed to dlopen stdshader_dx7_srv.so error=Cannot dlopen("stdshader_dx7_srv.so"/0xf6cd63cc, 2)

 failed to dlopen /root/gmodds/bin/stdshader_dx8_srv.so error=Cannot dlopen("/root/gmodds/bin/stdshader_dx8_srv.so"/0xf6cd63cc, 2)

 failed to dlopen /root/gmodds/bin/stdshader_dx8_srv.so error=Cannot dlopen("/root/gmodds/bin/stdshader_dx8_srv.so"/0xf6cd63cc, 2)

Error loading needed lib stdshader_dx8_srv.so
Warning: Cannot dlopen("stdshader_dx8_srv.so"/0xf6cd63cc, 2)
 failed to dlopen stdshader_dx8_srv.so error=Cannot dlopen("stdshader_dx8_srv.so"/0xf6cd63cc, 2)

 failed to dlopen /root/gmodds/bin/stdshader_dx9_srv.so error=Cannot dlopen("/root/gmodds/bin/stdshader_dx9_srv.so"/0xf6cd63cc, 2)

 failed to dlopen /root/gmodds/bin/stdshader_dx9_srv.so error=Cannot dlopen("/root/gmodds/bin/stdshader_dx9_srv.so"/0xf6cd63cc, 2)

Error loading needed lib stdshader_dx9_srv.so
Warning: Cannot dlopen("stdshader_dx9_srv.so"/0xf6cd63cc, 2)
 failed to dlopen stdshader_dx9_srv.so error=Cannot dlopen("stdshader_dx9_srv.so"/0xf6cd63cc, 2)

 failed to dlopen /root/gmodds/garrysmod/bin/game_shader_dx6_srv.so error=Cannot dlopen("/root/gmodds/garrysmod/bin/game_shader_dx6_srv.so"/0xf6cd61ec, 2)

 failed to dlopen /root/gmodds/bin/game_shader_dx6_srv.so error=Cannot dlopen("/root/gmodds/bin/game_shader_dx6_srv.so"/0xf6cd61ec, 2)

Error loading needed lib game_shader_dx6_srv.so
Warning: Cannot dlopen("game_shader_dx6_srv.so"/0xf6cd61ec, 2)
 failed to dlopen game_shader_dx6_srv.so error=Cannot dlopen("game_shader_dx6_srv.so"/0xf6cd61ec, 2)

 failed to dlopen /root/gmodds/garrysmod/bin/game_shader_dx7_srv.so error=Cannot dlopen("/root/gmodds/garrysmod/bin/game_shader_dx7_srv.so"/0xf6cd61ec, 2)

 failed to dlopen /root/gmodds/bin/game_shader_dx7_srv.so error=Cannot dlopen("/root/gmodds/bin/game_shader_dx7_srv.so"/0xf6cd61ec, 2)

Error loading needed lib game_shader_dx7_srv.so
Warning: Cannot dlopen("game_shader_dx7_srv.so"/0xf6cd61ec, 2)
 failed to dlopen game_shader_dx7_srv.so error=Cannot dlopen("game_shader_dx7_srv.so"/0xf6cd61ec, 2)

 failed to dlopen /root/gmodds/garrysmod/bin/game_shader_dx8_srv.so error=Cannot dlopen("/root/gmodds/garrysmod/bin/game_shader_dx8_srv.so"/0xf6cd61ec, 2)

 failed to dlopen /root/gmodds/bin/game_shader_dx8_srv.so error=Cannot dlopen("/root/gmodds/bin/game_shader_dx8_srv.so"/0xf6cd61ec, 2)

Error loading needed lib game_shader_dx8_srv.so
Warning: Cannot dlopen("game_shader_dx8_srv.so"/0xf6cd61ec, 2)
 failed to dlopen game_shader_dx8_srv.so error=Cannot dlopen("game_shader_dx8_srv.so"/0xf6cd61ec, 2)

 failed to dlopen /root/gmodds/garrysmod/bin/game_shader_dx9_srv.so error=Cannot dlopen("/root/gmodds/garrysmod/bin/game_shader_dx9_srv.so"/0xf6cd61ec, 2)

 failed to dlopen /root/gmodds/bin/game_shader_dx9_srv.so error=Cannot dlopen("/root/gmodds/bin/game_shader_dx9_srv.so"/0xf6cd61ec, 2)

Error loading needed lib game_shader_dx9_srv.so
Warning: Cannot dlopen("game_shader_dx9_srv.so"/0xf6cd61ec, 2)
 failed to dlopen game_shader_dx9_srv.so error=Cannot dlopen("game_shader_dx9_srv.so"/0xf6cd61ec, 2)

 failed to dlopen /root/gmodds/garrysmod/bin/game_shader_generic_garrysmod_srv.so error=Cannot dlopen("/root/gmodds/garrysmod/bin/game_shader_generic_garrysmod_srv.so"/0xf6cd61ec, 2)

 failed to dlopen /root/gmodds/bin/game_shader_generic_garrysmod_srv.so error=Cannot dlopen("/root/gmodds/bin/game_shader_generic_garrysmod_srv.so"/0xf6cd61ec, 2)

Error loading needed lib game_shader_generic_garrysmod_srv.so
Warning: Cannot dlopen("game_shader_generic_garrysmod_srv.so"/0xf6cd61ec, 2)
 failed to dlopen game_shader_generic_garrysmod_srv.so error=Cannot dlopen("game_shader_generic_garrysmod_srv.so"/0xf6cd61ec, 2)

Using emulated /root/gmodds/garrysmod/bin/server_srv.so
Couldn't load shader dll: game_shader_generic_garrysmod_srv.soConVarRef mat_dxlevel doesn't point to an existing ConVar
Game_srv.so loaded for "Garry's Mod"
Using emulated /root/gmodds/bin/scenefilecache_srv.so
Setting breakpad minidump AppID = 4000
Initializing Steam libraries for Workshop..
Using emulated steamclient.so
[S_API] SteamAPI_Init(): Loaded local 'steamclient.so' OK.
Using emulated ./bin/crashhandler.so
CAppInfoCacheReadFromDiskThread took 25 milliseconds to initialize
Could not find steamerrorreporter binary. Any minidumps will be uploaded in-processError loading needed lib steamservice.so
Warning: Cannot dlopen("steamservice.so"/0xd47f5118, 2)
Using emulated /root/.steam/sdk32/libsteam.so
Using emulated /root/gmodds/garrysmod/bin/lua_shared_srv.so
[S_API FAIL] Tried to access Steam interface SteamUser021 before SteamAPI_Init succeeded.
WS: Waiting for Steam to log us in......
WS: Fetching collection info...
Processing collection 2532842110...
src/tier1/fileio.cpp (5164) : m_vecRegisteredWriters.Count() == 0
src/tier1/fileio.cpp (5164) : m_vecRegisteredWriters.Count() == 0
ptitSeb commented 2 years ago

I'm not sure I see any error in this log. I see libtinfo.so.5 and libncurses.so.5 missing, but I assume they are not mendatory as the loading just continue.

ptitSeb commented 2 years ago

I got the full games running with box86 now Screenshot at 2022-11-28 21-28-43

Should should try again with latest box86. Also, you may need to use BOX86_PREFER_EMULATED=1 Create the env. var. or with latest box86 you can easily try by creating ~/.box86rc with this content:

[srcds_linux]
BOX86_PREFER_EMULATED=1
000yesnt commented 2 years ago

I tried again with latest, with the env var and it still segfaults. It happens when these lines appear:

src/tier1/fileio.cpp (5164) : m_vecRegisteredWriters.Count() == 0 
src/tier1/fileio.cpp (5164) : m_vecRegisteredWriters.Count() == 0

I ran the server again, with BOX86_LOG=2, and logged it. Here it is: gmod_ds_crash_log2.zip

ptitSeb commented 2 years ago

I look at the log. The issue is because of this call:

2239395|0xd3400f41: Calling __clock_gettime (/lib/arm-linux-gnueabihf/libc.so.6)(1670351456, 0x400)

I need to analyse what is this call: is it a leggit one or is the stack wrong somehow