<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.6.6">
</HEAD>
<BODY>
Hello Michal,<BR>
<BR>
I am using libvirt 1.1.3 and perl-Sys-Virt 1.1.3 and perl-5.16 on Fedora 19 x86_64<BR>
<BR>
The zombie process appears after open libvirt connection with qemu-tls, and perl module is binding for libvirt library XS.<BR>
<BR>
Here is my running example with zombie process:<BR>
<BR>
<PRE>
<FONT SIZE="2">$ perl test-chldhandle-bug-fixed.pl & sleep 15 && echo && ps axf | grep perl && echo</FONT>
<FONT SIZE="2">[2] 12427</FONT>
<FONT SIZE="2">init... pid=12427</FONT>
<FONT SIZE="2">while...</FONT>
<FONT SIZE="2">fork 1</FONT>
<FONT SIZE="2">end... pid=12430</FONT>
<FONT SIZE="2">receive chld</FONT>
<FONT SIZE="2">fork 2</FONT>
<FONT SIZE="2">end... pid=12431</FONT>
<FONT SIZE="2">receive chld</FONT>
<FONT SIZE="2">2014-03-19 11:06:38.712+0000: 12427: info : libvirt version: 1.1.3.1, package: 2.fc19 (Unknown, 2014-03-17-15:02:00, cmar-laptop.lan)</FONT>
<FONT SIZE="2">2014-03-19 11:06:38.712+0000: 12427: warning : virNetTLSContextCheckCertificate:1140 : Certificate check failed Certificate [session] owner does not match the hostname 10.10.4.249</FONT>
<FONT SIZE="2">connection open</FONT>
<FONT SIZE="2">fork 3</FONT>
<FONT SIZE="2">end... pid=12432</FONT>
<FONT SIZE="2">fork 4</FONT>
<FONT SIZE="2">end... pid=12440</FONT>

<FONT SIZE="2">12427 pts/2    S      0:00  |   \_ perl test-chldhandle-bug-fixed.pl</FONT>
<FONT SIZE="2">12432 pts/2    Z      0:00  |   |   \_ [perl] <defunct></FONT>
<FONT SIZE="2">12440 pts/2    Z      0:00  |   |   \_ [perl] <defunct></FONT>
<FONT SIZE="2">12442 pts/2    S+     0:00  |   \_ grep --color=auto perl</FONT>

</PRE>
<BR>
Regards,<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
-- 
Carlos Rodrigues 

Engenheiro de Software Sénior

Eurotux Informática, S.A. | www.eurotux.com

(t) +351 253 680 300 (m) +351 911 926 110
</PRE>
<BR>
<BR>
</TD>
</TR>
</TABLE>
On Seg, 2014-03-17 at 13:37 +0100, Michal Privoznik wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
On 17.03.2014 12:13, Carlos Rodrigues wrote:
<FONT COLOR="#737373">> Hell Michal,</FONT>
<FONT COLOR="#737373">></FONT>
<FONT COLOR="#737373">> Thank you for your answer, but this doesn't fix my problem.</FONT>
<FONT COLOR="#737373">></FONT>
<FONT COLOR="#737373">> Run your fixed script and we get the same behavior:</FONT>
<FONT COLOR="#737373">></FONT>
<FONT COLOR="#737373">> $ perl test-chldhandle-bug-fixed.pl</FONT>
<FONT COLOR="#737373">> init... pid=29713</FONT>
<FONT COLOR="#737373">> while...</FONT>
<FONT COLOR="#737373">> fork 1</FONT>
<FONT COLOR="#737373">> end... pid=29716</FONT>
<FONT COLOR="#737373">> receive chld</FONT>
<FONT COLOR="#737373">> fork 2</FONT>
<FONT COLOR="#737373">> end... pid=29717</FONT>
<FONT COLOR="#737373">> receive chld</FONT>
<FONT COLOR="#737373">> 2014-03-17 11:10:37.234+0000: 29713: info : libvirt version: 1.0.5.7, package: 2.fc19 (Fedora Project, 2013-11-17-23:21:57, buildvm-18.phx2.fedoraproject.org)</FONT>
<FONT COLOR="#737373">> 2014-03-17 11:10:37.234+0000: 29713: warning : virNetTLSContextCheckCertificate:1099 : Certificate check failed Certificate [session] owner does not match the hostname 10.10.4.249</FONT>
<FONT COLOR="#737373">> connection open</FONT>
<FONT COLOR="#737373">> fork 3</FONT>
<FONT COLOR="#737373">> end... pid=29827</FONT>
<FONT COLOR="#737373">> fork 4</FONT>
<FONT COLOR="#737373">> end... pid=29930</FONT>
<FONT COLOR="#737373">> go next...</FONT>
<FONT COLOR="#737373">></FONT>
<FONT COLOR="#737373">></FONT>

I'm not a perl expert, but I don't think it's a libvirt bug anyhow. 
Moreover, I don't see any zombies:

$ perl test-chldhandle-bug-fixed.pl & sleep 5 && echo && ps axf | grep 
perl && echo
[1] 11239
init... pid=11239
while...
fork 1
end... pid=11241
receive chld
fork 2
end... pid=11242
receive chld
connection open

11239 pts/18   S      0:00  |   \_ perl test-chldhandle-bug-fixed.pl
11245 pts/18   S+     0:00  |   \_ grep --colour=auto perl

fork 3
end... pid=11246
receive chld
fork 4
end... pid=11247
receive chld
go next...

btw: with older version I'm seeing this:

11399 pts/18   S      0:00  |   \_ perl test-chldhandle-bug.pl
11401 pts/18   Z      0:00  |   |   \_ [perl] <defunct>
11402 pts/18   Z      0:00  |   |   \_ [perl] <defunct>
11405 pts/18   S+     0:00  |   \_ grep --colour=auto perl

What zombies are you seeing? Perl ones or libvirt or ..,?

Michal
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>