Conversation
The SIGCHLD handler reaps every child with waitpid(-1) and queues the statuses. That breaks any other party managing children in the same process: HPC-GAP's signal thread (issue #5), and programs embedding GAP such as julia, whose libuv reaps its subprocesses per pid and hangs forever once io has stolen a status (GAP.jl#902). In those two settings install no handler; instead keep a registry of the children created by IO_fork and wait for them with waitpid(pid), on demand. IO_IgnorePid marks a registered child to be reaped whenever io next deals with children, and IO_WaitPid(-1, ...) polls the registry. Standalone GAP keeps the handler and the FIFO unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
fingolfin
commented
Sep 8, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
|
So I'm happy with this. I remember (but I've forgotten the details!) that how io an gap core handle children was a bit of a mess, and it's hard to pick apart, but there are tests which should catch obvious breakage (like never cleaning up any children) |
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.
The SIGCHLD handler reaps every child with waitpid(-1) and queues the statuses. That breaks any other party managing children in the same process: HPC-GAP's signal thread (issue #5), and programs embedding GAP such as julia, whose libuv reaps its subprocesses per pid and hangs forever once io has stolen a status (GAP.jl#902).
In those two settings install no handler; instead keep a registry of the children created by IO_fork and wait for them with waitpid(pid), on demand. IO_IgnorePid marks a registered child to be reaped whenever io next deals with children, and IO_WaitPid(-1, ...) polls the registry. Standalone GAP keeps the handler and the FIFO unchanged.
Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com
CC @lgoettgens
Progress towards issue #5 (I am not sure when exactly we can declare that one to be resolved)