Skip to content

Fix Windows process waiting and avoid slab allocator shutdown deadlock - #1348

Draft
Weiteng Chen (CvvT) wants to merge 5 commits into
uliteboxfrom
fix/windows-shim-process-wait
Draft

Fix Windows process waiting and avoid slab allocator shutdown deadlock#1348
Weiteng Chen (CvvT) wants to merge 5 commits into
uliteboxfrom
fix/windows-shim-process-wait

Conversation

@CvvT

@CvvT Weiteng Chen (CvvT) commented Sep 11, 2026

Copy link
Copy Markdown
Contributor
  • Implement Process::wait() using the Linux shim’s thread-count wait/wake pattern.
  • Remove the Windows platform’s custom global allocator (which uses a single lock) so Rust heap allocations use the default allocator.

Follow the Linux shim's thread-count wait/wake pattern, close thread creation on the last detach, and synchronize the process exit status under the thread registry lock.

This waits for guest completion only. Host-thread and broker-worker shutdown remain separate work: shim-only run_multithreaded_pe stress reproduced the ExitProcess allocator deadlock on repetition six.
Remove the platform's global SafeZoneAllocator declaration so Rust heap allocations use the default allocator. Leave guest page management and the MemoryProvider implementation unchanged.

Avoid the slab spinlock involved in the observed ExitProcess TLS-cleanup deadlock. The rebuilt run_multithreaded_pe test and 50 sequential no-retry stress repetitions passed. Detached-worker shutdown remains a separate lifecycle concern.
@github-actions

Copy link
Copy Markdown

🤖 SemverChecks 🤖 No breaking API changes detected

Note: this does not mean API is unchanged, or even that there are no breaking changes; simply, none of the detections triggered.

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