Skip to content

Fix spawning without standard handles on Windows - #592

Merged
Guest0x0 merged 1 commit into
moonbitlang:mainfrom
cg-zhou:fix/windows-spawn-without-stdio
Sep 8, 2026
Merged

Fix spawning without standard handles on Windows#592
Guest0x0 merged 1 commit into
moonbitlang:mainfrom
cg-zhou:fix/windows-spawn-without-stdio

Conversation

@cg-zhou

@cg-zhou cg-zhou commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Windows GUI applications may have no standard handles. In that case,
UpdateProcThreadAttribute receives an empty handle list and fails with
ERROR_BAD_LENGTH.

Skip setting PROC_THREAD_ATTRIBUTE_HANDLE_LIST when there are no handles to
inherit, and add a Windows regression test covering spawn_orphan without
standard handles.

Tested with:

  • moon test src/process --target native — 42 passed
  • The regression test reproduces ERROR_BAD_LENGTH before the fix and passes
    after it

@Guest0x0
Guest0x0 force-pushed the fix/windows-spawn-without-stdio branch from 9201082 to 8ba548c Compare September 8, 2026 03:07
@Guest0x0
Guest0x0 merged commit babfe7d into moonbitlang:main Sep 8, 2026
32 of 33 checks passed
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.

2 participants