Skip to content

[Robustness] HandleHelper.cs — StandardError redirected but never read, deadlock risk #475

@Christophe-Rogiers

Description

@Christophe-Rogiers

Severity: Warning

File: src/Servy.Core/Helpers/HandleHelper.cs, line 82

Description:
StandardError is redirected (RedirectStandardError = true) but never read:

string output = process.StandardOutput.ReadToEnd();
if (!process.WaitForExit(5000))

If handle.exe writes a large error block, the stderr pipe buffer fills (default 4KB), the process deadlocks waiting for the buffer to drain, the 5-second timeout fires, and the process is killed — producing no useful output or error message.

Suggested fix:
Either read stderr concurrently (via BeginErrorReadLine or Task.Run(() => process.StandardError.ReadToEnd())), or do not redirect stderr if it is not used.

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