Skip to content

SteamVR's server may run out of thread keys while Steam stays stopped for more than about 9 minutes #181

Not planned

Description

@Xenolphthalein

As an owner I want SteamVR to keep running however long Steam is stopped, so that the image doesn't freeze when a
program connects to it later.

Now: without the Steam client, SteamVR's server (vrserver) tries Steam's API every half second, and each try
loads the client's library through ~/.steam/sdkarm64, which takes a thread key that is never given back. After
about 9 minutes all 1024 are gone, and the next program that connects crashes vrserver. The first-run setup no
longer meets it: while the setup holds the client back, the link stays away (overpressure/packages#52, checked on the
headset: 685 s without a load, a client connecting at 12 minutes). The same would happen whenever Steam stops for
longer while SteamVR keeps running (Steam quits or crashes, a long restart); that hasn't been seen or tested.

Acceptance criteria

  • Measured: with Steam stopped and SteamVR running, whether vrserver loads the library on each try and runs out
    of thread keys (pthread_key_create failed in the journal), and after how long.
  • If it does, SteamVR survives Steam staying stopped for 30 minutes: a client connecting then (vrcmd) leaves
    vrserver running.
  • Steam starting again brings the API back without restarting SteamVR.

Activity

  1. added
    gap
    steam
    on Dec 3, 2026
  2. Xenolphthalein commented on Dec 3, 2026

    @Xenolphthalein
    ContributorAuthor

    Measured on the headset; no change needed.

    Steam stopped, SteamVR running (30 minutes). With the Steam client killed and kept from restarting, steam.pid names a process that no longer exists. vrserver then only reads steam.pid on each try and never loads steamclient.so: 0 loads in 10 s right after the stop and after 29 minutes, no pthread_key_create failed in the journal. After 30 minutes a client (vrcmd --info) connected and vrserver kept running, same process. A clean exit that removes steam.pid behaves the same.

    Steam started again. steam.service started at 12:53:40; vrserver logged "Steam API available" and "Connected to Steam" at 12:53:41, without a restart of SteamVR.

    Where the leak does happen. Only while steam.pid names a live process that is not Steam's client: vrserver then loads the library about twice a second, and with such a stand-in the keys ran out after 8 min 37 s, and the next client crashed vrserver. A stopped Steam never leaves that behind. A Steam restart costs about 8 loads (measured), so it would take over a hundred restarts within one SteamVR run to matter.

    Criteria: 1 measured; 2 holds (no loads, so nothing runs out; a client after 30 minutes leaves vrserver running); 3 holds.

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

    gapsteam

    Type

    Fields

    Stage

    Backlog

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions