steam-for-linux icon indicating copy to clipboard operation
steam-for-linux copied to clipboard

Steam client crashes while in game when an achievement notification pops-up

Open Lifeismana opened this issue 1 year ago • 3 comments

Your system information

  • Steam client version : 1708479383 | Wed, Feb 21 02:10 UTC -08:00
  • Distribution (e.g. Ubuntu): Arch (Wayland)
  • Opted into Steam client beta?: Yes
  • Have you checked for system updates?: Yes
  • Steam Logs: old: steam-logs.tar.gz new: steam-logs.tar.gz
  • GPU: Nvidia (Proprietary drivers 550)

Please describe your issue in as much detail as possible:

When earning an achievement in-game, the notification for it partially shows up (like 10% of it) before it freezes and then the client crashes and reloads by itself. I can confirm it crashes only with the achievement notification. Desktop notifs show up fine and the online / new message notifs appear correctly while in-game This is not a wayland specific crash, it also happens with X11. This issue seems similar to #8693

Steps for reproducing this issue:

  1. Launch a game (I've had this issue with Helldivers 2 and Bandle Tale, i didn't try with a non proton game)
  2. Earn an achievement
  3. The notification for it partially shows up before freezing and then, subsequently, the client crashes

Lifeismana avatar Feb 21 '24 21:02 Lifeismana

looking into the logs the error is

[0221/224002.227226:ERROR:angle_platform_impl.cc(43)] Display.cpp:1021 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp, initialize:1470.
[0221/224002.227284:ERROR:gl_display.cc(508)] EGL Driver message (Critical) eglInitialize: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp, initialize:1470.
[0221/224002.227308:ERROR:gl_display.cc(932)] eglInitialize SwANGLE failed with error EGL_NOT_INITIALIZED
[0221/224002.227331:ERROR:gl_ozone_egl.cc(23)] GLDisplayEGL::Initialize failed.
[0221/224002.228235:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization

so it's clearly a problem with my GPU i'm using the following nvidia packages:

egl-wayland 
lib32-libvdpau
lib32-nvidia-utils-beta
libxnvctrl
nvidia-beta-dkms
nvidia-settings
nvidia-utils-beta

seems like i forgot to switch to nvidia-settings-beta but i doubt it will fix anything i'm also installing opencl-nvidia-beta & lib32-opencl-nvidia-beta but i also doubt it will fix anything

after googling around a bit, seems like i found the cause of that error: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10624 rolling back to mesa 23.3.5 (& lib32-mesa) doesn't log that crash with that error anymore

Instead i'm getting a new error (new logs: steam-logs.tar.gz ):

[0222/045756.152516:INFO:CONSOLE(1)] "Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'steamid')", source: https://steamloopback.host/chunk~2dcc5aaf7.js?contenthash=fc89e86c22362045d2b3 (1)
[0222/045756.154182:INFO:CONSOLE(1)] "GetPerContextChatData called before ready [object Object]", source: https://steamloopback.host/chunk~2dcc5aaf7.js?contenthash=fc89e86c22362045d2b3 (1)
[0222/045756.154534:INFO:CONSOLE(1)] "GetPerContextChatData called before ready [object Object]", source: https://steamloopback.host/chunk~2dcc5aaf7.js?contenthash=fc89e86c22362045d2b3 (1)
[0222/045809.416587:INFO:CONSOLE(1)] "FriendsUI ReadyToRender - Clock Drift - ERROR undefined", source: https://steamloopback.host/chunk~2dcc5aaf7.js?contenthash=fc89e86c22362045d2b3 (1)

Also i was able to confirm that this only happens with achievement popups, message & online popup are fine

Lifeismana avatar Feb 22 '24 04:02 Lifeismana

switching to the stable client seems to partially fix that problem: the first achievement notification shows up correctly but the following ones make the client crash with the same error as the previous message and somehow, this time, the crash is even worse, steam is running out of memory and "reloading" doesn't seem to fix that memory problem which means it's crash looping. closing steam completely, doesn't fix that problem, it keeps crashing when i relaunch it (without showing the ui) new new logs: steam-logs.tar.gz

and switching back to the beta client via the command line option doesn't fix that crash loop at boot.

Lifeismana avatar Feb 22 '24 04:02 Lifeismana

I may have finally found the culprit: too many custom artwork set (i used https://github.com/boppreh/steamgrid for this) deleting the grid folder in my account userdata folder fixed that problem ( /home/USER/.steam/steam/userdata/ACCOUNT_ID/grid) and steam's cache (/home/USER/.steam/steam/appcache & /home/USER/.steam/steam/config/htmlcache ) a nice side effect of that is that i can also finally access my library home page again (Also the current beta seem to have a better memory management/usage than the stable client)

Lifeismana avatar Feb 22 '24 14:02 Lifeismana

This happens to me as well but I'm on Windows. It started when steam did the massive UI overhaul. Setting the client to be in low performance mode and disabling community content doesn't help and I don't even have any custom artwork. I have 32GB RAM so that isn't an issue but I have 16,000 games in my library. My suspicion is that all cached icons and banners are too much for the newer steam client to handle, I put in a support ticket but I got the generic response of they can't help without having my PC. I wish they would fix this because it gets very annoying, the steam client re-opens on top of the game I currently have open which has caused some games to be black screened and subsequently I lose some progress and also I haven't been able to access my library home page for months.

InfiniteRealm avatar Apr 07 '24 17:04 InfiniteRealm

@InfiniteRealm saw this reddit thread https://www.reddit.com/r/Steam/comments/1bxzhwg/if_you_found_that_steamwebhelper_consuming/ mentioned on a discord server tldr: you might want to look at the following file <Steam Directory>\userdata\[AccountID]\config\librarycache\achievement_progress.json, steam has a bug that makes this file boom in size. for me, renaming it to .old made steam idle to 1.7GB of ram instead of 5.1GB. And since this is a cache, deleting it shouldn't bring any problems

After looking a bit more into this, this file gets created/updated when an achievement pops-up. When you gain an achievement in a new game, a new entry gets created in that file from

{"nVersion":2,"mapCache":[[2845260,{"appid":2845260,"unlocked":0,"total":0,"percentage":0,"all_unlocked":false,"cache_time":1712529072}]]}

to

{"nVersion":2,"mapCache":[[2845260,{"appid":2845260,"unlocked":0,"total":0,"percentage":0,"all_unlocked":false,"cache_time":1712529424}],[2881230,{"appid":2881230,"unlocked":0,"total":0,"percentage":0,"all_unlocked":false,"cache_time":1712529333}]]}

the issue is that, as mentioned in that reddit thread, when you restart steam, once you gain a new achievement, that file isn't cleared and the old content is put in an array

{"nVersion":2,"mapCache":[[0,[2845260,{"appid":2845260,"unlocked":0,"total":0,"percentage":0,"all_unlocked":false,"cache_time":1712529424}]],[1,[2881230,{"appid":2881230,"unlocked":0,"total":0,"percentage":0,"all_unlocked":false,"cache_time":1712529333}]],[2881230,{"appid":2881230,"unlocked":0,"total":0,"percentage":0,"all_unlocked":false,"cache_time":1712529608}]]}

and this gets worse with each reboot

{"nVersion":2,"mapCache":[[0,[0,[2845260,{"appid":2845260,"unlocked":0,"total":0,"percentage":0,"all_unlocked":false,"cache_time":1712529424}]]],[1,[1,[2881230,{"appid":2881230,"unlocked":0,"total":0,"percentage":0,"all_unlocked":false,"cache_time":1712529333}]]],[2,[2881230,{"appid":2881230,"unlocked":0,"total":0,"percentage":0,"all_unlocked":false,"cache_time":1712529608}]],[2845260,{"appid":2845260,"unlocked":0,"total":0,"percentage":0,"all_unlocked":false,"cache_time":1712531498}]]}

pinging @kisak-valve so that this can hopefully be brought to devs' ears quickly

Lifeismana avatar Apr 07 '24 23:04 Lifeismana

Found the problem: in LoadCacheFile() the cache isn't loaded correctly (ctrl+F "achievement_progress.json" in that raw file: https://github.com/SteamDatabase/SteamTracking/blob/master/ClientExtracted/steamui/chunk~2dcc5aaf7.js )

image this code is incorrect:

for (let t in e.data.mapCache)
  this.m_achievementProgress.mapCache.set(
    parseInt(t),
    e.data.mapCache[t],
  );

since e.data.mapCache is an array that contains arrays, t isn't the appid, it's the id of the array (aka 0,1,2...) one way to fix that would be to change it to something like this:

for (let t in e.data.mapCache)
  this.m_achievementProgress.mapCache.set(
      e.data.mapCache[t][0],
      e.data.mapCache[t][1],
  );

(parseInt shouldn't be needed since the appid is stored as a number, not as a string and for t, it's an id) i guess e.data.mapCache can't simply be assigned to this.m_achievementProgress.mapCache since they aren't the same types (Array vs Map)

Also, that cache might need a Version bump to remove the erroneous file from everyone's steam client

Lifeismana avatar Apr 08 '24 04:04 Lifeismana

steam has a bug that makes this file boom in size. for me, renaming it to .old made steam idle to 1.7GB of ram instead of 5.1GB.

Thank you for bringing this to my attention, my achievement_progress JSON is over 2GB!

Re-naming the file has reduced RAM usage to just 600MB, thank you.

Edit: This also seems to have fixed the library homepage issue

InfiniteRealm avatar Apr 08 '24 13:04 InfiniteRealm

Yeah this has been going around for months now on Windows and Linux. achievement_progress.json grows large with decent amount of playtime within a few days.

I'm glad this bug finally caught on. A lot of Steam Supports denied and kept telling us it was some Antivirus issue, it was maddening. It's such an easy fix, this needs to be pushed to the Steam Client ASAP since it eventually leads to infinite loop of Steam client crashing and restarting. Not sure how we can get Valve's attention to get this sorted out quick.

klaritan avatar Apr 10 '24 14:04 klaritan

https://steamcommunity.com/groups/SteamClientBeta/announcements/detail/4200244327586332599

Plagman avatar Apr 29 '24 19:04 Plagman