ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.19k stars 174 forks source link

Steam crashes with various Valve titles if run from a user with 16 or more characters #5161

Closed OJezu closed 6 years ago

OJezu commented 6 years ago

Your system information

Please describe your issue in as much detail as possible:

Steam start-ups as usual, I start counter-strike, and Steam window closes (crashes with buffer overflow), 2 of 3 times Counter-Strike also crashes at this point. If not, it will crash when trying to create server (after setting game options), or when trying to view server list (on clicking Find Servers)

I've tried completely removing Steam (including ~/.steam directory) and i368 libs and reinstalling everything from scratch.

I've installed other game, FTL, and it seems to work fine, steam not crashing. Counter-Strike CZ is crashing itself and steam in same way as Counter-Strike (I didn't check logs for that though).

System was recently upgraded from Debian 8. Before that update Counter-Strike worked fine.

uname: Linux hostname 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u3 (2017-08-06) x86_64 GNU/Linux

processor: Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz

graphic adapter: Intel Corporation HD Graphics 5500

Steam console output and system information: https://gist.github.com/OJezu/feb8d6829633d60fee423f9a2119ea8a

Steps for reproducing this issue:

  1. Start Counter-Strike
  2. Steam crashes
  3. If Counter-Strike did not crash at step 2, try viewing the server list or starting a new server, and it will crash
John-Gee commented 6 years ago

@thedarkfighter413 sorry you broke your system, glibc is a big deal, downgrading it can be risky... You learned it the hard way :/ But you didn't have to reinstall, you could have fixed it from a live/other distro.

thekingofravens commented 6 years ago

I can reproduce the issue on arch linux with a lenovo ideapad flex 4-1470. A relatively cheap computer. It has an intel 4405U cpu at 2.1GHz and uses intel hd graphics 510. Sadly I can't seem to reproduce the issue in a VM. If anyone can that would be ideal.

EDIT: I should mention this is very new hardware

headlesscyborg commented 6 years ago

If it doesn't work because of glibc or driver update then it would be interesting to try to reproduce the issue on Ubuntu 12.04 - it is the first oficially supported Linux distribution from 2012 (it is even recommended for CSGO on the Steam store page) and it is so outdated that it shouldn't be affected by any current glibc/mesa etc.. bugs. I will try it.

headlesscyborg commented 6 years ago

Ok it crashes even on VERY outdated Ubuntu 12.04 (https://gist.github.com/thedarkfighter413/5ed4fefe1ce8a2efcebfebac2e8aefe6) with the same error.

*** buffer overflow detected ***: /home/thedarkfighter413/.local/share/Steam/ubuntu12_32/steam terminated
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x45)[0xf704ba85]
/lib/i386-linux-gnu/libc.so.6(+0x10585a)[0xf704a85a]
/lib/i386-linux-gnu/libc.so.6(+0x104cbf)[0xf7049cbf]
[0xed78fdfd]
[0x0]

Ubuntu 12.04 x64 libc6 version: 2.15-0ubuntu10.18

How is this possible? Everything is outdated here on 12.04 - it should not be affected by any recent bugs. It looks like something is wrong with Steam. Does anyone have any idea what is going on?

FirstTimeInForever commented 6 years ago

@thedarkfighter413 What drivers are you using? I tested all combinations of the setting above and none of them worked. Offline mode still works perfectly. screenshot_20171002_213943

mikupandi commented 6 years ago

Someone have trying with nouveau, and free drivers? AMD hardware got the same issue?.

FirstTimeInForever commented 6 years ago

@mikupandi Me.

mikupandi commented 6 years ago

@FirstTimeInForever And didn't work, I guess.

headlesscyborg commented 6 years ago

@FirstTimeInForever Open Source Gallium on Intel HD4600. I couldn't get better drivers to work because of dependecy hell. I couldn't even get my dedicated NVIDIA card to work (12.04 is really old).

Now I am on Ubuntu 14.04 with proprietary NVIDIA drivers. And guess what - the same problem (https://gist.github.com/thedarkfighter413/95f19d45af0f8a17cad218fe84d4c298)

*** buffer overflow detected ***: /home/thedarkfighter413/.steam/ubuntu12_32/steam terminated
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(+0x68fce)[0xf7383fce]
/lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x6b)[0xf7418feb]
/lib/i386-linux-gnu/libc.so.6(+0xfce7a)[0xf7417e7a]
/lib/i386-linux-gnu/libc.so.6(__strncat_chk+0x13c)[0xf741750c]
[0xf4a41dfd]
[0x0]

Ubuntu 14.04 libc6 version: 2.19-0ubuntu6.13

Summary of my testing: Arch Linux - Intel HD (mesa), NVIDIA 860M (proprietary driver) = buffer overflow crash Ubuntu 12.04 LTS - Intel HD (gallium) = buffer overflow crash Ubuntu 14.04 LTS - Intel HD (mesa), NVIDIA 860M (proprietary driver) = buffer overflow crash Ubuntu 16.04 LTS - Intel HD (mesa), NVIDIA 860M (proprietary driver) = buffer overflow crash Ubuntu 17.10 beta - Intel HD (mesa), NVIDIA 860M (proprietary driver) = buffer overflow crash Windows 7 - NVIDIA 860M (proprietary driver, Windows version of Steam and CSGO) = no problems Wine Staging - NVIDIA 860M (proprietary driver, windows version of Steam and CSGO) = no problems

I have a feeling that someone should fix Steam Linux client because AFAIK it doesn't seem to be driver/distro/glibc specific.

By the way - "Intel HD, NVIDIA..." means that I did test both GPUs separatedly - Intel only, Bumblebee, Prime (NVIDIA-only forced)

kisak-valve commented 6 years ago

For what it's worth, none of my test boxes are affected. Almost all of them are older AMD cpus. Maybe there's a cpu extension that's new between Bulldozer and Zen and common to relatively recent Intel cpus involved here. (speculation)

At a glance, maybe AVX2 is involved in this issue. It's new to AMD / ZEN and has been around since Intel / Haswell. Is anyone seeing this issue on a pre-Haswell Intel cpu?

FirstTimeInForever commented 6 years ago

I also have Windows 10 - everything is fine with nvidia drivers.

headlesscyborg commented 6 years ago

I did all my testing above on a Haswell i5 4210H but I also have a very similar laptop with an Ivy Bridge i7 3630QM and GT 630M laying around so I will put my Arch Linux SSD there and post my results here tomorrow. It could be interesting to see if it works with the same OS on an older CPU.

headlesscyborg commented 6 years ago

Arch Linux x64 i7 3630QM Ivy Bridge GTX 630M Result: buffer overflow crash Outputs and system info: https://gist.github.com/thedarkfighter413/4f97e3a3b7cf8bb5adc0b3881a912ad0

headlesscyborg commented 6 years ago

It also crashes in a virtual machine (VMware, virtualized Xubuntu 16.04) - https://gist.github.com/thedarkfighter413/864c944eea82975c913f1e180327afe4 By the way the issue is also very easy to reproduce on Optimus-based laptops. I hope it helps.

headlesscyborg commented 6 years ago

@kisak-valve

This could be more useful than regular outputs - I did the exactly same thing three times (launching Counter-Strike Source from Steam). Each time with a different debugger.

GDB debugger output: https://gist.github.com/thedarkfighter413/0fcb687fadb20e79eb6c04ba8e7da301 Valgrind debugger output: https://gist.github.com/thedarkfighter413/67c4ca53c03970c3f2aa6a343b45fe0e Strace debugger output: https://gist.github.com/thedarkfighter413/a1f9815109740f401ce180be594bd82c

Tracing commented 6 years ago

Steam crash on: i7-4710HQ Haswell GTX 860m

Distro: Antergos Linux (Arch) Issue persists on Fedora 26 and Flatpak steam

Games affected on my system: Arma 3 Cossacks 3 Day of Infamy Mount and Blade: Warband Dawn of War 2: Retribution

Games unaffected by this issue: Dawn of War 2 (Original) Dawn of War 3 Stellaris Space Pirates and Zombies 2 Hearts of Iron IV

Terminal output: Arma3 buffer overflow.txt

headlesscyborg commented 6 years ago

Crazy workaround: 1) Create a new user with only 4 characters in username 2) Keep your current user logged in 3) Switch to the new user 4) Install Steam, log in, download your games (do not use your old Steam library from the previous user) 5) It works!

I didn't have a time to add my new user to the "bumblebee" group so it runs on Intel HD on the screenshot snimek z 2017-10-06 15-56-44

EDIT: Yes it works even with Bumblebee! Maybe we all have too many characters in our usernames?

FirstTimeInForever commented 6 years ago

@thedarkfighter413 Can I ask you: how did you came up with this solution? If it is a real thing, this should be enough for the developers to find the bug and fix it. Also, thank you for keeping on researching!

headlesscyborg commented 6 years ago

@FirstTimeInForever I noticed that your system username (krzysztofchrapka) is also longer than usual nicknames like mine and also that I was using the same username during my testing above (for easy access to existing partitions without having to change permissions). Then I asked people in linux_gaming subreddit if it works on their Optimus laptops. They said yes ( https://www.reddit.com/r/linux_gaming/comments/74gp7g/optimus_users_please_test_if_your_source_games/ ). So I just tried creating a new user called "test" and it worked (I just successfully finished a competitive match in CSGO on my Arch Linux a few minutes ago) and the only difference between my user account and the new one is that the old one has 17 characters and the new one has only 4 characters. I hope it helps and we will get a fix soon.

FirstTimeInForever commented 6 years ago

@thedarkfighter413 Maybe some differences in groups?

headlesscyborg commented 6 years ago

Maybe. The only difference is the "wheel" group.


[thedarkfighter413@archlinux-dark-machine ~]$ groups thedarkfighter413
wheel bumblebee thedarkfighter413
[thedarkfighter413@archlinux-dark-machine ~]$ groups test
bumblebee test
FirstTimeInForever commented 6 years ago

Short username worked for me. image

kisak-valve commented 6 years ago

Thanks for finding a way to consistently reproduce this issue @thedarkfighter413.

Looks like usernames with 16 characters or more is needed to reproduce the issue.

Also looks like the length of the home folder is not a factor and shortening the username after having this issue does not workaround the issue.

thekingofravens commented 6 years ago

@thedarkfighter413 thanks a lot for your time with this issue. I know I appreciate it.

headlesscyborg commented 6 years ago

@deathbyfreezeray @kisak-valve You're welcome.

I can confirm the 16 characters theory. Today I deleted the "test" account and created a new one "darkfighter413", transfered all my files, settings, games, gnome extensions, firefox profile etc.. to the new one and everything works. I can play CSGO, TF2, Dota 2 and CSS with no problems.

ghost commented 6 years ago

Thank you, the shorter username has resolved the issue for me.

andersonzanichelli commented 6 years ago

What? This approach really works? My user account in 2 machines has more than 16 chars. I am going to try this one. Thank you for all the information @thedarkfighter413

h1z1 commented 6 years ago

Should really be using 'getent group' and passwd otherwise you'll run into more fun things with any kind of directory service like ldap or yp.

andersonzanichelli commented 6 years ago

Worked here! Thank you so much @thedarkfighter413

Tracing commented 6 years ago

I don't think this problem is limited to valve games. Can others confirm this?

headlesscyborg commented 6 years ago

@Tracing Yes, it also crashes with Insurgency, Day of Infamy, Saints Row The Third and someone mentioned Arma 3 above. It looks like Source, GoldSrc and eON (Virtual Programming) games are affected.

FirstTimeInForever commented 6 years ago

Also crashes with Factorio.

mikupandi commented 6 years ago

Short username is working for me too. :D Is a strange bug.

tycho commented 6 years ago

I believe this should be fixed now (as of like, 5 minutes ago). Can people try running their games under the accounts with long usernames again, please?

Tracing commented 6 years ago

Confirmed. Cossacks 3 launches and Day of Infamy plays without problems.

CuriousTommy commented 6 years ago

I can play online on Team Fortress 2 again!

Edit: I also did a quick test on Half-Life 2, Left 4 Dead 2, Portal 2, Synergy, and Sanctum 2. I am happy to report that steam did not crash when launching those games.

Plagman commented 6 years ago

Thanks for testing, all.

OJezu commented 6 years ago

Well, that was a fun bug, I guess the culprit could have been found sooner with gdb and inspection of what was at the address the fatal strncpy was trying to copy. I just looked into start scripts, and turns out it is really easy to run steam with gdb...