Skip to content

Treat a missing ps as no running processes - #805

Merged
SimonCropp merged 1 commit into
mainfrom
fix-ps-absent-crashes-init
Aug 22, 2026
Merged

Treat a missing ps as no running processes#805
SimonCropp merged 1 commit into
mainfrom
fix-ps-absent-crashes-init

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

process.Start was unguarded, so a machine without ps raised Win32Exception, and
a non-zero exit threw as well. Both propagate out of ProcessCleanup's static
constructor, which turns them into a TypeInitializationException on every launch
and every kill for the life of the process.

A minimal container without procps is the ordinary way to get there, and one
that does not set DOTNET_RUNNING_IN_CONTAINER gets no help from the disabled
check either. The right answer is the one the timeout path already gives: no
running processes, traced, carry on.

Testable because Windows is a machine with no ps. The code is only used on Linux
and macOS, but nothing about it refuses to run here, and here the executable is
genuinely absent - so the test drives the real failure rather than a simulation
of it. It fails without the guard.

process.Start was unguarded, so a machine without ps raised Win32Exception, and
a non-zero exit threw as well. Both propagate out of ProcessCleanup's static
constructor, which turns them into a TypeInitializationException on every launch
and every kill for the life of the process.

A minimal container without procps is the ordinary way to get there, and one
that does not set DOTNET_RUNNING_IN_CONTAINER gets no help from the disabled
check either. The right answer is the one the timeout path already gives: no
running processes, traced, carry on.

Testable because Windows is a machine with no ps. The code is only used on Linux
and macOS, but nothing about it refuses to run here, and here the executable is
genuinely absent - so the test drives the real failure rather than a simulation
of it. It fails without the guard.
@SimonCropp SimonCropp added this to the 20.0.0 milestone Aug 22, 2026
@SimonCropp
SimonCropp merged commit 001a155 into main Aug 22, 2026
10 checks passed
@SimonCropp
SimonCropp deleted the fix-ps-absent-crashes-init branch August 22, 2026 03:25
This was referenced Aug 26, 2026
This was referenced Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant