Repository navigation
[release/11.0] Fix macOS Process hangs caused by stopped children - #135409
Merged
Merged
Conversation
Fixes #135294. On macOS, `waitid(WEXITED | WNOHANG | WNOWAIT)` can report a stopped child even though `waitpid(WNOHANG)` cannot reap it. The SIGCHLD handler repeatedly observes the same child while holding shared process-management locks, blocking other Process operations. Fall back to scanning all tracked children when the reported child cannot be reaped, rather than continuing the no-progress loop. This guard lives in the shared Unix implementation; successful reaping retains the existing fast path, and the scan reuses the existing nonblocking fallback for unknown children. - Add isolated regression coverage for synchronous and asynchronous exit waits while another child is stopped. - Restore class-level parallelism for Process tests on macOS by removing the temporary serialization safeguard. - Preserve the existing RemoteExecutor isolation changes and timeouts. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-diagnostics-process |
adamsitnik
approved these changes
Oct 8, 2026
adamsitnik
left a comment
Member
There was a problem hiding this comment.
LGTM, I've filled the template and I am going to send the Tactics email as well.
This was referenced Oct 8, 2026
Member
|
/ba-g unrelated networking test failure |
steveisok
approved these changes
Oct 13, 2026
Member
meziantou
added a commit
to meziantou/Meziantou.Framework
that referenced
this pull request
Oct 14, 2026
* Update to .NET 11 RC2 Move global.json to the 11.0.100-rc.2.26504.105 SDK and every Microsoft.AspNetCore.*, Microsoft.Extensions.Http, System.IO.Hashing and Microsoft.NETCore.App.Ref reference to the matching 11.0.0-rc.2.26504.105 runtime build, replacing RC1 throughout, including the version TargetFrameworkHelper hands to the analyzer test harnesses. The C# compiler of this SDK overflows its stack under the updated memory safety rules when a union lists itself as a nullable case (dotnet/roslyn#85762, fixed in main but not in RC2). YamlCSharpUnionTests.RecursiveUnion is such a union, so the net11.0 leg of Meziantou.Framework.Yaml.Tests opts out of the rules until a fixed compiler ships. Unions are only compiled for net11.0, so net10.0 keeps the rules, and no test is disabled. The RC2 Razor compiler declares BuildRenderTree after the members of the code block, which reorders the members in the generated public API files of the two Blazor component libraries. The API itself is unchanged. Process.Kill(entireProcessTree: true) still hangs on macOS with RC2 when another child process exits meanwhile (dotnet/runtime#131944; the backport dotnet/runtime#135409 is not merged), so the Imaging interop test of that cancellation stays out of parallel runs and its comment now names RC2. * Disable the optimized Native AOT publish of the .NET 11 RC2 SDK Since RC2, publishing a Native AOT project compiles it without running the full build. The XML documentation file therefore stays in obj, while the publish still copies it from the output directory, and a publish from a clean checkout fails with MSB3030 (dotnet/sdk#56618). It failed every test_aot job; a local publish only succeeded because an earlier build of the solution had left the file in place. UseOptimizedPublish=false, the workaround given in the issue, restores the RC1 behavior. It is set for the whole repository so that there is a single line to remove once the SDK is fixed. * Regenerate the LogViewer public API file with the sorting generator from main The merge kept this branch's RC2 member order in the file, which the PublicApiGenerator of main (#3341) no longer produces: it sorts members, so the file is identical to main again. * Reference a patched System.Security.Cryptography.Pkcs GHSA-846f-f764-76mx and GHSA-2fmv-rv2c-59x7 (.NET denial of service, published 2026-10-13) cover System.Security.Cryptography.Pkcs up to 8.0.1, 9.0.20 and 10.0.12. NuGet.Packaging 7.9.0 (through NuGetPackageValidation and DependencyScanning.Tool), Microsoft.CodeAnalysis.Analyzer.Testing 1.1.4 and Microsoft.Data.SqlClient 7.1.1 still depend on vulnerable versions, so the NuGet audit fails the restore of 11 projects. Each project that references one of them now also references the patched 10.0.13, which flows to the projects that reference it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Backport of #135323 and #135624 to release/11.0
/cc @adamsitnik @steveisok
Customer Impact
Initially reported by the SDK (#131944), but other customers have experienced it as well (#131944 (comment)).
When user calls
Process.Kill(entireProcessTree: true)on macOS, the application can hang.Regression
The changes we have made in #128598 have surfaced a macOS bug we were not aware of.
It's a bug in the OS itself that other frameworks need to workaround as well (python/cpython#158962).
Full details are explained here and here.
Testing
Failing test was added and it's now passing.
Risk
Low. When we can't reap given process (because it was stopped, not killed) we fall back to checking individual processes rather than keep trying forever.
fixes #131944