protonscr

SteamCMD segmentation fault on exit

steamclosed reviewedSteamCMD
ValveSoftware/steam-for-linux#3769 · opened 2015-03-25 by carstenandrich · updated 2019-07-18 · 4 comments · github
Ccarstenandrich 2015-03-25 github

The current Linux SteamCMD executable always segfaults when quitting.

Steps to reproduce:

  1. get a clean SteamCMD installation (from tarball)
  2. run it so it can update itself
  3. stumble upon the following output:
    Loading Steam API...Process $PID failed to shm_open /steam-ValveIPCSharedObjects5
  4. type quit when the Steam> prompt appears
  5. get a segmentation fault

This happens on an up-to-date Debian Jessie.

Output with gdb attached:

GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i586-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /tmp/linux32/steamcmd...(no debugging symbols found)...done.
(gdb) run
Starting program: /tmp/linux32/steamcmd 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Redirecting stderr to '/home/steam/Steam/logs/stderr.txt'
Looks like steam didn't shutdown cleanly, scheduling immediate update check
[New Thread 0xf7766b40 (LWP 8496)]
[  0%] Checking for available updates...
[New Thread 0xf74ffb40 (LWP 8497)]
[----] Verifying installation...
[Thread 0xf7766b40 (LWP 8496) exited]
Steam Console Client (c) Valve Corporation
-- type 'quit' to exit --
[New Thread 0xf5caeb40 (LWP 8499)]
[New Thread 0xf5baeb40 (LWP 8500)]
[New Thread 0xf58ffb40 (LWP 8501)]
[New Thread 0xf57ffb40 (LWP 8502)]
[New Thread 0xf55ffb40 (LWP 8503)]
[Thread 0xf58ffb40 (LWP 8501) exited]
[Thread 0xf57ffb40 (LWP 8502) exited]
Loading Steam API...Process 8492 failed to shm_open /steam-ValveIPCSharedObjects5
OK.
[Thread 0xf5baeb40 (LWP 8500) exited]
[New Thread 0xf57ffb40 (LWP 8504)]

Steam>quit

Steam>[Thread 0xf57ffb40 (LWP 8504) exited]

Program received signal SIGSEGV, Segmentation fault.
0xf6297e11 in ?? () from /tmp/linux32/steamclient.so
(gdb) bt
#0  0xf6297e11 in ?? () from /tmp/linux32/steamclient.so
#1  0xf6407a43 in ?? () from /tmp/linux32/steamclient.so
#2  0xf6402522 in ?? () from /tmp/linux32/steamclient.so
#3  0xf6405010 in ?? () from /tmp/linux32/steamclient.so
#4  0xf64051d8 in ?? () from /tmp/linux32/steamclient.so
#5  0xf73a44c8 in ?? () from /tmp/linux32/steamconsole.so
#6  0xf73b6b7d in SteamDllMainEx () from /tmp/linux32/steamconsole.so
#7  0x5659c9b9 in RunSteam(int, char**, bool) ()
#8  0x5658ae7d in ?? ()
#9  0xf7d3a723 in __libc_start_main (main=0x5658a0a0, argc=1, argv=0xffffd784, init=0x5681dbe4 <__libc_csu_init>, fini=0x5681dc43 <__libc_csu_fini>, rtld_fini=0xf7febc90 <_dl_fini>, stack_end=0xffffd77c) at libc-start.c:287
[#10](/issue/ValveSoftware/steam-for-linux/10) 0x5658d639 in _start ()
(gdb) x/i $pc
=> 0xf6297e11:  mov    (%eax),%edx
(gdb) info registers
eax            0x10 16
ecx            0x0  0
edx            0xf71811c8   -149417528
ebx            0xf71b8dd0   -149189168
esp            0xffff8b00   0xffff8b00
ebp            0x56932ed0   0x56932ed0
esi            0x569bfe90   1453063824
edi            0x569bfe90   1453063824
eip            0xf6297e11   0xf6297e11
eflags         0x10202  [ IF RF ]
cs             0x23 35
ss             0x2b 43
ds             0x2b 43
es             0x2b 43
fs             0x0  0
gs             0x63 99
Aalfred-valve maintainer 2015-03-26 github

That "Process $PID failed to shm_open" is certainly a problem, you have shm support enabled (/run/shm mounted I think) right?

Ccarstenandrich 2015-03-27 github

You got me there. I'm actually running SteamCMD within a Jessie i386 chroot and I only bind-mounted /dev, /sys and /proc, which worked well for quite some time (several months, it started segfaulting a few weeks ago). I changed this to a (recursive) rbind-mount (which includes /dev/shm) and it works now.
Despite my providing an apparently shm-less environment, SteamCMD shouldn't segfault.

Kkisak-valve maintainer 2018-07-13 github

Hello @carstenandrich, are you still experiencing this issue on an up to date system?

Kkisak-valve maintainer 2018-08-17 github

Closing pending feedback.

Nothing extracted yet.