protonscr

Bugged behaviour when ~/.steam is on a filesystem without FIFO support.

steamopen reviewed
ValveSoftware/steam-for-linux#3764 · opened 2015-03-20 by joaormatos · updated 2015-03-20 · 0 comments · github
Jjoaormatos 2015-03-20 github

I've found a bug in Steam that causes it to misbehave when it can't create a FIFO inside the ~/.steam directory (namely, ~/.steam/steam.pipe.)
This can happen under certain circumstances, such as when the user's home directory is on a filesystem without FIFO support (e.g. networked filesystems such as NFS or AFS).

The behavior that I encountered was the following:

  • Execute steam.sh
    • Steam's Login window appears
  • Introduce credentials and log in.
    • The window goes away and the normal Steam client interface starts.
    • After a few seconds, the Login window appears again, while the client is still running.
  • Introduce credentials and log in on the second Login window.
    • The Login window goes away and a second instance of the Steam client interface starts.
    • After a few seconds, the Login window appears again, while the two previous instances of Steam are still running.
  • Close the Login window.
    • No further Login windows appear, and the two simultaneous Steam clients appear to function.
    • (Had I logged in instead, the cycle would repeat, spawning additional instances of Steam.)
  • Try to open a game in either of the open clients.
    • Game fails to open with a message saying that it can't find a running Steam client.

Why this happens:
After logging in, the Steam client runs the script:

$STEAMROOT/ubuntu12_32/driverhelper.py

which, in turn, runs:

~/.steam/root/steam.sh steam://open/driverhelperready

which results in a new Steam client instance, due to the lack of a working ~/.steam/steam.pipe.

I can see two immediate solutions for this problem:

  1. Fail gracefully when the FIFO file can't be created, alerting the user to the fact.
  2. Find another place on the system where a FIFO can be created, create a randomly-named FIFO there, and create a symlink at ~/.steam/steam.pipe pointing to it.

Also, consider using some other IPC, such as UNIX domain sockets.
Note the problems that can arise when there are simultaneous writes to the same FIFO; I believe messages can be jumbled together.
You can probably use flock(2) on the FIFO before writing to it, to avoid such problems.

Nothing extracted yet.