Allow disabling of GAP's SIGCHLD handler #3380
Labels
kind: enhancement
Label for issues suggesting enhancements; and for pull requests implementing enhancements
topic: kernel
topic: libgap
things related to libgap
Projects
Per discussion toward the end of #3072, for the sake of embedding libgap in other systems, it should be possible for the
SIGCHLD
handler installed by GAP to be disabled, probably by setting the same flag that was added in #3072.The current implementation of the
SIGCHLD
handling is problematic (seeChildStatusChanged
, because it callswaitpid(-1, ...)
for any zombie child processes that might still be hanging around un-waited-upon. This is done because historically, some GAP code that launched child processes was less consistent about keeping track of their PIDs, and properlywait()
-ing on just those PIDs. Hence a blanketwaitpid(-1)
sweep to clean up any child processes that might be hanging around.The problem with this from an embedding perspective is that programs which embed libgap may run and manage their own subprocesses which have nothing to do with those started by GAP code, and having GAP call
wait()
on those processes could interfere with their management by the code that started them.We should make sure there are no more areas in the core GAP kernel or libraries that leave around zombie child processes. If there are any packages that somehow do this, responsibility of fixing the issue should be pushed on to that package.
Then the only question is whether the
handleSignals
flag should disable GAP'sSIGCHLD
handling completely. And if so, as GAP does still (IMO legitimately) useSIGCHLD
handle the completion of processes it is tracking, it should be documented how software which embeds libgap can/should integrate eitherChildStatusChanged
orCheckChildStatusChanged
into its ownSIGCHLD
handling.The text was updated successfully, but these errors were encountered: