sanitizer_report leaks a traceback when --summary cannot be written #12072

Closed
opened 2026-10-27 18:48:06 +00:00 by malekaifa · 0 comments
malekaifa commented 2026-10-27 18:48:06 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by malekaifa on 2026-10-27T18:48:06Z.


What happens

tools/sanitizer_report.py parses and summarizes the JUnit report inside its controlled OSError/XML/value-error boundary, but the optional --summary append happens afterward.

On current main, a valid passing JUnit report with --summary pointing into a nonexistent directory does this:

  • prints a complete successful-looking sanitizer report to stdout;
  • then raises an unhandled FileNotFoundError traceback while opening the summary destination;
  • exits nonzero through the Python exception rather than the tool's controlled error path.

Expected

Summary publication failures should be treated like the tool's other I/O failures: return code 2, a sanitizer_report: diagnostic on stderr, no traceback, and no successful-looking report emitted to stdout when the requested summary publication failed.

Proposed fix

Append --summary inside the existing controlled error block before writing the report to stdout. Add a regression using a missing summary parent directory that asserts return code 2, empty stdout, diagnostic stderr, and no traceback.

Current candidate is one Python-tool commit on current main; focused tests pass 22/22 on Windows Python 3.12, Windows Python 3.9, and WSL Python 3.12. Conventions, diff-check, and compileall pass.

Full open-PR exact-file scan performed during discovery covered 1,358 open PRs and found none touching tools/sanitizer_report.py or tools/tests/test_sanitizer_report.py. Fresh behavior searches also find no matching open PR or issue.

I can take this. Candidate branch: malekaifa/AnyPS5:fix/sanitizer-summary-write.

AI-assisted: yes (OpenAI Codex).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6065612102 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/12072). Originally posted by [malekaifa](https://github.com/malekaifa) on 2026-10-27T18:48:06Z. --- ### What happens `tools/sanitizer_report.py` parses and summarizes the JUnit report inside its controlled `OSError`/XML/value-error boundary, but the optional `--summary` append happens afterward. On current `main`, a valid passing JUnit report with `--summary` pointing into a nonexistent directory does this: - prints a complete successful-looking sanitizer report to stdout; - then raises an unhandled `FileNotFoundError` traceback while opening the summary destination; - exits nonzero through the Python exception rather than the tool's controlled error path. ### Expected Summary publication failures should be treated like the tool's other I/O failures: return code 2, a `sanitizer_report:` diagnostic on stderr, no traceback, and no successful-looking report emitted to stdout when the requested summary publication failed. ### Proposed fix Append `--summary` inside the existing controlled error block before writing the report to stdout. Add a regression using a missing summary parent directory that asserts return code 2, empty stdout, diagnostic stderr, and no traceback. Current candidate is one Python-tool commit on current `main`; focused tests pass 22/22 on Windows Python 3.12, Windows Python 3.9, and WSL Python 3.12. Conventions, diff-check, and compileall pass. Full open-PR exact-file scan performed during discovery covered 1,358 open PRs and found none touching `tools/sanitizer_report.py` or `tools/tests/test_sanitizer_report.py`. Fresh behavior searches also find no matching open PR or issue. I can take this. Candidate branch: `malekaifa/AnyPS5:fix/sanitizer-summary-write`. AI-assisted: yes (OpenAI Codex).
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#12072
No description provided.