On 2021-08-02 11:44:19 +0200, Vincent Lefevre wrote: > If I recompile with -O0, the issue disappears.
Well, I can actually still reproduce the issue with -O0, but not always (ditto with -O1). I've also added a debug line after each "signal(SIGCHLD, ...);" in all the .c files. According to the logs, the only place where a race condition could occur is in the OpenPTY function, where one has sigcld = signal(SIGCHLD, SIG_DFL); and a bit later signal(SIGCHLD, sigcld); but this function shouldn't be involved when the shell in the current screen window is terminated (this is confirmed when the issue doesn't occur, where I can see when the SigChld handler is called). So the SIGCHLD handler is active, as expected; but it is not called. If I send a SIGCHLD to the SCREEN process with "kill -CHLD <pid>", then the log file shows that the SIGCHLD handler is called and the zombies disappear. This could mean that the kernel does not deliver a SIGCHLD to the SCREEN process when the shell process terminates, or this signal is lost. I would say that this is likely to be a bug in the kernel. -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)