-
Notifications
You must be signed in to change notification settings - Fork 380
Description
Summary
Several process execution call sites in Microsoft.DotNet.SignTool use Process.WaitForExit() without a timeout, which can block indefinitely if the child process hangs. This could cause signing builds to hang with no diagnostics.
Affected Locations:
All in src/Microsoft.DotNet.SignTool/src/:
| File | Method | What it runs |
|---|---|---|
ZipData.cs |
RunPkgProcess |
dotnet exec for pkg tool |
ZipData.cs |
RunTarProcess |
dotnet exec for tar tool (.NET Framework) |
ZipData.cs |
RunExternalProcess |
bash for cpio/RPM operations |
BatchSignUtil.cs |
RunWixTool |
cmd /c for WiX tools |
Note: RealSignTool.RunMSBuild already handles this correctly using a configurable _dotnetTimeout with process.Kill() on timeout.
Suggested Approach
Consider consolidating process execution into a shared utility with:
- Configurable timeout (with a sensible default)
- Kill + wait on timeout
- Consistent logging of command, stdout, stderr, and exit code
- Consistent error reporting
The existing Microsoft.Arcade.Common.Command / ICommand utility could be extended with timeout support (it also calls WaitForExit() without a timeout today), or the proven pattern from RealSignTool.RunMSBuild could be extracted into a reusable helper.