Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source Dedicated Server (TF2) fails to dlopen engine_srv.so due to libc.so.6 #939

Open
purplebar0 opened this issue Feb 23, 2024 · 3 comments

Comments

@purplebar0
Copy link

purplebar0 commented Feb 23, 2024

Raspberry Pi 5 running Raspberry Pi OS headlessly, using kernel=kernel8.img in /boot/firmware/config.txt. Box86 has been built manually according to documentation.

Box86 version: Box86 with Dynarec v0.3.5 14b978a5 built on Feb 23 2024 19:42:50

With BOX86_LOG=2, it is revealed that engine_srv.so tries to dlopen libc.so.6 in /lib/arm-linux-gnueabihf.

Full log

Error initializing needed lib engine_srv.so
Warning: Cannot dlopen("engine_srv.so"/0xf72db8cc, 2)
Will remove after failed init engine_srv.so
Free1Library engine_srv.so
Free1Library libsteamnetworkingsockets.so
 return 0x00000000
4303|0x60a98a69: Calling my_dlerror (./srcds_linux) (F72DB8CC, 00000002, 00000400...) => return 0x63260DA0
4303|0x60a98a7f: Calling strstr (/lib/arm-linux-gnueabihf/libc.so.6)("Cannot dlopen("engine_srv.so"/0xf72db8cc, 2)
", "No such file") => return 0x00000000
4303|0x60a98a93: Calling strstr (/lib/arm-linux-gnueabihf/libc.so.6)("Cannot dlopen("engine_srv.so"/0xf72db8cc, 2)
", "image not found") => return 0x00000000
4303|0x600101f7: Calling my___vsnprintf_chk (./srcds_linux) (F72DA4D0, 0000139B, 00000001...) => return 0x00000054
4303|0x60010238: Calling __pthread_setspecific (/lib/arm-linux-gnueabihf/libc.so.6) (00000003, F72DA4C0, 00000001...) => return 0x00000000
4303|0x60aa46e8: Calling my___vsnprintf_chk (./srcds_linux) (F72DA02C, 00000400, 00000001...) => return 0x00000054
4303|0x60a933d7: Calling strlen (/lib/arm-linux-gnueabihf/libc.so.6)(0xf72da02c(" failed to dlopen engine_srv.so error=Cannot dlopen("engine_srv.so"/0xf72db8cc, 2)

")) => return 0x00000054
 failed to dlopen engine_srv.so error=Cannot dlopen("engine_srv.so"/0xf733b8cc, 2)

AppFramework : Unable to load module engine_srv.so!
Unable to load interface VCvarQuery001 from engine_srv.so

I noticed that in the case of Steam, the commonly used workaround is to force Steam Runtime or force SteamOS mode, but SteamCMD is all I got.

Assuming that's what's going on, is it possible to somehow force x86 libc?

I already tried to add this to my box86rc to no avail:

[srcds_linux]
BOX86_EMULATED_LIBS=libc.so.6

Trying to force LD_LIBRARY_PATH to path containing i386 build of libc.so.6 didn't help either.

@purplebar0
Copy link
Author

purplebar0 commented Feb 24, 2024

I got a bit further by installing App ID 1628350 (Steam Linux Runtime Sniper) and running the server with:

./run ./srcds_run <args>

Still forcing stdc.so.6 to be emulated:

[srcds_linux]
BOX86_EMULATED_LIBS=libc.so.6

At least this time it can detect a crash and restart itself.

Full log

I should note that I haven't set up a chroot just yet.

@MerGr
Copy link

MerGr commented Apr 7, 2024

Exact same issue trying to run TF2 srcds on an Ampere A1 OCI instance, srcds is running on FEX-Emu (using Steam Runtime Sniper to run srcds_run) atm but perf overhead is too great, any progress on this issue ?

@ptitSeb
Copy link
Owner

ptitSeb commented Apr 8, 2024

Not yet. I have to backport the latest elfloader changes from box64 to box86, that should help this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants