Skip to content

winio: Fix infinite block when creating process

Tamar Christina requested to merge Phyx/ghc:wip/winio-infinite-lock into master

This fixes #21610 (closed)

When creating the handles for the new child process we marked both the read and write end of the handle with FILE_FLAG_OVERLAPPED.

This is wrong as this indicates that the child will also use overlapped I/O to perform operations on the handle.

If the application is not IOCP aware then the call will finish synchronously and we don't see any difference. However if the child application itself uses IOCP the overlapped flag gets it to make the request asynchronously.

But it has no way of knowing this, as such the operation isn't associated to the proper IOCP handler. Consequently the operation never completes as there is no manager associated with the handle.

This process update only marks the non-inheritable handles as IOCP aware.

We also now set the local locale for pipes so that newline normalization matches what mio did.

Edited by Tamar Christina

Merge request reports