On Tue, 13 Oct 2015 15:11:27 -0500 Bruce Dubbs <[email protected]> wrote:
> Hazel Russman wrote: > > > I get the same results as you for the output of head. That is not the > > problem. The problem is that seq does not stop running when head is > > finished; it runs literally to infinity! Consequently the second half > > of the test -- the printing of the expected result and the comparison > > with seq's output never takes place. > > > > I assume the sequence of events is something like this: > > > > 1) Head outputs the requested two lines to the file "out" and > > terminates. I can confirm that the file "out" exists in > > coreutils-8.24/gt-seq-precision.sh.i56M/ and contains the correct > > lines. > > > > 2) Termination of head closes the pipe, so seq gets a SIGPIPE. It > > should terminate but instead it somehow handles or ignores the > > signal. > > > > 3) Seq goes on trying to write into the pipe. It gets EPIPE errors, > > but apparently ignores them too. > > > > A run of ps ax confirms that seq is still running but that head is > > not. > > > > I think it's a signal-handling error, not a numerical one. > > Your analysis makes sense, but I cannot duplicate it. > > $ seq 1 inf |head; ps -ef && grep seq > 1 > 2 > 3 > 4 > 5 > 6 > 7 > 8 > 9 > 10 > bdubbs 28015 6462 0 14:56 pts/3 00:00:00 grep seq > > shows that seq is no longer running for me after head exists. I don't > know why SIGPIPE or EPIPE would be ignored on your system. The only > place I see both sigaction and PIPE in the source is src/split.c. > > Just taking a guess, what do you have for 'ulimit -p'? Mine is 8. > I have now tried this out on all the systems I run on this machine. The results are as follows: OS Coreutils terminal result --------------------------------------------------- Debian 8.13 xterm exits Crux 8.24 xterm hangs LFS7.7 8.23 console exits LFS7.7 8.23 xterm hangs LFS7.7 8.24 console exits LFS7.7 8.24 xterm hangs LFS7.8 (chroot) 8.24 console exits LFS7.8 (chroot) 8.24 xterm hangs You can see that version 8.13 of coreutils does not have this bug. 8.23 and 8.24 both have it, but only when running in an xterm (and 8.23 did not have those tests so it wouldn't have shown up). Did you perhaps do your runs in a virtual console? Ulimit -p was 8 in all cases btw. Hazel -- http://lists.linuxfromscratch.org/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page Do not top post on this list. A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? http://en.wikipedia.org/wiki/Posting_style
