Skip to content

test: fix Windows stdout capture with long temporary paths - #552

Open
rwmcguir wants to merge 3 commits into
oneapi-src:masterfrom
rwmcguir:debug/windows-stdout-capture
Open

rwmcguir wants to merge 3 commits into
oneapi-src:masterfrom
rwmcguir:debug/windows-stdout-capture

Conversation

@rwmcguir

@rwmcguir rwmcguir commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix the stdout-capture helper used by tests_multi_driver_stdout and tests_sigle_driver_stdout.

Windows container CI confirmed tmpnam_s returned 34 (ERANGE) with the existing 50-byte filename buffer. Its temporary directory was C:\Users\ContainerAdministrator\AppData\Local\Temp, leaving insufficient room for the generated filename. Previously unchecked errors led to invalid descriptor operations and Windows fail-fast termination (0xc0000409).

Changes

  • Use L_tmpnam_s for the Windows filename buffer; retain the Linux mkstemp template with a compile-time size.
  • Check filename generation, file opening, descriptor duplication/redirection/restoration, and capture-file access/cleanup.
  • Stop the test if capture setup fails rather than passing invalid descriptors onward.
  • Remove investigative stderr diagnostics. Success is silent; actual failures are reported through GoogleTest with relevant error codes.

Validation

  • Diagnostic Windows container CI established the failing operation and ERANGE result.
  • Compiled the exact updated helper with C++14, warnings-as-errors, AddressSanitizer, and UndefinedBehaviorSanitizer on Linux.
  • Verified quiet successful capture/restoration and explicit invalid-descriptor failures.
  • Tested the Windows branch with mocked CRT calls, including filename-generation and file-open failures.
  • Long-temp-path regression: old 50-byte buffer fails, L_tmpnam_s buffer passes; temporary files are cleaned up.
  • Actual Windows execution of the final fix remains pending. Consumer CI already selects this PR head; rerunning those jobs will test the updated fix.

Log temporary path settings and CRT capture operations to stderr, check capture setup and restoration errors, and stop before using invalid file descriptors. Preserve the existing filename buffer for diagnosis.

Signed-off-by: Russell McGuire <russell.w.mcguire@intel.com>
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Level Zero loader ABI check

last-release (v1.35.0): ✅ no ABI problems. Report

Creating compatibility report ...
Binary compatibility: 100%
Source compatibility: 100%
Total binary compatibility problems: 0, warnings: 0
Total source compatibility problems: 0, warnings: 0

master (master): ✅ no ABI problems. Report

Creating compatibility report ...
Binary compatibility: 100%
Source compatibility: 100%
Total binary compatibility problems: 0, warnings: 0
Total source compatibility problems: 0, warnings: 0

Workflow run

If an ABI change is intended, a reviewer with write access can accept it: leave an approval review on the PR head commit with the keyword abi-failure-approved in the review body. That re-runs the check.

Use L_tmpnam_s for the Windows capture filename after container CI confirmed ERANGE with the 50-byte buffer. Keep capture operation checks, remove success-path diagnostics, and report descriptor errors only when operations fail.

Signed-off-by: Russell McGuire <russell.w.mcguire@intel.com>
@rwmcguir rwmcguir changed the title test: diagnose stdout capture failures on Windows test: fix Windows stdout capture with long temporary paths Oct 28, 2026
@rwmcguir
rwmcguir requested a review from nrspruit October 28, 2026 23:48
Signed-off-by: Russell McGuire <russell.w.mcguire@intel.com>
@rwmcguir rwmcguir self-assigned this Oct 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant