bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Failing "Test PIPE" in test 182 in 2.64


From: Stepan Kasal
Subject: Re: Failing "Test PIPE" in test 182 in 2.64
Date: Wed, 4 Nov 2009 17:17:42 +0100
User-agent: Mutt/1.5.19 (2009-01-05)

Hello Ralf,

thank you very much.  I tried some experiments today.
I believe we are on the trace of a subtle autotest bug here.
But without more hints from you, I'm not able to proceed; see below.

> Which shell is /bin/sh, and which is selected as CONFIG_SHELL?
> [...]  Did the `$CONFIG_SHELL ./micro-suite -d
> -3 5- | sed 5q' get to test 5?  Was this GNU sed, and which version?

this is an up-to date Fedora GNU/Linux, with:
        GNU bash, version 4.0.35(1)-release (i386-redhat-linux-gnu)
        GNU sed version 4.2.1
Moreover, the build happens in a chrooted tree; the underlying
system might be a bit older, like RHEL-5.x.

My analysis showed there are two thigs that together cause the test
to fail:
1) command "(/bin/sh micro-test -3 5-; echo $? >status) | sed 5q"
   quietly finishes its work, writing 0 to status, as if the shell
   ignored sigpipe.
2) The test's code to handle "shells that ignore sigpipe" does not
   seem to be correct.

Of these two causes, the latter one can be easily fixed, see the
attached autoconf-ignore-sigpipe-fix.patch (against 2.64).
But: shouldn't the test smell something when latest bash seems to
ignore sigpipe?  I would say yes, so the above fix should be enhanced
to report a problem in this situation.

But the more puzzling part is the first one.  I took micro-test.at
from the test case (also attached to this mail) and tried:

mkdir micro
cd micro
autom4te_perllibdir='..'/lib AUTOM4TE_CFG='../lib/autom4te.cfg' \
        ../bin/autom4te -B ../lib --language=autotest \
        $sources/micro-suite.at -o micro-suite
(/bin/sh ./micro-suite -d -3 5-; echo boo; echo $? >status) | sed 5q
cat micro-suite.dir/7/micro-suite.log
cat status

The tracing of this looked roughly like this
----------8<-----------
+ mkdir micro
+ cd micro
+ autom4te_perllibdir=../lib
+ AUTOM4TE_CFG=../lib/autom4te.cfg
+ ../bin/autom4te -B ../lib --language=autotest
/builddir/build/SOURCES/micro-suite.at -o micro-suite
+ sh ./micro-suite -d -3 5-
+ sed 5q
## -------------------------------------------------------------- ##
## GNU Nonsense 1.0 test suite: suite to test parallel execution. ##
## -------------------------------------------------------------- ##
  1: test number 1                                   ok
  2: test number 2                                   ok
./micro-suite: line 1553: printf: write error: Broken pipe
./micro-suite: line 1553: printf: write error: Broken pipe
./micro-suite: line 1553: printf: write error: Broken pipe
./micro-suite: line 1553: printf: write error: Broken pipe
./micro-suite: line 1769: echo: write error: Broken pipe
cat: write error: Broken pipe
./micro-suite: line 1775: echo: write error: Broken pipe
./micro-suite: line 1851: echo: write error: Broken pipe
+ echo 0
+ cat status
0
----------8<-----------

This shows clearly that the testsuite (non-parallel run) finished its
work.

Then I tried:

----------8<-----------
cat >foo <<END
echo 1
echo 2
echo 3
sleep 1
echo 4
END
(/bin/sh foo; echo $? >foostatus ) | sed 2q
cat foostatus
----------8<-----------

and got the correct output:

----------8<-----------
+ cat
+ /bin/sh foo
+ sed 2q
1
2
foo: line 5: echo: write error: Broken pipe
+ cat foostatus
cat: foostatus: No such file or directory
----------8<-----------

Lastly, I modified my micro-suite experiment this way:
----------8<-----------
(/bin/sh ./micro-suite -d -3 5-; echo boo; echo $? >status) | sed 5q
cat micro-suite.dir/7/micro-suite.log
cat status
----------8<-----------

and observed that the "echo boo" triggered sigpipe, so that file
"status" was not created in this case, observe:

----------8<-----------
+ autom4te_perllibdir=../lib
+ AUTOM4TE_CFG=../lib/autom4te.cfg
+ ../bin/autom4te -B ../lib --language=autotest
/builddir/build/SOURCES/micro-suite.at -o micro-suite
+ /bin/sh ./micro-suite -d -3 5-
+ sed 5q
## -------------------------------------------------------------- ##
## GNU Nonsense 1.0 test suite: suite to test parallel execution. ##
## -------------------------------------------------------------- ##
  1: test number 1                                   ok
  2: test number 2                                   ok
./micro-suite: line 1553: printf: write error: Broken pipe
./micro-suite: line 1553: printf: write error: Broken pipe
./micro-suite: line 1553: printf: write error: Broken pipe
./micro-suite: line 1553: printf: write error: Broken pipe
./micro-suite: line 1769: echo: write error: Broken pipe
cat: write error: Broken pipe
./micro-suite: line 1775: echo: write error: Broken pipe
./micro-suite: line 1851: echo: write error: Broken pipe
+ echo boo
/var/tmp/rpm-tmp.MGWMDC: line 51: echo: write error: Broken pipe
+ cat micro-suite.dir/7/micro-suite.log
#                             -*- compilation -*-
7. micro-suite.at:22: testing ...
/micro-suite.at:22: sleep 1
7. micro-suite.at:22: 7. test number 7 (micro-suite.at:22): ok (0m0.000s 
0m0.002s)
+ cat status
cat: status: No such file or directory
----------8<-----------

Hypothesis:
I conclude that micro-suite somehow managed to set a trap for SIGPIPE
that caused that the testsuite was not interrupted.
This does not happen on my ancient ix86 machine, but it happens in
the build environment, that is a chroot on a x86_64, probably new and
fast.

Proof: well, I saw some sigpipe traps in the expanded micro-suite,
but I do not understand the details, so I was not sure how to
eliminate the one that might cause this problem.

I would be very grateful for some hints that would allow me to
proceed hunting this bug.  (Ralf?)

Happy piping,
        Stepan

Attachment: autoconf-ignore-sigpipe-fix.patch
Description: Text document

Attachment: micro-suite.at
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]