Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core dumped (Attempt to free invalid pointer) when running Team Fortress 2 on 23.08 #1158

Closed
SeaDve opened this issue Sep 7, 2023 · 24 comments · Fixed by #1171
Closed

Core dumped (Attempt to free invalid pointer) when running Team Fortress 2 on 23.08 #1158

SeaDve opened this issue Sep 7, 2023 · 24 comments · Fixed by #1171

Comments

@SeaDve
Copy link

SeaDve commented Sep 7, 2023

Game information

Team Fortress 2 (Didn't test with other source engine games)

Distribution name and version where applicable

Fedora Silverblue 38

Flatpak info

$ flatpak --version
Flatpak 1.15.4
$ flatpak --gl-drivers
default
host

Problem description

Pressing Play does not do anything with the following log output:

log.txt

This is only reproducible on 23.08 runtime, it works fine in 22.08.

Does this issue reproduce with native Steam

Have not tested

@SeaDve SeaDve changed the title Core dumped when running Team Fortress 2 on 23.08 Core dumped (Attempt to free invalid pointer) when running Team Fortress 2 on 23.08 Sep 7, 2023
@SeaDve
Copy link
Author

SeaDve commented Sep 8, 2023

For anyone having the same issue, they can downgrade to the previous version:

sudo flatpak update --commit=227a5e654498b890a13fc6612fdc3b12a4ebd943f1e764972a5ff0e65882b9a4 com.valvesoftware.Steam

@doraskayo
Copy link
Contributor

doraskayo commented Sep 9, 2023

According to ProtonDB, this is likely a bug in a library that the game ships, which the update exposed.

See multiple reports here: https://www.protondb.com/app/440#F5eUgPqkSk

@Gamertech
Copy link

Can confirm swapping back to the pre-23.08 runtime version TF2 runs fine again.

LLVM16 + Google Performance Tools are conflicting. There is a PR for an update to gperftools waiting, but don't know if that would fix it yet.

@doogie544
Copy link

doogie544 commented Sep 16, 2023

Found a more elegant way to get TF2 working.
If you simply delete
.....Team Fortress 2/bin/libtcmalloc_minimal.so.4 the game falls back to the version that is included in the flatpak and the game will run.

This will also work for other source-1 games as well. I tested it in No More Room in Hell and Fistful of Frags and it allowed those game to launch as well. (tho in the case of FoF, the libtcmalloc_minimal.so.4 file was in ....../Fistful of Frags/sdk/bin not in the top bin folder)

this will have to be redone if the files for the game are verified or maybe after a future game update

edit: on further testing leaving the file in place but adding LD_PRELOAD=/app/lib32/libtcmalloc_minimal.so.4 %command% will also get the game working. This might be a more permanent workaround until valve hopefully fixes the game

@MisterSheeple
Copy link

For some reason, none of the workarounds mentioned in this thread seem to work for me. In all cases, the game window briefly pops up, I can hear the first quarter second of the Valve logo, and then it crashes. Does anyone know how to enable logging so I can get a better look at what's causing this to happen for me?

doraskayo added a commit to doraskayo/com.valvesoftware.Steam that referenced this issue Sep 29, 2023
Block libtcmalloc_minimal.so.4 to avoid game crashes.

Closes: flathub#1158
@doraskayo
Copy link
Contributor

doraskayo commented Sep 29, 2023

@doogie544, can you please share full paths to libtcmalloc_minimal.so.4 and to the executable that crashes in all games known to be affected?

I opened #1171 to fix the crash with TF2, but I can do the same for more games.

@doogie544
Copy link

doogie544 commented Sep 30, 2023

@doraskayo here is the list of the games I have that are broken due to this issue
broken source list.odt

I deleted the leading / before the game folder when I deleted the rest of irrelevant part of the path, but the folder names are exactly as they appear. I did a copy and past of the file location to prevent typos

@MisterSheeple
Copy link

MisterSheeple commented Sep 30, 2023

Portal is also broken, but I don't see libtcmalloc anywhere in its files. I do however see libmimalloc.so, which might be related.

Edit: libmimalloc.so is also present in Half-Life 2, which also prevents that game from starting. I'll be testing more Source games shortly to see which ones are affected, but I suspect it may be all of them.

@doogie544
Copy link

Portal is also broken, but I don't see libtcmalloc anywhere in its files. I do however see libmimalloc.so, which might be related.

Edit: libmimalloc.so is also present in Half-Life 2, which also prevents that game from starting. I'll be testing more Source games shortly to see which ones are affected, but I suspect it may be all of them.

Portal worked for me, I installed it just to check it. Not likely related to this issue. Halflife 2 also worked as did Halflife source (which also had libmimalloc.so instead of the problem library)

Maybe you just need to verify the game files for portal?

@MisterSheeple
Copy link

Maybe you just need to verify the game files for portal?

I did verify the files and unfortunately nothing changed.

@doogie544
Copy link

doogie544 commented Sep 30, 2023

I just reinstalled both games again and double checked.

Both started for me this time as well. Whatever you have happening is not related to this issue as this is specific to the libtcmalloc_minimal.so.4 library present in those games causing issues

@doogie544
Copy link

doogie544 commented Sep 30, 2023

when you have a game affected by this you get a very specific line in the log about 12 lines from the bottom

src/tcmalloc.cc:278] Attempt to free invalid pointer 0x91b9ad0

@MisterSheeple
Copy link

when you have a game affected by this you get a very specific line in the log about 12 lines from the bottom

src/tcmalloc.cc:278] Attempt to free invalid pointer 0x91b9ad0

Would this show up in the Steam log or somewhere else? I tried looking for individual application logs but never found any.

@doogie544
Copy link

@MisterSheeple it is in the logs you get from starting steam from the cli. flatpak run com.valvesoftware.Steam

This is an issue happening outside of the flatpak as well. Anyone using amd with llvm16 will run into it. Happens on the non-flatpak steam in Fedora 38, Arch and Gentoo that I know of.

Fedora has had the issue the longest afaik, it never worked in f38 as that was when they upgraded to llvm16. Arch and Gentoo had it happen a bit earlier than flatpak and we got it when flatpak updated to use the 23.08 runtime which has llvm16 apparently

I see that you mentioed about none of the offered fixes worked for you. If going into the affected games and deleting libtcmalloc_minimal.so.4 or using the launch option of LD_LD_PRELOAD=/app/lib32/libtcmalloc_minimal.so.4 %command% does not get TF2 or Garrys Mod (or the other 2 that I have in the file I uploaded) then you probably have something else going on with your steam install which might be why Half Life 2 and Portal are not working for you either

@MisterSheeple
Copy link

MisterSheeple commented Sep 30, 2023

I see that you mentioed about none of the offered fixes worked for you. If going into the affected games and deleting libtcmalloc_minimal.so.4 or using the launch option of LD_LD_PRELOAD=/app/lib32/libtcmalloc_minimal.so.4 %command% does not get TF2 or Garrys Mod (or the other 2 that I have in the file I uploaded) then you probably have something else going on with your steam install which might be why Half Life 2 and Portal are not working for you either

After having a look at the log, this is the one thing that seems to happen in all cases when attempting to start most Source games: ERROR: ld.so: object '/home/mistersheeple/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.

Is this relevant? If not, I can start a new issue.

@doogie544
Copy link

wrong elf class it not relevant. That will happen in every game. There are 2 builds of the overlay one is 64 and one is 32bit. Steam will try to load both as it does not know what architecture the game is, one is obviously going to fail as it is the incorrect architecture, that is normal but b/c it is a failure it will be logged. You will see this type of error a LOT when looking at a proton log and it will try to load both versions of gstreamer libraries.

TL;DR, normal and not important to troubleshooting

@MisterSheeple
Copy link

TL;DR, normal and not important to troubleshooting

Ah, that's my mistake then. The actual issue I'm having appears to be a segmentation fault.

/home/mistersheeple/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Team Fortress 2/hl2.sh: line 72: 2183 Segmentation fault (core dumped) ${GAME_DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@"

@doraskayo
Copy link
Contributor

@doraskayo here is the list of the games I have that are broken due to this issue broken source list.odt

I deleted the leading / before the game folder when I deleted the rest of irrelevant part of the path, but the folder names are exactly as they appear. I did a copy and past of the file location to prevent typos

@doogie544, thanks, but I also need the path to the crashing executable in each game. For example, in TF2 this is Team Fortress 2/hl2_linux.

doraskayo added a commit to doraskayo/com.valvesoftware.Steam that referenced this issue Sep 30, 2023
Block libtcmalloc_minimal.so.4 to avoid game crashes.

See: flathub#1158
doraskayo added a commit to doraskayo/com.valvesoftware.Steam that referenced this issue Sep 30, 2023
Block libtcmalloc_minimal.so.4 to avoid game crashes.

See: flathub#1158
doraskayo added a commit to doraskayo/com.valvesoftware.Steam that referenced this issue Sep 30, 2023
Block libtcmalloc_minimal.so.4 to avoid game crashes.

See: flathub#1158
doraskayo added a commit to doraskayo/com.valvesoftware.Steam that referenced this issue Sep 30, 2023
Block libtcmalloc_minimal.so.4 to avoid game crashes.

See: flathub#1158
doraskayo added a commit to doraskayo/com.valvesoftware.Steam that referenced this issue Sep 30, 2023
Block libtcmalloc_minimal.so.4 to avoid game crashes.

See: flathub#1158
@doraskayo
Copy link
Contributor

@doogie544, I used SteamDB to hopefully figure it out. It seems all 4 games you listed have the hl2_linux executable.

Can you please confirm that all 4 games work without issues when running this test build of the Steam Flatpak? #1171 (comment)

Please add a comment in the PR if it works without issues.

@doraskayo
Copy link
Contributor

#1171 should so far fix the following games:

  • Team Fortress 2
  • Day of Defeat: Source
  • Garry's Mod
  • No More Room in Hell
  • Fistful of Frags

If anyone else has a game that crashes unless configured to launch with LD_PRELOAD=/app/lib32/libtcmalloc_minimal.so.4 %command%, please:

  1. Mention it here by name.
  2. Include the path to libtcmalloc_minimal.so.4 and to the crashing binary (usually called hl2_linux) under the steamapps/common directory.

@doogie544
Copy link

doogie544 commented Sep 30, 2023

@doraskayo
I have to apologize, I read the message on my phone the first time and didn't notice that you needed the executable as well.

The fix works for all games but no more room in hell and that is my fault. when I removed the rest of the leading path I accidentality removed the first letter of the folder name and didn't notice b/c it was an n next to an m I checked it several times but must have missed it as it was a long day and I was a bit tired.

the correct folder name is nmrih it has the first letter of each word of the name in it

doraskayo added a commit to doraskayo/com.valvesoftware.Steam that referenced this issue Sep 30, 2023
Block libtcmalloc_minimal.so.4 to avoid game crashes.

See: flathub#1158
doraskayo added a commit to doraskayo/com.valvesoftware.Steam that referenced this issue Sep 30, 2023
Block libtcmalloc_minimal.so.4 to avoid game crashes.

See: flathub#1158
@gg537
Copy link

gg537 commented Oct 2, 2023

The runtime update broke Substance painter too, I get the following error complaining about libcrypt.so.1 being missing

.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Substance 3D Painter 2022/Adobe Substance 3D Pai  
nter: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory

It works again if I revert with
sudo flatpak update --commit=227a5e654498b890a13fc6612fdc3b12a4ebd943f1e764972a5ff0e65882b9a4 com.valvesoftware.Steam

Also I wasn't sure if I should make a new issue or post here.

@doraskayo
Copy link
Contributor

The runtime update broke Substance painter too, I get the following error complaining about libcrypt.so.1 being missing

.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Substance 3D Painter 2022/Adobe Substance 3D Pai  
nter: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory

It works again if I revert with sudo flatpak update --commit=227a5e654498b890a13fc6612fdc3b12a4ebd943f1e764972a5ff0e65882b9a4 com.valvesoftware.Steam

Also I wasn't sure if I should make a new issue or post here.

It sounds like the app relies on libraries that the Steam runtime doesn't provide and expects the OS to provide instead. The newer Freedesktop SDK runtime comes with a version of libxcrypt which updated its ABI version to libcrypt.so.2. As far as I know libxcrypt allows building the legacy glibc ABI as a separate library, but we don't do it in 23.08 at the moment.

Does enabling "Steam Linux Runtime" under "Compatibility" in the the "game" properties help avoid this issue?

Regardless, please open a separate issue. It's unrelated to the issue discussed here.

@gg537
Copy link

gg537 commented Oct 2, 2023

Does enabling "Steam Linux Runtime" under "Compatibility" in the the "game" properties help avoid this issue?

Enabling "Steam Linux Runtime 1.0(scout)" it still doesn't launch but I get a different error in the terminal now

/bin/bash: /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/libtinfo.so.6: no version information available (required by /bin/bash)
I no longer get an error about missing libcrypt.so.1

Regardless, please open a separate issue. It's unrelated to the issue discussed here.

I made a new issue here #1174

nanonyme pushed a commit to doraskayo/com.valvesoftware.Steam that referenced this issue Oct 15, 2023
Block libtcmalloc_minimal.so.4 to avoid game crashes.

See: flathub#1158
nanonyme pushed a commit to doraskayo/com.valvesoftware.Steam that referenced this issue Oct 15, 2023
Block libtcmalloc_minimal.so.4 to avoid game crashes.

See: flathub#1158
nanonyme pushed a commit to doraskayo/com.valvesoftware.Steam that referenced this issue Oct 15, 2023
Block libtcmalloc_minimal.so.4 to avoid game crashes.

See: flathub#1158
nanonyme pushed a commit to doraskayo/com.valvesoftware.Steam that referenced this issue Oct 15, 2023
Block libtcmalloc_minimal.so.4 to avoid game crashes.

See: flathub#1158
nanonyme pushed a commit to doraskayo/com.valvesoftware.Steam that referenced this issue Oct 15, 2023
Block libtcmalloc_minimal.so.4 to avoid game crashes.

See: flathub#1158
nanonyme pushed a commit to doraskayo/com.valvesoftware.Steam that referenced this issue Oct 15, 2023
Block libtcmalloc_minimal.so.4 to avoid game crashes.

See: flathub#1158
nanonyme pushed a commit to doraskayo/com.valvesoftware.Steam that referenced this issue Oct 15, 2023
Block libtcmalloc_minimal.so.4 to avoid game crashes.

See: flathub#1158
nanonyme pushed a commit to doraskayo/com.valvesoftware.Steam that referenced this issue Oct 15, 2023
Block libtcmalloc_minimal.so.4 to avoid game crashes.

See: flathub#1158
nanonyme pushed a commit to doraskayo/com.valvesoftware.Steam that referenced this issue Oct 15, 2023
Block libtcmalloc_minimal.so.4 to avoid game crashes.

See: flathub#1158
nanonyme pushed a commit to doraskayo/com.valvesoftware.Steam that referenced this issue Oct 15, 2023
Block libtcmalloc_minimal.so.4 to avoid game crashes.

See: flathub#1158
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants