fix(tools): report sanitizer summary write failures #12096
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12096"
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 malekaifa on 2026-10-27T20:24:30Z.
What
tools/sanitizer_report.pycurrently prints a successful report to stdout before attempting to append the same report to--summary. If the summary path cannot be written, the write escapes the controlled error boundary as an unhandled traceback after success-looking stdout has already been emitted.Move the optional summary append into the existing controlled
OSError/ XML / value-error boundary and perform it before stdout publication. A summary-write failure now returns 2, writes no successful report to stdout, and reports the filesystem error on stderr without a traceback.Tested
--summarypath with a missing parent exits 1 after emitting success-looking stdout, then leaksFileNotFoundErrortraceback.py -3 -m unittest tools.tests.test_sanitizer_report- 22/22 passed.py -3.9 -m unittest tools.tests.test_sanitizer_report- 22/22 passed.python3 -m unittest tools.tests.test_sanitizer_report- 22/22 passed.OSError, malformed XML/known-file precedence, successful append, and no-summary behavior.py -3 tools/check_conventions.py --base origin/main- passed.git diff --check origin/main...HEAD- passed.python -m compileallon both changed files - passed.f25c397e16b8f4ef891f778d021deb373ad8d6cd: GPT-6 High metadata/rebase-equivalence confirmation PASS, no P0/P1/P2; parent/tree/blob/patch identity verified.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 copilot-pull-request-reviewer[bot] on 2026-10-27T20:26:04Z.
Review: COMMENTED
🟢 Approval recommended
No active review issues block approval of the summary-file error-handling change.
No open issues 🎉
What changed in this PR
Fixes #12072 by handling optional summary-file write failures through the sanitizer reporting tool’s existing controlled error path, before emitting a report to stdout.
Changes:
tools/tests/test_sanitizer_report.pytools/sanitizer_report.pyReview effort: Balanced
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T20:38:40Z.
Review: APPROVED
Reviewed exact head 8623056345b746a080a689cc41a00b073906d9a6 and independently ran from that exact tree: 22/22 passed. The summary append now shares the existing OSError handling boundary and occurs before stdout publication, so an append failure returns 2 without a success-looking report. The regression test verifies the missing-parent case, empty stdout, diagnostic prefix, and no traceback. The exact head merges cleanly with current upstream/main. Ubuntu and Windows relinker checks plus relinker-asan passed; the two macOS jobs were still queued at review time, while the platform-specific library build jobs were skipped. I found no blocking issue in the diff.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T20:38:44Z.
Review: APPROVED
Reviewed exact head 8623056345b746a080a689cc41a00b073906d9a6 and independently ran python3 tools/tests/test_sanitizer_report.py from that exact tree: 22/22 passed. The summary append now shares the existing OSError handling boundary and occurs before stdout publication, so an append failure returns 2 without a success-looking report. The regression test verifies the missing-parent case, empty stdout, diagnostic prefix, and no traceback. The exact head merges cleanly with current upstream/main. Ubuntu and Windows relinker checks plus relinker-asan passed; the two macOS jobs were still queued at review time, while the platform-specific library build jobs were skipped. I found no blocking issue in the diff.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T20:53:41Z.
Review: APPROVED
Re-reviewed exact head
f25c397e16b8f4ef891f778d021deb373ad8d6cd. The parent changed in the rebase, but I compared the stable patch IDs against the previously reviewed head and they are identical. I reranpython3 tools/tests/test_sanitizer_report.pyfrom this exact tree: 22/22 passed.git diff --checkand the merge-tree preview against currentmainare clean. The existing behavior is still correct: write the optional summary before publishing success on stdout, and route write failures through the controlled error path. Hosted conventions and policy checks pass; remaining macOS relinker jobs are queued and do not execute this Python tool. Approved on this exact head.Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-28T04:26:35Z.
Review: APPROVED
Reviewed
f25c397e16b8f4ef891f778d021deb373ad8d6cd— approve. Summary-file open/write failures are caught before a success summary is printed to stdout.Windows/Python 3.11: head 22 passed (22 total); author base 21 passed (21 total). Three injected summary failures escape old production and follow the exit-2 diagnostic path on head. Existing sanitizer pass/fail accounting is retained. No sanitizer-instrumented product execution was performed locally.
The inspected hosted Windows relinker job merged this exact head and completed successfully. This is not a full product or game build.