LacledesLAN / gamesvr-tf2

Team Fortress 2 Server in Docker
https://hub.docker.com/r/lacledeslan/gamesvr-tf2/
The Unlicense
4 stars 1 forks source link

TF2 server not executing #1

Closed dudleycodes closed 7 years ago

dudleycodes commented 7 years ago

Crash dump

Auto detecting CPUntinue to launch in 1 secondss
Using default binary: ./srcds_linux
Server will auto-restart if there is a crash.
Using Breakpad minidump system. Version: 4085139 AppID: 232250
Setting breakpad minidump AppID = 232250
Using breakpad crash handler
Segmentation fault
Add "-debug" to the ./srcds_run command line to generate a debug.log to help with solving this problem
Sun Aug 13 23:35:02 UTC 2017: Server restart in 10 seconds
Using Breakpad minidump system. Version: 4085139 AppID: 232250
Setting breakpad minidump AppID = 232250
Using breakpad crash handler
Segmentation fault
Add "-debug" to the ./srcds_run command line to generate a debug.log to help with solving this problem
Sun Aug 13 23:35:16 UTC 2017: Server restart in 10 seconds
Sun Aug 13 23:35:22 UTC 2017: Server Quit

Crash dump with -debug

Auto detecting CPU
Using default binary: ./srcds_linux
Enabling debug mode
Server will auto-restart if there is a crash.
Using Breakpad minidump system. Version: 4085139 AppID: 232250
Setting breakpad minidump AppID = 232250
Using breakpad crash handler
Segmentation fault (core dumped)
BFD: Warning: /app/bin/core is truncated: expected core file size >= 77910016, found: 8884224.
Cannot access memory at address 0xf77cf908
Cannot access memory at address 0xf77cf904
Failed to read a valid object file image from memory.
Cannot access memory at address 0xf77cf908
Cannot access memory at address 0xf77cf904
debug.cmds:5: Error in sourced command file:
No function contains program counter for selected frame.
email debug.log to linux@valvesoftware.com
Sun Aug 13 23:32:57 UTC 2017: Server restart in 10 seconds
Sun Aug 13 23:33:00 UTC 2017: Server Quit
dudleycodes commented 7 years ago

After performing command ulimit -c unlimited inside the container dump:

Auto detecting CPUntinue to launch in 1 secondss
Using default binary: ./srcds_linux
Enabling debug mode
Server will auto-restart if there is a crash.
Using Breakpad minidump system. Version: 4085139 AppID: 232250
Setting breakpad minidump AppID = 232250
Using breakpad crash handler
Segmentation fault (core dumped)
debug.cmds:5: Error in sourced command file:
No function contains program counter for selected frame.
email debug.log to linux@valvesoftware.com
Mon Aug 14 00:34:29 UTC 2017: Server restart in 10 seconds
JustinBenedick commented 7 years ago

docker run -it --cpuset-cpus="3" -p=172.30.10.32:1200:1200/udp -p=172.30.10.32:1500:1500/udp -p=172.30.10.32:3005:3005/udp -p= 172.30.10.32:3101:3101/udp -p=172.30.10.32:28960:28960/udp -p=172.30.10.32:3478-3479:3478-3479/udp -p=172.30.10.32:4379-4380:4379-4380/udp -p=172 .30.10.32:26900-26915:26900-26915/udp -p=172.30.10.32:27000-27030:27000-27030/udp -p=172.30.10.32:27000-27050:27000-27050/tcp lacledeslan/gamesvr -srcds-tf2-freeplay:linux ./srcds_run -game tf -port 27015 +sv_pure 0 +maxplayers 24 -console -usercon -replay +mapcyclefile mapcycle.txt +random map +hostname "Laclede's_LAN_TF2_Freeplay" +rcon_password "an" WARNING: No map specified! Server may not heartbeat. Auto detecting CPU Using default binary: ./srcds_linux Server will auto-restart if there is a crash. Using Breakpad minidump system. Version: 4085139 AppID: 232250 Setting breakpad minidump AppID = 232250 Using breakpad crash handler ./srcds_run: line 324: 9 Segmentation fault (core dumped) $HL_CMD Add "-debug" to the ./srcds_run command line to generate a debug.log to help with solving this problem Tue Aug 15 23:02:39 UTC 2017: Server restart in 10 seconds Using Breakpad minidump system. Version: 4085139 AppID: 232250 Setting breakpad minidump AppID = 232250

dudleycodes commented 7 years ago

TL:DR;

Any Source SDK 2013 based Linux server compiled to target the steam-runtime cannot be inside of a bin directory. If you are using +force_install_dir x/y/z/bin with SteamCMD then you're doing it wrong!

Details

We had all of our dockerized servers structured as:

/
└── app/
    ├── bin/            <=--- Game Server Content
    ├── steamcmd/       <=--- SteamCMD tool
    └── toolX/          <=--- Other tooling

The goals were:

  1. Keep all game server content (aka "binaries") separate from support tooling.
  2. Keep all game server content in the same path so that it could easily be extracted to bare-metal in an emergency situation.

This worked well for for us across the board until Valve started updating Source SDK 2013 build tools to target the steam-runtime. Un-upgraded game servers continued to work inside of bin directories as did newer game servers (such as csgo).

Apparently the steam-runtime was linking to the wrong bin folder - instead of linking to /app/bin/bin/core it was linking to the non-existent /app/bin/core.

Our Solution

Now that we're using multi-stage Docker builds we can leave the tooling (SteamCMD) in a build image and dump the game server contents directly to /app. This keeps our 2 goals in place with the added bonus of simplifying image names while following our naming conventions.