Skip to content

HandleHelper: WaitForExit without timeout — caller blocks indefinitely if handle.exe hangs #251

@Christophe-Rogiers

Description

@Christophe-Rogiers

Description

HandleHelper.cs lines 61–62 call ReadToEnd() and WaitForExit() without a timeout on the handle.exe process.

Code

string output = process.StandardOutput.ReadToEnd();
process.WaitForExit();  // infinite wait

Scenario

handle.exe hangs due to antivirus interference, NAS delay, or a locked file system → the calling method blocks forever.

Suggested Fix

if (!process.WaitForExit(5000))
{
    process.Kill();
    throw new TimeoutException("handle.exe did not respond within 5 seconds");
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions