From: Eric Wong Date: 2017-12-14T07:10:23+00:00 Subject: [ruby-core:84256] Re: [Ruby trunk Bug#14181] hangs or deadlocks from waitpid, threads, and trapping SIGCHLD Thanks. It seems the culprit is Timeout using Thread#join. Our deadlock checking code might be buggy... I write similar process management code all the time without Timeout and never have this problem, so I'll investigate (but no promises, it's tricky code) Fwiw, I use waitpid(..., WNOHANG) in a loop until ECHLD, and use select/IO#wait_*able + self-pipe to timeout). Looping (with WNOHANG) is important, since SIGCHLD interrupts can be merged. Unsubscribe: