Skip to content

Can't run getcap in steam-run (symbol lookup error: getcap: undefined symbol: cap_get_nsowner) #92795

Closed

Description

@Atemu

Describe the bug
A clear and concise description of what the bug is.

You can't run getcap inside steam-run (returns getcap: symbol lookup error: getcap: undefined symbol: cap_get_nsowner).

This makes SteamVR's vrstartup script think that no capability is set on vrcompositor-launcher which causes it to show a popup prompt on every SteamVR startup asking for superuser permissions and then an error message becasue of #69338.

To Reproduce
Steps to reproduce the behavior:

  1. steam-run getcap

Expected behavior
A clear and concise description of what you expected to happen.

It should print usage and, when pointed at a file, the capabilities of the file.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

#71554

Notify maintainers

@abbradar

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

  • system: "x86_64-linux"
  • host os: Linux 5.6.19, NixOS, 20.09pre233323.dc80d7bc4a2 (Nightingale)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.3.6
  • channels(root): "nixos-20.09pre233323.dc80d7bc4a2, nixpkgs-mozilla, nixos-stable-20.03.2310.fb6c3a6831c, nixos-unstable-20.09pre231796.22a81aa5fc1"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:

Activity

  1. added
    0.kind: bug
    on Jul 9, 2020
  2. added
    6.topic: steam
    on Jul 10, 2020
  3. corngood commented on Jul 29, 2020

    @corngood
    Contributor

    The linker error is caused by using nixpkgs getcap with libcap from steamrt. Adding libcap to the steam FHS multiPkgs fixes this, but seems to break other things:

    diff --git a/pkgs/games/steam/chrootenv.nix b/pkgs/games/steam/chrootenv.nix
    index 56e1a09f36e..ea8cd3bc39c 100644
    --- a/pkgs/games/steam/chrootenv.nix
    +++ b/pkgs/games/steam/chrootenv.nix
    @@ -111,6 +111,9 @@ in buildFHSUserEnv rec {
         libuuid
         libbsd
         alsaLib
    +
    +    # needed by getcap for vr startup
    +    libcap
       ] ++ (if (!nativeOnly) then [
         (steamPackages.steam-runtime-wrapped.override {
           inherit runtimeOnly;
    @@ -144,7 +147,6 @@ in buildFHSUserEnv rec {
         expat
         dbus
         cups
    -    libcap
         SDL2
         libusb1
         dbus-glib
    ~/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher: error while loading shared libraries: libcap.so.2: cannot open shared object file: No such file or directory
    

    This made me think about RPATH / LD_LIBRARY_PATH / RUNPATH and the implications of getcap using RUNPATH instead of RPATH.

    Fixing getcap gets rid of the popup if you manually setcap, but that causes other issues you've already discovered.

    I'm going to leave this for now. I just wanted to document my investigation.

  4. Atemu commented on Jul 30, 2020

    @Atemu
    MemberAuthor

    This fixes the issue, I am now able to run the regular vrstartup.sh from steam-run without any popup after setting the cap manually (automatic setcap via SUID wrappers doesn't work because of #69338).

    It does not fix the issue in Steam itself though oddly, not even when Steam is run from within steam-run.

    Which are those "other things" your patch breaks? I was able to run SteamVR and Beat Saber without any issue (well, none that I didn't have before).

    As for your shared library issue, that's fixed by #55973.

  5. corngood commented on Jul 30, 2020

    @corngood
    Contributor

    Which are those "other things" your patch breaks?

    I was just referring to ~/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher: error while loading shared libraries: libcap.so.2: cannot open shared object file: No such file or directory

  6. stale commented on Jan 26, 2021

    @stale

    I marked this as stale due to inactivity. → More info

  7. added
    2.status: stale
    on Jan 26, 2021
  8. expipiplus1 commented on Jan 27, 2021

    @expipiplus1
    Contributor

    still important to me, @stalebot

  9. removed
    2.status: stale
    on Jan 27, 2021
  10. ashkitten commented on Feb 23, 2021

    @ashkitten
    Contributor

    fixed by #114024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bug6.topic: steam

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions