fix: keep SteamVR syscall hooks and report Steam crashes (#905)

* fix: preserve SteamVR syscall hooks

* fix: report Steam crashes through gamescope
This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-10-15 15:50:26 +00:00
1 parent 787cec2548
commit d301148881
4 files changed
+162

No files matched your search

@@ -62,6 +62,20 @@ steam_update_stuck() {
[ "$steam_updates" -ge 3 ]
}
run_gamescope() (
local status_file child_status compositor_status
status_file=$(mktemp "${XDG_RUNTIME_DIR:-/tmp}/droiddeck-steam-exit.XXXXXX") || exit 73
trap 'rm -f "$status_file"' EXIT
# Gamescope can return success when its primary child crashed.
BL_STEAM_EXIT_FILE="$status_file" gamescope "$@"
compositor_status=$?
if read -r child_status < "$status_file" && [[ $child_status =~ ^[0-9]{1,3}$ ]] \
&& [ "$child_status" -gt 0 ] && [ "$child_status" -le 255 ]; then
exit "$child_status"
fi
exit "$compositor_status"
)
collect_steam_logs() {
[ -n "${BL_DEBUG_DIR:-}" ] || return 0
local steam_root=${XDG_DATA_HOME:-$HOME/.local/share}/Steam
@@ -229,6 +243,10 @@ if [ -z "${BL_INSIDE:-}" ]; then
echo "== gamescope: mangoapp on ($(command -v mangoapp), config $MANGOHUD_CONFIGFILE)"
fi
export BL_INSIDE=1
if [ "$mode" = steam ]; then
run_gamescope "${args[@]}" -- "$0" "$mode" "$@"
exit $?
fi
exec gamescope "${args[@]}" -- "$0" "$mode" "$@"
fi
@@ -917,6 +935,9 @@ BUSCONF
[ -n "$_bl_jobs" ] && kill $_bl_jobs 2>/dev/null
reap_orphans
fi
if [ -n "${BL_STEAM_EXIT_FILE:-}" ]; then
printf '%s\n' "$rc" > "$BL_STEAM_EXIT_FILE"
fi
exit "$rc"
;;
*)
+15
View File
@@ -7,6 +7,7 @@
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <sys/syscall.h>
#include <sys/uio.h>
#include <unistd.h>
@@ -25,8 +26,22 @@ struct bl_open_how {
};
static long (*real_syscall)(long, ...);
static void *(*real_dlopen)(const char *, int);
static int openat2_missing;
void *dlopen(const char *filename, int flags) {
if (!real_dlopen) {
real_dlopen = (void *(*)(const char *, int))dlsym(RTLD_NEXT, "dlopen");
}
const char *basename = filename ? strrchr(filename, '/') : NULL;
basename = basename ? basename + 1 : filename;
// Steam's deep binding bypasses the robust-list shim under PRoot.
if (basename && strcmp(basename, "vrclient.so") == 0) {
flags &= ~RTLD_DEEPBIND;
}
return real_dlopen(filename, flags);
}
int bl_fsync_syscall(long number, const long *args, long *ret) __attribute__((visibility("hidden")));
static struct robust_list_head *thread_robust_head(void) {