Bug 1025269 - libguestfs tests hang in libguestfs-1.20.11/tests/guests/guest-aux/make-fedora-img.pl
Summary: libguestfs tests hang in libguestfs-1.20.11/tests/guests/guest-aux/make-fedor...
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs
Version: 6.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Pino Toscano
QA Contact: Virtualization Bugs
Depends On:
Blocks: TRACKER-bugs-affecting-libguestfs
TreeView+ depends on / blocked
Reported: 2013-10-31 10:56 UTC by Richard W.M. Jones
Modified: 2014-10-14 06:34 UTC (History)
6 users (show)

Fixed In Version: libguestfs-1.20.11-3.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-10-14 06:34:54 UTC
Target Upstream Version:

Attachments (Terms of Use)
strace.log (338.86 KB, application/x-xz)
2013-10-31 12:23 UTC, Richard W.M. Jones
no flags Details
run (35 bytes, text/plain)
2013-10-31 20:11 UTC, Richard W.M. Jones
no flags Details
test.c (362 bytes, text/plain)
2013-10-31 20:11 UTC, Richard W.M. Jones
no flags Details

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1458 normal SHIPPED_LIVE libguestfs bug fix update 2014-10-14 01:10:57 UTC

Description Richard W.M. Jones 2013-10-31 10:56:12 UTC
Description of problem:

Rebuilding the libguestfs RPM in RHEL 6.5 hangs when building
the test Fedora image.

Libguestfs runs:
/usr/libexec/qemu-kvm -nographic -machine accel=kvm:tcg -device \?

and this command hangs, but also causes the parent process to
be killed with SIGSTOP(!)

19995 pts/0    T      0:00 /usr/bin/perl /home/rjones/d/rhel/libguestfs/rhel-6.5/libguestfs-1.20.11/tests/guests/guest-aux/make-fedora-img.pl
20006 pts/0    T      0:00 /usr/libexec/qemu-kvm -nographic -machine accel=kvm:tcg -device ?

Version-Release number of selected component (if applicable):

libguestfs 1.20.11-2.el6

How reproducible:

100% on two different machines

Steps to Reproduce:
1. Update to RHEL 6.5 nightly (20131030)
2. rhpkg local

Comment 2 Richard W.M. Jones 2013-10-31 12:23:44 UTC
Created attachment 817864 [details]

strace -f make check -C tests/guests

Compressed file -- this file expands to 239 MB (sic!)

The important part is that it's stopping while writing to
the console, ie:

21593 --- SIGTTOU (Stopped (tty output)) @ 0 (0) ---

I have no idea why this happens in RHEL 6.5 but not anywhere else.

Comment 3 bfan 2013-10-31 12:36:40 UTC

# rpmbuild --rebuild --target=x86_64 libguestfs-1.20.11-2.el6.src.rpm

( omit message ...)
SRCDIR=. ../../run --test guest-aux/make-debian-img.sh
7 seconds: guest-aux/make-debian-img.sh
debian.img: file size bytes: 536870912
debian.img: allocated bytes: 14405632
debian.img: MD5 hash:        acae590ee7f33d5cfd904ca07db0b65d
SRCDIR=. LAYOUT=partitions ../../run --test guest-aux/make-fedora-img.pl

(it hangs here)

It blocks errata tps-srpmtest, please help to fix ASAP

Comment 4 Richard W.M. Jones 2013-10-31 20:10:09 UTC
I believe this is a bug in coreutils 'timeout' utility, in fact
one which is still present upstream.

I will upload two attachments which demonstrate the bug:

$ gcc -Wall test.c -o test
$ ./test
$ timeout 4h ./test
$ ./run
<-- this command hangs with ./test putting itself into STOPPED state

The following patch to coreutils fixes the problem for me.

--- coreutils-8.21/src/timeout.c.old	2013-10-31 19:44:01.719755435 +0000
+++ coreutils-8.21/src/timeout.c	2013-10-31 19:50:07.634292913 +0000
@@ -443,9 +443,11 @@
     {                           /* child */
       int exit_status;
+#if 0
       /* exec doesn't reset SIG_IGN -> SIG_DFL.  */
       signal (SIGTTIN, SIG_DFL);
       signal (SIGTTOU, SIG_DFL);
       execvp (argv[0], argv);   /* FIXME: should we use "sh -c" ... here?  */

Comment 5 Richard W.M. Jones 2013-10-31 20:11:08 UTC
Created attachment 818048 [details]

Comment 6 Richard W.M. Jones 2013-10-31 20:11:43 UTC
Created attachment 818049 [details]

Comment 7 Ondrej Vasik 2013-11-01 12:24:31 UTC
Just disabling the code path is probably not correct way ;) ... however, it should at least be investigated - I don't think that priority urgent is the right one, though - as this should be "workaroundable" somehow in the test itself.

Comment 8 Ondrej Vasik 2013-11-01 12:29:30 UTC
I see it tracked on upstream tracker already - http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15779 ... thanks Richard!

Comment 9 Richard W.M. Jones 2013-11-01 14:49:35 UTC
Workaround in libguestfs:
commit 7113aee0b439b411602d8d7d4b03bf02bc91b800

Comment 10 Richard W.M. Jones 2013-12-18 19:54:28 UTC
I'm also seeing this on Fedora 19.

Comment 11 Pádraig Brady 2013-12-19 02:05:49 UTC
timeout has the --foreground option on fedora 19

Comment 12 Richard W.M. Jones 2014-01-28 21:11:21 UTC
Hoping we've fixed it properly (in libguestfs) this time:


Comment 14 bfan 2014-05-14 09:14:55 UTC
Verified with libguestfs-1.20.11-3.el6,

Build passed

Comment 15 errata-xmlrpc 2014-10-14 06:34:54 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.


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