[Libguestfs] [collectd] collectd leaks SIGCHLD == SIG_IGN into plugins

Richard W.M. Jones rjones at redhat.com
Tue Nov 13 11:25:06 UTC 2018


On Tue, Nov 13, 2018 at 12:07:23PM +0100, Florian Forster wrote:
> A quick glance shows that the exec plugin actually is clearing the signal mask:
> https://github.com/collectd/collectd/blob/master/src/exec.c#L526

The problem is the SIGCHLD handler being set to SIG_IGN, which is
different from the signal mask.

> Can you give some more context when this problem comes up? Ideally
> in a Github issue (hint, hint ;).

I'd like Peter to file a github issue because he knows the version
that he is using.

However in general terms a trivial plugin which just does:

  #include <guestfs.h>
  ...
  guestfs_h *g;
  if ((g = guestfs_create ()) == NULL || guestfs_launch (g) == -1)
    exit (1);

should be sufficient to demonstrate the problem.  (Work around it by
adding ‘signal (SIGCHLD, SIG_DFL);’ to the plugin code.)

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v




More information about the Libguestfs mailing list