bug-grep
[Top][All Lists]
Advanced

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

Re: grep-2.9.69-f91c on Linux/SPARC


From: Jim Meyering
Subject: Re: grep-2.9.69-f91c on Linux/SPARC
Date: Sat, 12 Nov 2011 10:17:11 +0100

Bruno Haible wrote:

> Jim Meyering wrote:
>> > On Linux/SPARC 64-bit, glibc 2.6.32:
>> >
>> > FAIL: empty
>> > FAIL: fgrep-infloop
>> > FAIL: in-eq-out-infloop
>>
>> So far I've looked only at the last one.
>> That test is designed to ensure that grep detects
>> when its input file is the same as its output.
>> That it is failing suggests that the same_file_attributes
>> macro is testing too many attributes of a growing file.
>> ...
>
> That hypothesis would make sense if the file was growing, or if the file
> system was NFS. But no, it's a plain ext3 file system!
>
> I single-stepped this test (using the methodology describe in init.sh)
> and found this:
>
> $ grep 0 out >> out
> grep: input file `out' is also the output
> $ echo $?
> 2
>
> So, grep is detecting the situation correctly. Why does the test fail, then?
>
> $ timeout 10 grep 0 out >> out
> grep: input file `out' is also the output
> $ echo $?
> 0
>
> The 'timeout' program is documented to return the error code of that
> program, if it terminated soon enough. Maybe it's an old timeout program?
>
> $ timeout --help
> usage: timeout [-signal] time command...
> $ echo $?
> 1
>
> That's a rather scarce --help message, not really GNU style...
>
> $ man timeout
...
> AUTHOR(S)
>        Wietse Venema
>        This program is part of SATAN.
>
> I think I've been a victim of SATAN :-)
>
> When I change the require_timeout_ function in init.cfg to read
...
> then the 3 tests are skipped.

Thanks!
I'll apply this in your name:

>From da146191fe5ae006c7d02fc7feb0870c59917c2f Mon Sep 17 00:00:00 2001
From: Bruno Haible <address@hidden>
Date: Sat, 12 Nov 2011 10:15:03 +0100
Subject: [PATCH] tests: avoid unwarranted failures due to SATAN's timeout

* tests/init.cfg (require_timeout_): Also ensure that
timeout exits with its child's exit status.
---
 tests/init.cfg |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tests/init.cfg b/tests/init.cfg
index 27b68df..e04d90f 100644
--- a/tests/init.cfg
+++ b/tests/init.cfg
@@ -41,6 +41,8 @@ require_timeout_()
 {
   ( timeout 10s true ) > /dev/null 2>&1 \
     || skip_ your system lacks the timeout program
+  timeout 10s false; test $? = 1 \
+    || skip_ your system has a non-GNU timeout program
 }

 require_pcre_()
--
1.7.8.rc0.61.g8a042



reply via email to

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