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

steam: tcmalloc issue in older native source games #292139

Closed
U2C9727A4 opened this issue Feb 28, 2024 · 12 comments
Closed

steam: tcmalloc issue in older native source games #292139

U2C9727A4 opened this issue Feb 28, 2024 · 12 comments

Comments

@U2C9727A4
Copy link

U2C9727A4 commented Feb 28, 2024

Describe the bug

In nixos-unstable, steam games (specifically TF2) has been unable to launch. rolling back to an older generation fixes the issue.

Steps To Reproduce

Steps to reproduce the behavior:
idk, Perhaps a recently updated package is causing it?

Expected behavior

The game was supposed to launch properly, But it didnt.

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"

 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.77, NixOS, 24.05 (Uakari), 24.05pre584422.a4d4fe8c5002`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"home-manager, nixos"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

@U2C9727A4
Copy link
Author

side note: nix-info was ran on the generation that does run TF2

@Jayman2000
Copy link
Contributor

Could you post a log of what happens when you try to launch TF2? Specifically, here’s how you can get a log of TF2’s stdout and stderr:

  1. Open your Steam library.
  2. Right click on Team Fortress 2 and select “Properties…”
  3. Set the launch options to %command% &> log.txt
  4. Close out of the properties window.
  5. Launch TF2.

That will create a file named “log.txt” in TF2’s root folder. If you could post that log file, that would be super helpful.

@U2C9727A4
Copy link
Author

U2C9727A4 commented Feb 29, 2024

Could you post a log of what happens when you try to launch TF2? Specifically, here’s how you can get a log of TF2’s stdout and stderr:

1. Open your Steam library.

2. Right click on Team Fortress 2 and select “Properties…”

3. Set the launch options to `%command% &> log.txt`

4. Close out of the properties window.

5. Launch TF2.

That will create a file named “log.txt” in TF2’s root folder. If you could post that log file, that would be super helpful.

Heres the file

Its from the generation that cannot launch TF2

TF2.log

@Jayman2000
Copy link
Contributor

The log says

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

which indicates that you’re experiencing this TF2 bug. Try this workaround.

@U2C9727A4
Copy link
Author

Thats weird, If i use an older generation TF2 launches perfectly fine, but not on a newer generation

@Jayman2000
Copy link
Contributor

Does the workaround fix TF2 for you?

@Atemu
Copy link
Member

Atemu commented Mar 1, 2024

@U2C9727A4 could you do a first-parent bisect on nixos-unstable to figure out which exact commit it was?

@CertainLach
Copy link
Member

Also affects SteamVR: ValveSoftware/SteamVR-for-Linux#579 (comment)

New version of Mesa uses aligned_alloc, which isn't implemented in TF2/SteamVR provided tcmalloc.so, thus this memory allocation is done using NixOS's glibc

However, after Mesa finished using this allocation, it tries to free memory using tcmalloc.so, and tcmalloc has no idea about this allocation, because it was done by other allocator (Attempt to free invalid pointer)

Thats weird, If i use an older generation TF2 launches perfectly fine, but not on a newer generation

This is caused by updated Mesa.

@U2C9727A4
Copy link
Author

Also affects SteamVR: ValveSoftware/SteamVR-for-Linux#579 (comment)

New version of Mesa uses aligned_alloc, which isn't implemented in TF2/SteamVR provided tcmalloc.so, thus this memory allocation is done using NixOS's glibc

However, after Mesa finished using this allocation, it tries to free memory using tcmalloc.so, and tcmalloc has no idea about this allocation, because it was done by other allocator (Attempt to free invalid pointer)

Thats weird, If i use an older generation TF2 launches perfectly fine, but not on a newer generation

This is caused by updated Mesa.

Was the developers of mesa notified about this bug?

@CertainLach
Copy link
Member

Was the developers of mesa notified about this bug?

This is not the mesa bug, it is just steam bundling old version of tcmalloc.so

@devurandom
Copy link
Contributor

Was the developers of mesa notified about this bug?

This is not the mesa bug, it is just steam bundling old version of tcmalloc.so

Where is that library located?

I see these libtcmalloc.so:

  • .var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/SteamVR/tools/steamvr_environments/game/bin/linuxsteamrt64/libtcmalloc_minimal.so.0
    • Only used in VR environments?
  • /var/lib/flatpak/app/com.valvesoftware.Steam/x86_64/stable/98f034b154eed70b957bedcba0a5ce3785e70999b4aef85e1f6dd66f2eb15ff7/files/lib32/libtcmalloc_minimal.so.4.5.16
    • Only used for x86-32

Is TF2 an x86-32 binary, not x86-64?

@Jayman2000
Copy link
Contributor

Where is that library located?

$TF2_FOLDER/bin/libtcmalloc_minimal.so.4

Is TF2 an x86-32 binary, not x86-64?

TF2 is 32-bit only, unless you opt in to the x64_test beta branch.

@Atemu Atemu changed the title Bug with steam steam: tcmalloc issue in older native source games Mar 28, 2024
@SuperSandro2000 SuperSandro2000 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants