ValveSoftware / csgo-osx-linux

Counter-Strike: Global Offensive
http://counter-strike.net
787 stars 69 forks source link

Segmentation fault on map change when recording demos #3831

Open igorgusarov opened 2 months ago

igorgusarov commented 2 months ago

Your system information

Linux ip-..... 6.8.0-1013-aws #14-Ubuntu SMP Thu Jul 25 21:19:24 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Please describe your issue in as much detail as possible:

The CS2 server on Linux crashes on almost every map change, but only when demo recording is enabled, and at least one player is on the server. This started after an update in early May 2024.

My server OS is Ubuntu 22.04.1 on AWS EC2, AMD EPYC 7R32, 4 GB of RAM.

I tried reinstalling Steam and CS2 from scratch - same issue. Then I tried creating a completely new server with a clean system, installed CS2 server - same issue.

Steps for reproducing this issue:

  1. Install a clean cs2 server on Ubuntu (commands below)
  2. Create server.cfg, add tv_autorecord 1 to it
  3. Start server, join it as a player (at least 1 player needs to be on the server to reproduce)
  4. Change the map
  5. The server crashes with Segmentation Fault and no other messages

I tried running it with gdb, getting a different error every time, here's an example (it's not always libvphysics2):

map de_nuke    
Changelevel to de_nuke
changelevel "de_nuke"
CHostStateMgr::QueueNewRequest( Changelevel (de_nuke), 4 )
SV:  CNetworkServerService::StartChangeLevel( (no landmark) )
Client 0 'babaika' signon state SIGNONSTATE_FULL -> SIGNONSTATE_CHANGELEVEL
HostStateRequest::Start(HSR_GAME):  loop(levelload) id(4) addons() desc(Changelevel (de_nuke))
SwitchToLoop levelload requested:  id [4] addons []
SV:  IGameSystem::LoopDeactivateAllSystems {
HO:  IGameSystem::LoopDeactivateAllSystems {
HO:  } IGameSystem::LoopDeactivateAllSystems done
SV:  } IGameSystem::LoopDeactivateAllSystems done
SourceTV[0] shutting down (non-relay) due to server disconnecting game.
CHLTVServer::Shutdown
Completed SourceTV demo "test3.dem":
Recording time 20.7,
Size 614453 (464 per tick).
Animation data size 17253 (13 per tick).
CNetworkGameServerBase::SetServerState (ss_active -> ss_dead)
SV:  Server shutting down: NETWORK_DISCONNECT_LOOPDEACTIVATE (55)
CNetworkGameServerBase::SetServerState (ss_active -> ss_dead)
Thread 1 "cs2" received signal SIGSEGV, Segmentation fault.
0x00007fffe88cc430 in ?? () from /home/ubuntu/cs2/game/bin/linuxsteamrt64/libvphysics2.so

Monitored RAM usage on map change, it doesn't come close to using all available memory. I also tried adding a 2 GB swap - same issue.

This is how I install the server on a clean system:

sudo add-apt-repository multiverse
sudo apt install software-properties-common
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install lib32gcc-s1 steamcmd

STEAM_LOGIN=...
steamcmd +force_install_dir /home/ubuntu/cs2 +login $STEAM_LOGIN +app_update 730 validate +exit

mkdir /home/ubuntu/.steam
mkdir /home/ubuntu/.steam/sdk64
mkdir /home/ubuntu/.steam/sdk32
ln -s /home/ubuntu/.local/share/Steam/steamcmd/linux64/steamclient.so /home/ubuntu/.steam/sdk64/
ln -s /home/ubuntu/.local/share/Steam/steamcmd/linux32/steamclient.so /home/ubuntu/.steam/sdk32/