<div dir="ltr">Here are strace outputs per process.<div><br></div><div>strace_output.22076 is the plugin's pid. (A little before forking)</div><div>strace_output.22077  runs qemu-img</div><div>strace_output.22078 is a mystery to me</div><div>strace_output.22079 is <font face="monospace, monospace">rm -rf</font> to the overlay image and its temporary dir.</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Best Regards,<br>Peter</div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 7, 2018 at 4:38 PM Richard W.M. Jones <<a href="mailto:rjones@redhat.com">rjones@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Nov 07, 2018 at 01:37:03PM +0200, Peter Dimitrov wrote:<br>
> > That makes no sense because we are supposed to have just forked<br>
> successfully<br>
> <br>
> I just realized libguestfs uses fork. Now we know why qemu-img worked - I<br>
> launched it with popen.<br>
> <br>
> > So it must be something to do with collectd and how it runs programs.<br>
> > Is it using LD_PRELOAD trickery, or replacing libc, or using seccomp?<br>
> <br>
> If I understand the question correctly - it's about how collectd loads its<br>
> plugins? If so it uses:<br>
> <br>
> static int plugin_load_file(const char *file, _Bool global) {<br>
>   void (*reg_handle)(void);<br>
>   int flags = RTLD_NOW;<br>
>     if (global)<br>
>       flags |= RTLD_GLOBAL;<br>
>   void *dlh = *dlopen*(file, flags);<br>
>   //...<br>
>   reg_handle = (void (*)(void))*dlsym*(dlh, "module_register");<br>
>   //...<br>
>   *(*reg_handle)();*<br>
> }<br>
> <br>
> <br>
> Does this give any clues?<br>
<br>
Can you strace the collectd process around the point where qemu-img is<br>
run?  It may gives some clues.<br>
<br>
Rich.<br>
<br>
-- <br>
Richard Jones, Virtualization Group, Red Hat <a href="http://people.redhat.com/~rjones" rel="noreferrer" target="_blank">http://people.redhat.com/~rjones</a><br>
Read my programming and virtualization blog: <a href="http://rwmj.wordpress.com" rel="noreferrer" target="_blank">http://rwmj.wordpress.com</a><br>
libguestfs lets you edit virtual machines.  Supports shell scripting,<br>
bindings from many languages.  <a href="http://libguestfs.org" rel="noreferrer" target="_blank">http://libguestfs.org</a><br>
</blockquote></div>