Blocking and fork problem with signalfd

Marc Lehmann schmorp at schmorp.de
Fri Aug 28 09:51:15 CEST 2009


On Wed, Aug 26, 2009 at 04:43:59PM +0200, Julien Danjou <julien at danjou.info> wrote:
> You'll tell me, you just have to unblock the signal between fork() and exec().
> That's we do currently, but we are using other libraries that have their
> own fork/exec routines that we cannot change, and we just cannot fix the
> problem everywhere.

(Sorry if I answer this twice if you are the same person as on IRC).

> Is there any workaround we may have missed?

Disabling signalfd will disable this behaviour, but libev has temporarily
blocked signals in all versions and will do so even when signalfd is not
in use, so the problem then is just less obvious (when not using threads,
this works, though - the current CVS docs explain this in slightly more
detail).

The right solution would probbaly then be an atfork handler to reset the
mask in the child.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      pcg at goof.com
      -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list