in reply to waitpid(-1, WNOHANG) is hanging
Everything happens so quickly, you spawn all 3 processes by the time you are calling the handler to reap the first one, so the handler reaps all 3. Or close enough. It seems one of the later processes also triggers the handler, but it's already been reaped from the first call.
All wrong nevermind.