RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1080501 - use of tls with libvirt.so can leave zombie processes
Summary: use of tls with libvirt.so can leave zombie processes
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.2
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 1078589
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-25 14:39 UTC by Chris Pelland
Modified: 2014-04-16 09:52 UTC (History)
13 users (show)

Fixed In Version: libvirt-0.10.2-29.el6_5.6
Doc Type: Bug Fix
Doc Text:
A previous update introduced an error where a SIG_SETMASK argument was incorrectly replaced by a SIG_BLOCK argument after the poll() system call. Consequently, the SIGCHLD signal could be permanently blocked, which caused signal masks not to return to their original values and defunct processes to be generated. With this update, the original signal masks are restored as intended, and poll() now functions correctly.
Clone Of:
Environment:
Last Closed: 2014-04-07 07:26:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
The configuration of tls (2.08 KB, text/plain)
2014-03-26 10:24 UTC, zhenfeng wang
no flags Details
The perl script which used to reporduce (828 bytes, text/plain)
2014-03-26 10:26 UTC, zhenfeng wang
no flags Details
The new perl script which used to reporduce (1.21 KB, text/plain)
2014-03-27 11:39 UTC, zhenfeng wang
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:0375 0 normal SHIPPED_LIVE libvirt bug fix update 2014-04-07 11:24:29 UTC

Description Chris Pelland 2014-03-25 14:39:03 UTC
This bug has been copied from bug #1078589 and has been proposed
to be backported to 6.5 z-stream (EUS).

Comment 6 zhenfeng wang 2014-03-26 10:18:05 UTC
Hi Michal
I didn't reproduce this bug with this link in the downstream, 
https://www.redhat.com/archives/libvir-list/2014-March/msg00858.html

 can you give me some suggestion? so that i can verify this bug sufficiently. thanks, the following was my current verify steps, please help check it.

pkginfo(the server and client was same)
libvirt-0.10.2-18.el6

steps
1.configure the tls env
you can see the attachment for more details

2.Download the perl script from the following link
https://www.redhat.com/archives/libvir-list/2014-March/msg00858.html

3.Run the script, I didn't met any info and warning during my testing, even, didn't see it in the libvirt log

# perl test-chldhandle-bug.pl 
init... pid=19347
while...
fork 1
end... pid=19348
receive chld
fork 2
end... pid=19349
receive chld
connection open
fork 3
end... pid=19350
fork 4
end... pid=19351
go next...
while...
fork 1
end... pid=19352
fork 2
end... pid=19353
connection open
fork 3
end... pid=19362
fork 4
end... pid=19364
go next...
while...

Comment 7 zhenfeng wang 2014-03-26 10:24:03 UTC
Created attachment 878947 [details]
The configuration of tls

Comment 8 zhenfeng wang 2014-03-26 10:26:09 UTC
Created attachment 878948 [details]
The perl script which used to reporduce

Comment 9 Michal Privoznik 2014-03-26 13:56:02 UTC
(In reply to zhenfeng wang from comment #6)
> Hi Michal
> I didn't reproduce this bug with this link in the downstream, 
> https://www.redhat.com/archives/libvir-list/2014-March/msg00858.html
> 
>  can you give me some suggestion? so that i can verify this bug
> sufficiently. thanks, the following was my current verify steps, please help
> check it.
> 
> pkginfo(the server and client was same)
> libvirt-0.10.2-18.el6
> 
> steps
> 1.configure the tls env
> you can see the attachment for more details
> 
> 2.Download the perl script from the following link
> https://www.redhat.com/archives/libvir-list/2014-March/msg00858.html
> 
> 3.Run the script, I didn't met any info and warning during my testing, even,
> didn't see it in the libvirt log
> 
> # perl test-chldhandle-bug.pl 
> init... pid=19347
> while...
> fork 1
> end... pid=19348
> receive chld
> fork 2
> end... pid=19349
> receive chld
> connection open
> fork 3
> end... pid=19350
> fork 4
> end... pid=19351
> go next...
> while...
> fork 1
> end... pid=19352
> fork 2
> end... pid=19353
> connection open
> fork 3
> end... pid=19362
> fork 4
> end... pid=19364
> go next...
> while...


In fact you did reproduce this bug. Noticed these 'receive chld' messages? They can be seen only twice. If you take a look at the script, at the first run, prior to opening a libvirt connection, the script forks two times and the parent receives SIGCHLD immediately. The signal handler prints the message. However, as the script goes on, it opens the libvirt connection (and the bug reproduces itself) so from now on, you can see no handler message. This means, the signal is ignored. Indeed, if you let the script run for a while (say a minute), and run ps in another terminal, you can see something like this:

 1184 tty2     S+     0:00      \_ perl test-chldhandle-bug-fixed.pl
 1188 tty2     Z+     0:00          \_ [perl] <defunct>
 1189 tty2     Z+     0:00          \_ [perl] <defunct>
 1190 tty2     Z+     0:00          \_ [perl] <defunct>
 1191 tty2     Z+     0:00          \_ [perl] <defunct>
 1192 tty2     Z+     0:00          \_ [perl] <defunct>
 1193 tty2     Z+     0:00          \_ [perl] <defunct>
 1194 tty2     Z+     0:00          \_ [perl] <defunct>
 1195 tty2     Z+     0:00          \_ [perl] <defunct>
 1196 tty2     Z+     0:00          \_ [perl] <defunct>
 1197 tty2     Z+     0:00          \_ [perl] <defunct>

So there are some zombies.

Comment 10 zhenfeng wang 2014-03-27 11:35:10 UTC
(In reply to zhenfeng wang from comment #8)
> Created attachment 878948 [details]
> The perl script which used to reporduce

please ignore this script, since there was some issues about this script itself, and i'll attach the new script in the attachment, please use the new script to test.

Comment 11 zhenfeng wang 2014-03-27 11:39:35 UTC
Created attachment 879426 [details]
The new perl script which used to reporduce

Comment 12 zhenfeng wang 2014-03-27 11:41:46 UTC
Thanks for Michal's quick response, I can get the expect result with the latest libvirt packet and the new perl script. The verify steps as follows 

pkginfo (the server and client was same)
libvirt-0.10.2-29.el6_5.7.x86_64
steps
1.excute step 1~2 as comment 6 description
2.Run the new script in comment11, could see the "receive chld" messages every time, also didn't find other zombie processes in another terminal

# perl libvirt-perl.pl 
init... pid=24570
while...
fork 1
end... pid=24571
receive chld
fork 2
end... pid=24572
receive chld
connection open
fork 3
end... pid=24578
receive chld
fork 4
end... pid=24579
receive chld
go next...
while...
fork 1
end... pid=24580
receive chld
fork 2
end... pid=24581
receive chld
connection open
fork 3
end... pid=24587
receive chld
fork 4
end... pid=24588
receive chld
go next...

# ps afx|grep perl
24674 pts/4    S+     0:00  |       \_ grep perl
24657 pts/1    S+     0:00  |       \_ perl libvirt-perl.pl

According to the uppper descriptions and comment 9, mark this bug verified

Comment 14 errata-xmlrpc 2014-04-07 07:26:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-0375.html


Note You need to log in before you can comment on or make changes to this bug.