ValveSoftware / source-sdk-2013

The 2013 edition of the Source SDK
https://developer.valvesoftware.com/wiki/SDK2013_GettingStarted
Other
3.7k stars 1.99k forks source link

[Linux | Dedicated Server] Source SDK Base 2013 crashing at start-up #429

Closed JoelTroch closed 6 years ago

JoelTroch commented 6 years ago

Hello,

On a fresh Ubuntu 16.04.2 Xenial Xaurus 32 bits installation with all updates installed, I installed SteamCMD through apt (sudo apt install steamcmd). I started it, logged in on my account and downloaded the "Source SDK Base 2013 Dedicated Server" (AppID = 244310).

First problem, it wasn't finding the steamclient.so file in ~/.steam/sdk32. So I copied/pasted the ~/.steam/steamcmd/linux32.

Second problem, whenever I start a dedicated server with this command ./srcds_run -game hl2mp -dedicated -debug -secure -steam +map dm_lockdown, it's crashing after loading the hashes of VPK files, I managed to grab a stacktrace with GDB and here it is:

UPDATE: I tried every branch (public, previous and previous_upcoming) the problem is still there.

jonnyboy0719 commented 6 years ago

I get the exact the same crash on Ubuntu 16.04.02 LTS Server 64-bit. But I didn't have to copy the steamclient.so file tho.

Edit: Here's an image from gdb vmware_2017-07-23_12-46-44

SamVanheer commented 6 years ago

I opened up the library in IDA and looked at CModAppSystemGroup::Create. I can see only 2 possible reasons why this is happening: either the server isn't exporting CreateInterface, resulting in a function pointer being null when called, or the interface exported as "VServerDllSharedAppSystems001" has a vtable containing null pointers, or has a null vtable pointer.

If it's CreateInterface then this message should appear in console logs: "Could not find factory interface in library server_srv.so".

The latter case would imply that the implementation isn't fully instantiated when retrieved. This is a global variable exposed using EXPOSE_SINGLE_INTERFACE, so unless the server is loaded without fully initializing its globals this shouldn't be an issue. I checked the filesystem code for that and it seems that RTLD_NOW is the flag being passed, so it should have fully initialized all globals by the time this call is made.

Logically CreateInterface is responsible, so make sure to check console output for the message. If it isn't showing anywhere even with developer 2, then it may be useful to provide a core dump.

JoelTroch commented 6 years ago

@SamVanheer It's not CreateInterface since I don't have the Could not find factory interface in library server_srv.so message in the console and debug.log.

JoelTroch commented 6 years ago

Closing this since a fix has been found by a Steam user months ago (I completely forgot to update this GitHub issue).

You need to make sure that the 32 bits version of the libssl1.0.0 package (for Debian/Ubuntu based distributions) is installed, this is a simple: apt-get install libssl1.0.0:i386.

If for some reason it still crashes, you will need the 32 bits version of GCC. Debian users will need the "testing" version that can be obtained by editing the sources list or make a custom one like this:

# Add this line ONLY if you are on Debian 9
deb http://http.us.debian.org/debian/ jessie main

# Add this line ONLY if you are on Debian 8
deb http://http.us.debian.org/debian testing main contrib non-free

Then run this: apt-get update && apt-get install -t testing gcc:i386. Ubuntu 16.04.3 users that still have the problem can just install gcc:i386.