fix(relinker): escape ASCII controls in progress filenames #12495
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12495"
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?
Imported from boykopovar/AnyPS5. Originally posted by StoneDC on 2026-10-28T15:54:44Z.
What
Escapes ASCII control bytes 0x00..0x1F and 0x7F in progress basenames as literal \xNN, including when calculating display width; UTF-8 text is retained. Main integration now registers both console_progress and main's guest_load_ranges test targets. The production header and progress fixture are byte-identical to the preceding published head.
Tested
Windows/MinGW GCC 15.2 and Linux GCC 15.2: fresh relinker-only configure, production relinker build and both actual registered CTests console_progress + guest_load_ranges pass, zero skips. A separate build of the unchanged fixture against the real production header with only control escaping disabled fails the intended "Executable name was not escaped literally" assertion. The compile baseline passes; no compile/loader/setup failure is counted.
Published head
dacbfbd9943fd8241167c4f05aa96ef510f8b8a9integrates recorded maindc9dc7eaaeaf99b1c491d426e68bb999def3da16. Whitespace, per-head conventions with this full template, main ancestry, focused test registration and the 234-script registration audit pass. No assertion or timeout was weakened. These are focused relinker/tool checks; no full product, PS5/title, GPU or local macOS run is claimed. Fresh hosted checks remain pending until they complete.Earlier implementation basis and validation (historical revisions)
What
ASCII control bytes in an input basename can inject terminal controls into progress output and distort its width accounting. Escape bytes 0–31 and 127 as literal \xHH in displayed basenames, using the escaped display for both messages and width. Preserve the underlying path, UTF-8 bytes and throttling behavior.
Known limits: Only ASCII control bytes in displayed filenames are escaped. General Message text and Unicode terminal column counting are unchanged. No all-Unicode terminal-safety guarantee is claimed.
Independent change based on main
f3eb573e6fc3. Actual three-way merge of this exact head into the pre-publication mainf8f5b24b77adis clean. The overlap tool reports CMake insertion conflicts with #7173/#7531 and incomplete old-PR comparisons with #5021/#6713/#9793/#10861. Manual scoped diffs show separate ADX, process-parameter, Windows-path or code-scanning registrations, not this console feature. Keep both independent registration blocks; no dependency on those implementations or whole-peer build is claimed. Shared-file comparisons are scoped compatibility checks, not whole external-PR builds.Tested
Windows 11 (MinGW GCC 15.2, Python 3.14.3, Node 24) and Ubuntu 26.04/WSL (GCC 15.2, Python 3.14.4, Node 22): windows: 1 focused CTest groups, 0 failures, 0 skipped; linux: 1 focused CTest groups, 0 failures, 0 skipped.
Built the native relinker and console_progress_tests on both hosts. The actual console unit also passed Linux ASan+UBSan; the new assertion fails against the old header on both hosts.
Commands (configure a Release Ninja build with
-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON; native targets are built where affected):Additional integration check: all 19 independent changes combined with main
17f8dfad513batbbba7fc479a7passed the affected Windows/WSL suites, native relinker build, registration and environment audit. The later observed main changes only an unrelated guest test; each exact PR head also merges cleanly into it. This combined check establishes composition, not a dependency between these PRs.No GPU, PS5 hardware, actual game, macOS runtime or full system-library build is claimed. Hosted CI has not run for this new PR yet. AI assistance was used; the evidence and limitations above were checked locally.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T15:56:15Z.
Review: COMMENTED
I reviewed head
fa6bda9c04eeand ran the focused relinker test from a clean detached worktree on Linux/GCC 12.2: relinker-only CMake configure succeeded,console_progress_testsbuilt, andctest -R ^console_progress$passed (1/1). I also rantools/check_conventions.py --base upstream/mainandtools/check_test_registration.py --scripts; both passed. The implementation escapes ASCII C0 and DEL bytes after extracting the basename and uses the rendered name when calculating the shared display width. The test covers terminal-control sequences, DEL, UTF-8 names, and all byte values in the control range. I found no correctness issue in this focused review. Hosted eligibility, conventions, intake, and labels checks were still queued at my last check, so this comment is not an approval or a claim that hosted CI passed.Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-28T16:17:50Z.
Review: APPROVED
First macOS run (the body has Windows + WSL only). Head
fa6bda9c04, macOS 26.2 arm64, Apple clang, Release relinker-only lane.ctest392/392,console_progressincluded (0.00 s).check_conventions --base upstream/mainclean.ConsoleProgress.hppfails withExecutable name was not escaped literally. Head passes, also under-fsanitize=address,undefined.== 0x7f< 0x1fIncludeFile)>= 0x7f(the UTF-8 width assertion catches this)git merge-treeagainst current main6793a72475is clean.pr_overlapgives the same results the body lists: CMakeLists insertion points shared with #7173/#7531 and uncomparable #5021/#6713/#9793/#10861. None of them touchConsoleProgress.Messagewith a filename is the basename inConverting …, and that path is escaped now. The otherMessagecallers inConversion.cppprint internal or relative names, which is outside this PR. Non-blocking: on POSIX, a file whose name literally contains\x1Bdisplays the same as an escaped ESC. That's cosmetic. Backslash can't appear in the basename on Windows because it's a separator there.AI-assisted review; every number above was reproduced locally.