Skip to content

Fix ProcessContainer packaged-app diagnostics after process exit - #1785

Open
mapleluvr (mapleluvr) wants to merge 1 commit into
microsoft:mainfrom
mapleluvr:fix/msix-nonzero-exit-diagnostic
Open

mapleluvr (mapleluvr) wants to merge 1 commit into
microsoft:mainfrom
mapleluvr:fix/msix-nonzero-exit-diagnostic

Conversation

@mapleluvr

@mapleluvr mapleluvr (mapleluvr) commented Nov 16, 2026 •

Copy link
Copy Markdown

📖 Description

The ProcessContainer CLI diagnoses a nonzero exit after it has already started and waited for the child. The shared executable heuristic currently treats any WindowsApps path as a launch failure, so a completed workload gets an incorrect packaged-app message and backend_error.

Limit that path-only heuristic to process-creation failures. Ordinary nonzero exits receive no launch diagnosis; a recognized STATUS_DLL_INIT_FAILED exit still receives its exit-specific diagnosis, including for a WindowsApps path. No process execution, containment policy, schema or public API changes are needed.

Based on v1.1.0 (c66201839d63cae2239db5e92f1f1d6076cf5181). This is a diagnostic bug fix, not a new MSIX activation capability, so no design/API spec is required.

Regression coverage replaces the old test that expected the incorrect diagnosis and adds a real CLI scenario to the scheduled native policy suite. The portable scenario copies inbox Windows PowerShell into a temporary WindowsApps directory; it exercises the real PSEC execution path without requiring Store provisioning. -PackagedPowerShell also permits a local check with an installed MSIX PowerShell executable.

🔗 References

Fixes #1784.

🔍 Validation

Windows x64, native PSEC host (build 26200), Rust 1.93.0:

  • Before the production edit: diagnostic unit tests had 25 passes and the two intended failures. The native CLI regression passed its zero-exit control and failed on additional stderr after exit 7, with the expected exit, stdout and host file already observed.
  • After the edit: 27 diagnostic tests and 11 shared runner tests pass.
  • cargo fmt --all -- --check passes.
  • cargo clippy --locked --offline --target x86_64-pc-windows-msvc --jobs 2 --workspace --all-targets -- -D warnings passes.
  • test_native_policy_results.ps1 passes; both changed PowerShell scripts have clean active language-server checks.
  • Both debug and release CLIs pass all four functional cases: zero/seven exits using both the temporary path fixture and actual MSIX PowerShell 7.7.0, checking exit code, separate stdout/stderr, a host-observed file and native execution diagnostics.
  • The issue's independent reproduction also confirms: the official 1.1.0 CLI still misdiagnoses exit 7 with MSIX PowerShell 7.7.0; both local patched profiles preserve both exits and outputs without the additional error. Its temporary fixtures are removed.
  • cargo build --locked --offline --release --target x86_64-pc-windows-msvc --jobs 2 -p wxc passes. This is a locally built 1.1.0-based fix, not an official released SDK.

Not run locally: cross-platform/ARM64 builds, optional-backend suites, the complete SDK suite or the complete native UI/policy suite. The new focused case is wired into the existing scheduled ProcessContainer policy runner; a unit result alone is not being used as backend validation. The build emits the existing prerequisite warning for an unpackaged PowerShell 7 installation, which is absent on this host; the tested shells above are selected explicitly.

✅ Checklist

  • Signed the Contributor License Agreement (left to the contributor/CLA check)
  • Linked to an issue
  • For features or changes requiring a spec: linked the issue with maintainer-applied feature-accepted (not applicable: diagnostic bug fix)
  • For implementation: linked the required approved and merged design/API spec, or explained why no spec is required
  • Feature issue remains open unless this PR completes all agreed implementation, validation, and documentation (not applicable: bug)
  • Updated documentation (test runner reference and CI runbook)
  • Updated Copilot instructions (not applicable: no build, architecture or convention change)
  • If this PR changes Cargo.lock, the dependency-feed-check check passes (not applicable: lockfile unchanged)

📋 Issue Type

  • Bug fix
  • Feature
  • Task
Microsoft Reviewers: Open in CodeFlow

Copilot AI balanced review requested due to automatic review settings November 16, 2026 05:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the diagnostic-only change that avoids misreporting ordinary nonzero workload exits as packaged-app launch failures.

No open issues 🎉

What changed in this PR

Fixes #1784 by preventing the ProcessContainer CLI from reporting a packaged-app launch failure after a workload has completed with an ordinary nonzero exit. The change is limited to diagnostics; execution, containment policy, schemas, and public APIs remain unchanged.

Changes:

  • Restricts the WindowsApps path heuristic to process-creation failures while preserving recognized DLL-initialization exit diagnostics.
  • Adds unit regressions and a real CLI regression to scheduled native policy validation, with an optional installed-MSIX PowerShell check.
  • Documents the new regression runner and its CI coverage.
File Description
tests/​scripts/​run_processcontainer_policy_tests.ps1 Invokes the diagnostic regression and propagates failures.
tests/​scripts/​run_processcontainer_launch_diagnostics_test.ps1 Checks zero/nonzero exits, separate output streams, host file creation, and native execution.
tests/​scripts/​README.md Documents the runner and its prerequisites.
src/​mxc-sdk/​src/​backends/​process_container/​common/​launch_diagnostics.rs Limits the path heuristic to creation failures and updates regression tests.
docs/​development/​build-and-test/​ci-validation-infrastructure.md Describes scheduled diagnostic coverage and the optional MSIX check.

Review effort: Balanced

@mapleluvr
mapleluvr (mapleluvr) marked this pull request as ready for review November 16, 2026 05:45
@mapleluvr
mapleluvr (mapleluvr) requested a review from a team as a code owner November 16, 2026 05:45
@mapleluvr

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

ProcessContainer: false packaged-app launch error after MSIX PowerShell exits nonzero

2 participants