alliedmodders / metamod-source

Metamod:Source - C++ Plugin Environment and Detour Library for the Source Engine
http://www.metamodsource.net/
Other
374 stars 83 forks source link

Failed to load plugin "addons/metamod/bin/server.so" #95

Closed jkroepke closed 1 year ago

jkroepke commented 2 years ago

Hi,

i'm trying to run a CS:GO Server on Ubuntu 22.04. Currently, I'm unable to load metasource. The error is create pipe failed.Failed to load plugin "addons/metamod/bin/server.so". Not sure how I could debug this.

Server is hibernating
[S_API] SteamAPI_Init(): SteamAPI_IsSteamRunning() did not locate a running instance of Steam.
[S_API] SteamAPI_Init(): Loaded '/home/steam/steamcmd/linux32/steamclient.so' OK.
[S_API FAIL] SteamAPI_Init() failed; create pipe failed.Failed to load plugin "addons/metamod/bin/server.so"
maxplayers set to 64

Using 1.11.0-git1148

jkroepke commented 2 years ago

It seems that Ubuntu 22.04 is to new for CS:GO. bin/libgcc_s.so.1 and /lib32/libstdc++.so.6 are not compatible

LD_LIBRARY_PATH=.:bin: ldd /home/steam/csgo/server/csgo/addons/metamod/bin/metamod.2.csgo.so
/home/steam/csgo/server/csgo/addons/metamod/bin/metamod.2.csgo.so: bin/libgcc_s.so.1: version `GCC_7.0.0' not found (required by /lib32/libstdc++.so.6)
        linux-gate.so.1 (0xf7ee8000)
        libvstdlib.so => bin/libvstdlib.so (0xf7e35000)
        libtier0.so => bin/libtier0.so (0xf7de6000)
        libm.so.6 => /lib32/libm.so.6 (0xf7cdb000)
        libstdc++.so.6 => /lib32/libstdc++.so.6 (0xf7aa6000)
        libgcc_s.so.1 => bin/libgcc_s.so.1 (0xf7a91000)
        libc.so.6 => /lib32/libc.so.6 (0xf7860000)
        libdl.so.2 => /lib32/libdl.so.2 (0xf785b000)
        libpthread.so.0 => /lib32/libpthread.so.0 (0xf7856000)
        /lib/ld-linux.so.2 (0xf7ee9000)
        librt.so.1 => /lib32/librt.so.1 (0xf784f000)

If I prefer libgcc_s.so.1 from host, everything looks fine.

LD_LIBRARY_PATH=/usr/lib32/:.:bin: ldd /home/steam/csgo/server/csgo/addons/metamod/bin/metamod.2.csgo.so
        linux-gate.so.1 (0xf7ede000)
        libvstdlib.so => bin/libvstdlib.so (0xf7e2b000)
        libtier0.so => bin/libtier0.so (0xf7ddc000)
        libm.so.6 => /usr/lib32/libm.so.6 (0xf7cd4000)
        libstdc++.so.6 => /usr/lib32/libstdc++.so.6 (0xf7a9f000)
        libgcc_s.so.1 => /usr/lib32/libgcc_s.so.1 (0xf7a78000)
        libc.so.6 => /usr/lib32/libc.so.6 (0xf7847000)
        libdl.so.2 => /usr/lib32/libdl.so.2 (0xf7842000)
        libpthread.so.0 => /usr/lib32/libpthread.so.0 (0xf783d000)
        /lib/ld-linux.so.2 (0xf7edf000)
        librt.so.1 => /usr/lib32/librt.so.1 (0xf7838000)

Symlinking ln -sf /usr/lib32/libgcc_s.so.1 bin/libgcc_s.so.1 is a possible workaround here.

dvander commented 2 years ago

Maybe try installing lib32gcc-7-dev? It is really odd for distros to break compatibility this way.

jkroepke commented 2 years ago

The package does not exists in Ubuntu 22.04. https://packages.ubuntu.com/search?suite=jammy&section=all&arch=any&keywords=lib32gcc-7-dev&searchon=names (lib32gcc-9-dev up to lib32gcc-12-dev) is available.

At least, linking or remove the libgcc_s.so.1 from server bin directory works and MM is loading fine.

It is really odd for distros to break compatibility this way.

I guess upgrade from Ubuntu 20.04 (lib32gcc v10) to 22.04 (lib32gcc v12) is a major update and distros are bumping all libs. It's expectable that something can break here.

CS:GO itself is running fine on 22.04. Look like only mm depends on that library?

maxpain commented 2 years ago

At least, linking or remove the libgcc_s.so.1 from server bin directory works and MM is loading fine.

@jkroepke But this workaround has one problem. This file appears again after steamcmd verification.

jkroepke commented 2 years ago

Yes, this is true. Valve needs to update or remove the library.

maxpain commented 2 years ago

I managed to work around this problem using Symbolic links:

I start this script after the steamcmd update process.

export CSGO_SERVER_STEAMCMD="/root/Steam/steamapps/common/Counter-Strike Global Offensive Beta - Dedicated Server"
export CSGO_SERVER_COPY=/root/csgo_server

cp -rsn "$CSGO_SERVER_STEAMCMD"/* $CSGO_SERVER_COPY/
rm -f "$CSGO_SERVER_COPY/bin/libgcc_s.so.1"
peace-maker commented 1 year ago

I don't think we can do anything about this since we don't explicitly link against the library in the bin folder. It's the LD_LIBRARY_PATH loading order of scrds which prefers the one shipped with the game.

Best we can do is document this on the install instructions in the wiki?

peace-maker commented 1 year ago

Turns out is is already documented since December 2022 (thanks @nosoop): https://wiki.alliedmods.net/Installing_Metamod:Source