Skip to content

Execution should store the HANDLE internally on Windows, not just the numeric PID #92

Closed
@jakepetroules

Description

@jakepetroules

Unlike Unix, Windows doesn't have a "zombie" state where the pid remains valid in a zombie state after the subprocess has exited. The numeric process ID becomes invalid immediately once the process has exited.

On Windows, instead of closing/discarding the process HANDLE immediately after CreateProcess returns, it should be retained in Execution and only closed once monitorProcessTermination returns. Otherwise, the period between which the original HANDLE returned from CreateProcessW is closed and OpenProcess is subsequently called to regain the handle from the system using the numeric pid is subject to race conditions.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions