0

I am using the signalfd() function in non-blocking mode and the close on exec() feature also turned on:

sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGCHLD);

f_socket = signalfd(-1, &set, SFD_NONBLOCK | SFD_CLOEXEC);

Then I listen for signals using the poll() command.

Is it at all possible, when using that mechanism, to miss a SIGCHLD signal?

I have a server that has been running for nearly 3 weeks and it has one zombie. The only way I can think of for such to happen is that a child process died and somehow the parent did not receive the signal. Each time I access the server, it generally creates many children (the minimum is around 10 and I think the maximum is around 30) all of which get caught. So I am not too sure why just one would somehow disappear.

Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156
  • 4
    You may have an issue with multiple children exiting virtually simultaneously. Take a look at: http://stackoverflow.com/questions/8398298/handling-sigchld – TonyB Jun 26 '16 at 06:40
  • 1
    @TonyB: You are correct. This most likely is the same issue. I just added a comment to one of the answer to the question you linked which points to the relevant part of the Linux documentation: http://stackoverflow.com/questions/8398298/handling-sigchld#comment63516377_8398491 – alk Jun 26 '16 at 12:06
  • @TonyB, you are absolutely correct. This is a duplicate of that other question. The person mentions the exact same problem/concern. – Alexis Wilke Jun 26 '16 at 15:29
  • @alk, I actually added your links in that answer. Easier to find! Also feel free to mark my question as a duplicate. – Alexis Wilke Jun 26 '16 at 16:20

0 Answers0