fix(builder): every crash report line takes the build report's scrub #3035
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3035
Loading…
Reference in a new issue
No description provided.
Delete branch "PedroRossi/Longshot:fix/crash-report-name-forms"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Crash reports can carry a Windows player's real name. Every report's lines (
store.rs,clean.rs, and the bundle indiag.rs) go throughWho::redact(builder/crates/crash/src/redact.rs), which took out the home folder and the username only exactly as written. Windows writes that folder in other forms, which drivers and Vulkan put in the log as
they are: an 8.3 short name (
C:\Users\JOHNDO~1\..., common in temporary paths), a file URL(
file:///C:/Users/John%20Doe/...) or the\\?\prefix. Those reached the report with the name in them; on manyPCs the account name is the person's own, and the manual report is meant for public issues.
The crate already has a scrub that knows these forms,
build_report::scrub, which only the bundle added on its own.Who::redactnow ends with it, so every report's lines get it, anddiag.rs's own copy goes.How to see it on main: a line with the home folder written as
C:\Users\JOHNDO~1\orfile:///C:/Users/John%20Doe/keeps the name after
Who::redact(the new test's lines).See #1093, which asks for user names out of the generated files: this covers the crash reports' lines.
Read first:
Who::redact, thenwriteindiag.rs.Testing
Tested: on this PC (Linux): the new test (
who_takes_the_name_out_in_the_forms_a_log_line_carries_it) failson main, the name left in those forms, and passes here; the crash crate's tests, clippy -D warnings on it and on
longshot-builder, rustfmt. As
pr createasks for a builder change: Debian 13, GeForce GTX 1660 SUPER, NVIDIA 550.163.01: the game built by a builder from main @b40214d2with this change merged (with #3034), through the PC's job queue, played twice from the Market entrance repository save into play (after loading it shows a menu state first, as main @b40214d2does on this PC in 2 of 3 runs), then the control bridge's quit; exit 0. The crash code this changes runs when a report is made, not in a build or the game.mise run test(--strict) on main @b40214d2, and on main with this change merged (with #3034, from the same audit), through the PC's job queue: 763 passed, 167 failed, 10 skipped both ways, so none fails only with it. The 167 are named at the end.Still to test:
expecting no form of the name in it
Measurements
Nothing to measure: a few string replacements per report line, once when a report is made.
Risks
The scrub also takes the home's own name out where it is any path's folder, as the bundle already did: a report says
a little less. A revert is enough.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.The 167 checks of
mise run testthat fail on main @b40214d2on this PC too, with or without this change99 need a tool this PC doesn't have on PATH (
--strictfails them):68 fail on main itself: test_astc_upload_chunking.py, test_async_astc_upload_chunks.py, test_bind_memo.py, test_blocks_at_start.py, test_bug_report.py, test_cloth_kernels.py, test_cloth_loops.py, test_cloth_sphere.py, test_cloth_step12.py, test_cloth_step8.py, test_cloth_step9.py, test_control_picture.py, test_crash_record.py, test_crt_options.py, test_dev_update.py, test_dlssg_pace.py, test_draw_stream_visibility.py, test_drawn_page_map.py, test_early_split_before_draw.py, test_flat_map.py, test_framegen_resources.py, test_fsr_image_retirement.py, test_fsr_uniform_ownership.py, test_game_boundary.py, test_guest_holes.py, test_image_reaper_threads.py, test_image_view_retry.py, test_import_reach.py, test_input_background.py, test_keyboard_option.py, test_late_fix_build.py, test_linux_pressure.py, test_loaded_modules_drop.py, test_log_levels.py, test_menu_keys.py, test_menu_save_atomic.py, test_mesh_first_types.py, test_mirror_bookkeeping.py, test_oot_occ_raster.py, test_option_ids.py, test_pass_barrier.py, test_perf_send.py, test_pipeline_tour.py, test_present_acquire_ahead.py, test_present_image_free.py, test_present_source_crop.py, test_program_cache_cleanup.py, test_program_cache_one_variant.py, test_readback_timeout_reuse.py, test_recorder_sync.py, test_recording_admission.py, test_report_words.py, test_screensaver.py, test_staging_burst.py, test_switch_table.py, test_target_retention.py, test_tex_desc_memo.py, test_thinlto_tls.py, test_ub_snapshot_default.py, test_ub_snapshot_gpu_writes.py, test_upscaler_round_trip.py, test_vk_wb_cpu_words_fast.py, test_vram_compact.py, test_wb_diff_stale_shadow.py, test_wb_pending_capture.py, test_windows_display_startup.py, test_windows_on_linux.py, test_wrote_regions.py
Found in an AI-assisted audit of the repository. The test, the fix, the runs and this description were made with Claude Code; I reviewed them.
Co-Authored-By: Claude Opus 5.5 [email protected]
🤖 Generated with Claude Code
Tested in game: Debian 13, GeForce GTX 1660 SUPER, NVIDIA 550.163.01: the game built by a builder from main @
b40214d2with this change merged, through the PC's job queue, played twice from the Market entrance repository save into play (after loading it shows a menu state first, as main @b40214d2does on this PC in 2 of 3 runs), then the control bridge's quit; exit 0. The crash code this changes runs when a report is made, not in a build or the game.Possibly related, for context:
WIP: fix(builder): every crash report line takes the build report's scrubto fix(builder): every crash report line takes the build report's scrubLinked #1093 (BeanBot's pointer), which asks for user names out of generated files; this PR covers the crash reports' lines.
@review
Recommendation: Request changes. The new scrub removes the tested path forms, but it can still leave parts of a player’s name in the Windows paths this fix is meant to protect. Public reports can therefore disclose personal information.
The change applies the existing build-report scrubber to crash-report lines and removes the duplicate call in diagnostic bundles. It improves redaction for the tested forms, at the cost of removing some additional folder names from reports.
Blocking (3): must change before merging.
builder/crates/crash/src/redact.rs:106: The first redaction can alter an encoded home folder before the build-report scrubber has a chance to recognize it. (more on the line) Do: Scrub the original line before applying the game's rule, or otherwise preserve complete encoded folder names until they are matched. Add a test where the username is a prefix of the home folder name.builder/crates/crash/src/redact.rs:106: The reused scrubber assumes every 8.3 alias has six name characters before the tilde, so it misses aliases with a multi-digit suffix. (more on the line) Do: Match valid short-name prefixes according to the suffix length, or resolve the actual short path on Windows, and add a multi-digit alias test.builder/crates/crash/src/redact.rs:106: File URLs with percent-encoded non-ASCII characters are not redacted by the reused scrubber. (more on the line) Do: Match percent-encoded UTF-8 path components as well as literal names, with a test covering a non-ASCII Windows home folder.Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
@fixcan do L1, L2 and L3.Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes for the supplied synthetic examples: the author reports that the new test fails on the base and passes on this change. Coverage is incomplete for other valid Windows path forms.
Other systems: The change affects crash logs and fields on Windows and Linux, including manual reports and diagnostic bundles; it does not run in the game. Diagnostic bundles already used the same scrubber after the game's rule. A Windows manual-report run remains outstanding.
Switches: None.
Reviewed:
a66a5dfaa6againstb40214d2bb: Read AGENTS.md, CONTRIBUTING.md, the PR template, standards, both changed files and the build-report scrubber. Read the relevant crash-report callers and their surrounding code; skimmed related tests. The review checklist was absent, and the referenced sibling Tooling checkout was unavailable. No generated files or translations changed.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run, as requested. The author reports the crash-crate tests passing on Linux; CI is still running.
Overlaps and merge order: None found in the supplied information.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -102,2 +104,3 @@/// they reach the team, and the bundle and the manual report public issues.pub fn redact(&self, s: &str) -> String {line(s, &self.home, &self.user, self.windows)crate::build_report::scrub(&line(s, &self.home, &self.user, self.windows), &self.home, &[self.user.as_str()])L1 (blocking): The first redaction can alter an encoded home folder before the build-report scrubber has a chance to recognize it.
When: With home
C:\Users\John Doeand usernameJohn, afile:///C:/Users/John%20Doe/xlog line first becomesfile:///C:/Users/<user>%20Doe/x:linetreats%as the end of the username. The following scrub cannot match the original home or folder name, leavingDoein the report.Do: Scrub the original line before applying the game's rule, or otherwise preserve complete encoded folder names until they are matched. Add a test where the username is a prefix of the home folder name.
L2 (blocking): The reused scrubber assumes every 8.3 alias has six name characters before the tilde, so it misses aliases with a multi-digit suffix.
When: For home folder
John Doe, a valid collision-generated alias such asJOHND~10has five prefix characters.short_nameproducesJOHNDO, so the scrubber leavesC:\Users\JOHND~10\...in the report.Do: Match valid short-name prefixes according to the suffix length, or resolve the actual short path on Windows, and add a multi-digit alias test.
L3 (blocking): File URLs with percent-encoded non-ASCII characters are not redacted by the reused scrubber.
When: For a home folder named
José, a log URL containingfile:///C:/Users/Jos%C3%A9/xmatches neither the literal name nor the scrubber's special handling for%20, so the encoded name remains in a public report.Do: Match percent-encoded UTF-8 path components as well as literal names, with a test covering a non-ASCII Windows home folder.
@fix
The remaining name forms (L1–L3): scrub the original line before the game's rule so an encoded home folder is matched whole; accept 8.3 aliases with multi-digit suffixes; and match percent-encoded non-ASCII path components.
Superseded by main's redaction rework: Who now reads the home's real 8.3 short name from the OS (GetShortPathNameW) and redacts it, handling the short-name case more robustly than this PR's approach (which reused build_report::scrub against the old Who). The one form main's new matcher still misses — a name percent-encoded in a file:// URL (John%20Doe, josé as %C3%A9) — is the focused follow-up #3184, against the new code.
Pull request closed