ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.66k stars 616 forks source link

[CS:CZ] [CZ:DS] often hang on exit #1323

Closed isi-floss closed 11 years ago

isi-floss commented 11 years ago

Problem: CS:CZ and CZ:DS often hang on exit. After clicking on exit the menu disappears, but the background image stays. Then I can only killall -9 hl_linux to force exit.

Reproduction: Start CS:CZ or CZ:DS Play a bit Exit Now it often hangs

System information:

Processor Information:
    Vendor:  AuthenticAMD
    Speed: 3200 Mhz
    4 logical processors
    4 physical processors
    HyperThreading:  Unsupported
    FCMOV:  Supported
    SSE2:  Supported
    SSE3:  Supported
    SSSE3:  Unsupported
    SSE4a:  Supported
    SSE41:  Unsupported
    SSE42:  Unsupported

Network Information:
    Network Speed:  

Operating System Version:
    "Fedora release 19 (Schrödinger’s Cat)" (64 bit)
    Kernel Name:  Linux
    Kernel Version:  3.10.9-200.fc19.x86_64
    X Server Vendor:  Fedora Project
    X Server Release:  11402000
    X Window Manager:  KWin
    Steam Runtime Version:  steam-runtime-release-i386_2013-06-28

Video Card:
    Driver:  ATI Technologies Inc. AMD Radeon HD 6800 Series  

    Driver Version:  4.3.12441 Compatibility Profile Context 13.20.11
    Desktop Color Depth: 24 bits per pixel
    Monitor Refresh Rate: 119 Hz
    VendorID:  0x1002
    DeviceID:  0x6739
    Number of Monitors:  1
    Number of Logical Video Cards:  1
    Primary Display Resolution:  1680 x 1050
    Desktop Resolution: 1680 x 1050
    Primary Display Size: 18.66" x 11.65"  (21.97" diag)
                                            47.4cm x 29.6cm  (55.8cm diag)
    Primary VRAM Not Detected

Sound card:
    Audio device: Realtek ALC888

Memory:
    RAM:  7984 Mb

Miscellaneous:
    UI Language:  English
    LANG:  en_US.UTF-8
    Microphone:  Not set
    Total Hard Disk Space Available:  933727 Mb
    Largest Free Hard Disk Block:  104675 Mb

Installed software:

Recent Failure Reports:
    Mon Aug 26 20:17:42 2013 GMT: file ''/tmp/dumps/crash_20130826221532_1.dmp'', upload yes: ''CrashID=bp-9f077f5f-b762-440c-a4c2-43aa62130826''

Versions: CS:CZ ] version Protocol version 48 Exe version 1.0.0.3/Stdio (czero) Exe build: 10:03:29 Aug 8 2013 (6132)

CZ:DS ] version Protocol version 48 Exe version 1.0.0.0/Stdio (czeror) Exe build: 10:03:29 Aug 8 2013 (6132)

alfred-valve commented 11 years ago

Can you attach gdb when you have this hang and the provide us with a backtrace of the problem please.

isi-floss commented 11 years ago

From CS:CZ

(gdb) bt
#0  0xf7766425 in __kernel_vsyscall ()
#1  0x45afc8ab in write () from /lib/libc.so.6
#2  0x45a86711 in _IO_new_file_write () from /lib/libc.so.6
#3  0x45a8703f in __GI__IO_file_xsputn () from /lib/libc.so.6
#4  0x45a5f297 in buffered_vfprintf () from /lib/libc.so.6
#5  0x45a5aa95 in vfprintf () from /lib/libc.so.6
#6  0x45a6404f in fprintf () from /lib/libc.so.6
#7  0xf5ef6515 in Sys_Printf (fmt=0xf60371b2 "%s") at ../engine/sys_dll.c:641
#8  0xf5fa2563 in Con_Printf (fmt=0xf60417f8 "MP3 startup failed due, mp3 playback will not be available.\n") at ../engine/CONSOLE.C:445
#9  0xf5fbbaf5 in CCDAudio::MP3_Init (this=0xf6714d40 <g_CDAudio>) at ../engine/cd.cpp:1341
#10 0xf5fbc1b8 in CCDAudio::MP3_InitStream (this=0xf6715424 <g_Thread+4>, trackNum=1170128786, looping=false) at ../engine/cd.cpp:1504
#11 0x00552897 in ?? ()

When the hang occurs, the console where I started steam is spammed with the following message: "MP3 startup failed due, mp3 playback will not be available."

The hang also occurs when I change resolutions.

It is an SELinux problem. When I set SELinux to permissive, there is no problem and the music in the CS:CZ main menu plays. With SELinux set to enforcing, there is no music.

SELinux is preventing /home/isi/.local/share/Steam/SteamApps/common/Half-Life/hl_linux from using the execheap access on a process.

*****  Plugin allow_execheap (53.1 confidence) suggests  *********************

If you do not think /home/isi/.local/share/Steam/SteamApps/common/Half-Life/hl_linux should need to map heap memory that is both writable and executable.
Then you need to report a bug. This is a potentially dangerous access.
Do
contact your security administrator and report this issue.

*****  Plugin catchall_boolean (42.6 confidence) suggests  *******************

If you want to allow unconfined executables to make their heap memory executable.  Doing this is a really bad idea. Probably indicates a badly coded executable, but could indicate an attack. This executable should be reported in bugzilla
Then you must tell SELinux about this by enabling the 'selinuxuser_execheap' boolean.
You can read 'unconfined_selinux' man page for more details.
Do
setsebool -P selinuxuser_execheap 1

*****  Plugin catchall (5.76 confidence) suggests  ***************************

If you believe that hl_linux should be allowed execheap access on processes labeled unconfined_t by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep hl_linux /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
                              023
Target Context                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
                              023
Target Objects                 [ process ]
Source                        hl_linux
Source Path                   /home/isi/.local/share/Steam/SteamApps/common
                              /Half-Life/hl_linux
Port                          <Unknown>
Host                          nupc
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-73.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     nupc
Platform                      Linux nupc 3.10.9-200.fc19.x86_64 #1 SMP Wed Aug
                              21 19:27:58 UTC 2013 x86_64 x86_64
Alert Count                   5
First Seen                    2013-08-29 16:25:25 CEST
Last Seen                     2013-08-29 16:37:26 CEST
Local ID                      b966060d-9d32-4aaf-9d6e-81619b31f5e9

Raw Audit Messages
type=AVC msg=audit(1377787046.869:589): avc:  denied  { execheap } for  pid=16364 comm="hl_linux" scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=process

type=SYSCALL msg=audit(1377787046.869:589): arch=i386 syscall=capget success=no exit=EACCES a0=a54c000 a1=c000 a2=7 a3=ffb22dcc items=0 ppid=16361 pid=16364 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 ses=1 tty=pts4 comm=hl_linux exe=/home/isi/.local/share/Steam/SteamApps/common/Half-Life/hl_linux subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)

Hash: hl_linux,unconfined_t,unconfined_t,process,execheap
alfred-valve commented 11 years ago

So not a bug then, due to SELinux?

isi-floss commented 11 years ago

That depends on whom you ask. Issue https://github.com/ValveSoftware/steam-for-linux/issues/43 should be the first report of this issue. IMO it is a bug.

alfred-valve commented 11 years ago

The answer is covered by that bug then.