Bug 1025269 - libguestfs tests hang in libguestfs-1.20.11/tests/guests/guest-aux/make-fedora-img.pl
libguestfs tests hang in libguestfs-1.20.11/tests/guests/guest-aux/make-fedor...
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs (Show other bugs)
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Pino Toscano
Virtualization Bugs
Depends On:
Blocks: TRACKER-bugs-affecting-libguestfs
  Show dependency treegraph
Reported: 2013-10-31 06:56 EDT by Richard W.M. Jones
Modified: 2014-10-14 02:34 EDT (History)
6 users (show)

See Also:
Fixed In Version: libguestfs-1.20.11-3.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-10-14 02:34:54 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Richard W.M. Jones 2013-10-31 06:56:12 EDT
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 08:23:44 EDT
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 08:36:40 EDT

# 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 16:10:09 EDT
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 16:11:08 EDT
Created attachment 818048 [details]
Comment 6 Richard W.M. Jones 2013-10-31 16:11:43 EDT
Created attachment 818049 [details]
Comment 7 Ondrej Vasik 2013-11-01 08:24:31 EDT
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 08:29:30 EDT
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 10:49:35 EDT
Workaround in libguestfs:
commit 7113aee0b439b411602d8d7d4b03bf02bc91b800
Comment 10 Richard W.M. Jones 2013-12-18 14:54:28 EST
I'm also seeing this on Fedora 19.
Comment 11 Pádraig Brady 2013-12-18 21:05:49 EST
timeout has the --foreground option on fedora 19
Comment 12 Richard W.M. Jones 2014-01-28 16:11:21 EST
Hoping we've fixed it properly (in libguestfs) this time:

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

Build passed
Comment 15 errata-xmlrpc 2014-10-14 02:34:54 EDT
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.