-
- Downloads
Unblock signals when spawning subprocesses, and in s-r-s-i
This avoids a coreutils limitation in versions [8.27, 8.29), which
unfortunately includes Ubuntu 18.04: timeout(1) relied on SIGCHLD not
being blocked, but did not unblock it themselves.
The Steam client runs s-r-s-i from a thread that has SIGCHLD blocked,
and SIGALRM, SIGPIPE and SIGTRAP ignored. This is contrary to frequent
expectations of general-purpose libraries and command-line utilities:
in particular, SIGPIPE is used by processes writing to a pipe to detect
that the read end has died, SIGTRAP is frequently used to terminate
processes on an assertion failure, and SIGCHLD is often necessary for
subprocess management.
Games (whether Steam or non-Steam) appear to be run with only SIGPIPE
and SIGTRAP ignored, so strictly speaking, unignoring those two makes
the behaviour of s-r-s-i unlike the behaviour of actual games. However,
the effect of unblocking SIGPIPE and SIGTRAP is to make s-r-s-i more
likely to crash (the default disposition of both those signals is process
termination), which is probably what we want: if there is any difference,
we want s-r-s-i's helpers to be more strict than games (crash more often),
so that they can act as an early-warning system for issues that could
manifest in games.
In s-r-s-i, don't unblock signals until after we have finished
command-line parsing and redirected stdout to print to the original
stderr. Otherwise, g_debug() would go to the original stdout, resulting
in it being invalid JSON.
Signed-off-by:
Simon McVittie <smcv@collabora.com>
parent
8b4f212e
No related branches found
No related tags found
Showing
- bin/system-info.c 2 additions, 0 deletionsbin/system-info.c
- meson.build 3 additions, 0 deletionsmeson.build
- steam-runtime-tools/architecture.c 1 addition, 1 deletionsteam-runtime-tools/architecture.c
- steam-runtime-tools/graphics.c 3 additions, 3 deletionssteam-runtime-tools/graphics.c
- steam-runtime-tools/library.c 1 addition, 1 deletionsteam-runtime-tools/library.c
- steam-runtime-tools/locale.c 1 addition, 1 deletionsteam-runtime-tools/locale.c
- steam-runtime-tools/meson.build 1 addition, 1 deletionsteam-runtime-tools/meson.build
- steam-runtime-tools/system-info.c 3 additions, 3 deletionssteam-runtime-tools/system-info.c
- steam-runtime-tools/utils-internal.h 4 additions, 0 deletionssteam-runtime-tools/utils-internal.h
- steam-runtime-tools/utils.c 96 additions, 0 deletionssteam-runtime-tools/utils.c
Loading
Please register or sign in to comment