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: Bruno Haible
Subject: Re: grep-2.9.69-f91c on Linux/SPARC
Date: Sat, 12 Nov 2011 01:25:03 +0100
User-agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )

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




TIMEOUT(1)                                                          TIMEOUT(1)

NAME
       timeout - run command with bounded time

SYNOPSIS
       timeout [-signal] time command ...

DESCRIPTION
       timeout executes a command and imposes an elapsed time limit.  The com‐
       mand is run in a separate POSIX process group so that the  right  thing
       happens with commands that spawn child processes.

       Arguments:

       -signal
              Specify  an  optional  signal to send to the controlled process.
              By default, timeout sends SIGKILL, which  cannot  be  caught  or
              ignored. The signal must be provided in its numerical value.

       time   The  elapsed  time  limit  in seconds after which the command is
              terminated.

       command
              The command to be executed.

DIAGNOSTICS
       timeout’s exit status is the exit status of the specified command or  1
       in case of a usage error.

AUTHOR(S)
       Wietse Venema
       This program is part of SATAN.

                                                                    TIMEOUT(1)


I think I've been a victim of SATAN :-)

When I change the require_timeout_ function in init.cfg to read

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
}

then the 3 tests are skipped.

Bruno
-- 
In memoriam Jan Opletal <http://en.wikipedia.org/wiki/Jan_Opletal>



reply via email to

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