[vm/io] Reap exit-handler wakeup process - #64053
Conversation
|
Thank you for your contribution! This project uses Gerrit for code reviews. Your pull request has automatically been converted into a code review at: https://dart-review.googlesource.com/c/sdk/+/536480 Please wait for a developer to review your code review at the above link; you can speed up the review if you sign into Gerrit and manually add a reviewer that has recently worked on the relevant code. See CONTRIBUTING.md to learn how to upload changes to Gerrit directly. Additional commits pushed to this PR will update both the PR and the corresponding Gerrit CL. After the review is complete on the CL, your reviewer will merge the CL (automatically closing this PR). |
|
https://dart-review.googlesource.com/c/sdk/+/536480 has been updated with the latest commits from this pull request. |
|
https://dart-review.googlesource.com/c/sdk/+/536480 has been updated with the latest commits from this pull request. |
|
CL has new comments, please view and respond to them in Gerrit. If a reviewer requested changes, push new commits to this PR and it will be automatically copied to Gerrit. After that you can mark reviewer comments as resolved in Gerrit and request another round of reviews. Note: when you add comments in Gerrit they only become visible after you send them by clicking Reply and Send. |
ExitCodeHandler::TerminateExitCodeThread()forks a short-lived child towake the exit-handler thread from
wait(). If that thread observesrunning_ == falsebefore enteringwait(), it exits without reaping thewakeup child. In a container, that child can be adopted by a Dart process
running as PID 1 and remain as a zombie.
Retain the wakeup PID and call
waitpid()after the exit-handler thread hasterminated.
ECHILDis accepted because it means the handler thread alreadyreaped the process. Apply the equivalent change on Linux and macOS.
Add a Linux regression test that:
dart pub global run;exits.
Validation:
invocation using a source-built Dart 3.12.2 SDK.
dart:dartdev_aot <defunct>under container PID 1.iterations without a zombie on Dart 3.12.2 and a source build from
main.process_child_testcould not create its process stream in the localrestricted sandbox and failed independently of this change.
Fixes #61624.
Contribution guidelines:
dart format.Note that this repository uses Gerrit for code reviews. Your pull request will be automatically converted into a Gerrit CL and a link to the CL written into this PR. The review will happen on Gerrit but you can also push additional commits to this PR to update the code review.