log to per-process files, and make crash reports easier to collect (partial #73) - #401
Open
skryvel wants to merge 4 commits into
Open
log to per-process files, and make crash reports easier to collect (partial #73)#401skryvel wants to merge 4 commits into
skryvel wants to merge 4 commits into
Conversation
Multiple processes can run xrizer concurrently (e.g. a launcher's VR probe alongside the game itself). They all truncated the same xrizer.txt on init, clobbering each other's output - a probe could punch a NUL hole over the game's entire early log. Give each process its own xrizer-<timestamp>-<pid>.txt instead, and remove files older than two days on startup so the directory doesn't grow without bound. The timestamp is there so logs sort chronologically; pids are reused across reboots. This covers the log history half of Supreeeme#73 - the persistent crash popup it also asks for is not addressed here.
miniquad's clipboard only serves pastes while the dialog window is alive, and is unimplemented on some Linux backends, so pastes usually came up empty. Prefer wl-copy/xclip/xsel, which keep the selection alive, and tell the user when we had to fall back. Also include the error message itself in the copied text. The log file button now opens the per-process log file.
Steam launch options do not reliably deliver environment variables to every game process (observed with SUPERHOT VR, where identical launch options applied RUST_LOG on one run and not the next). When RUST_LOG is absent, read the filter from <state dir>/xrizer/log_filter instead so trace logging can be enabled regardless of how the game is launched.
A 32-bit xrizer build without the static-openxr feature dlopens the system libopenxr_loader.so and dies with "wrong ELF class" on systems that only have the 64-bit loader. Spell out the actual requirement in the panic message.
skryvel
marked this pull request as ready for review
August 8, 2026 15:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out of #397. Partly addresses #73 — the log history half of it; the persistent crash popup that issue also asks for is not covered here.
Concurrent processes were destroying each other's logs. More than one process can run xrizer at once — Proton games typically start a short-lived process that checks for a headset before the game itself launches — and each truncated the same
xrizer.txton startup. Debugging a game, I lost its entire early log to a probe that started afterwards and punched a hole of NUL bytes over it. Each process now writesxrizer-<timestamp>-<pid>.txt. The timestamp is there so the files sort chronologically; pids get reused across reboots. Files older than two days are removed on startup so the directory doesn't grow forever.The crash dialog's "Copy to clipboard" usually pasted nothing. miniquad's clipboard only serves paste requests while its window is alive, and is unimplemented on some backends, so the backtrace was gone by the time you had somewhere to put it. It now pipes through wl-copy/xclip/xsel when one is available, and says so when it had to fall back. The copied text includes the error message, not just the backtrace, and the "Open log file" button opens the file this process actually wrote.
RUST_LOGdoesn't always reach the game. Some launch setups sanitize the environment, which makes it impossible to raise the log level for the process you care about. IfRUST_LOGis unset, alog_filterfile in the log directory is read instead, containing the same filter string.A 32-bit build failed to load with a message that didn't say why. Since #202 the default build loads the OpenXR loader at runtime, and a 32-bit xrizer on a machine with only the 64-bit loader installed dies with
wrong ELF class: ELFCLASS64and nothing else — I lost time to this twice before working out what it wanted. The panic now says it needs a 32-bit loader, or a build with--features static-openxr.