grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.9-16-gf4c4b1b


From: Jim Meyering
Subject: grep branch, master, updated. v2.9-16-gf4c4b1b
Date: Sun, 24 Jul 2011 19:07:55 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  f4c4b1b107f014244142e9b8a27208a5f3ac52b5 (commit)
       via  5e20a38a99fe6f0380f810b602d665dec2ae7cd0 (commit)
      from  708b04abffa269253b92b35686e7852b7639adb7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=f4c4b1b107f014244142e9b8a27208a5f3ac52b5


commit f4c4b1b107f014244142e9b8a27208a5f3ac52b5
Author: Jim Meyering <address@hidden>
Date:   Sun Jul 24 12:10:31 2011 +0200

    tests: add a test to trigger the bug
    
    * tests/Makefile.am (TESTS): Add it.
    * tests/in-eq-out-infloop: Exercise the bug/fix.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index a3a0f33..1baf269 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -61,6 +61,7 @@ TESTS =                                               \
   grep-dir                                     \
   help-version                                 \
   ignore-mmap                                  \
+  in-eq-out-infloop                             \
   include-exclude                              \
   inconsistent-range                            \
   khadafy                                      \
diff --git a/tests/in-eq-out-infloop b/tests/in-eq-out-infloop
new file mode 100755
index 0000000..726accb
--- /dev/null
+++ b/tests/in-eq-out-infloop
@@ -0,0 +1,26 @@
+#!/bin/sh
+# Demonstrate the disk-filling infloop when redirecting to an input file.
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+require_timeout_
+
+# Use an input file large enough that the problem is reproducible in spite
+# of buffering effects.  Just larger than 256KB should be adequate.
+v=$(printf %063d 0)'
+'
+# 64 * 2^12 = 256k
+for i in 1 2 3 4 5 6 7 8 9 10 11 12; do
+  v="$v$v"
+done
+
+echo "$v" > out || framework_failure_
+echo 'grep: input file `out'\'' is also the output' \
+    > err.exp || framework_failure_
+
+# Require an exit status of 2.
+# grep-2.8 and earlier would infloop.
+timeout 10 grep 0 out >> out 2> err; st=$?
+test $st = 2 || fail=1
+
+compare err.exp err || fail=1
+
+Exit $fail

http://git.savannah.gnu.org/cgit/grep.git/commit/?id=5e20a38a99fe6f0380f810b602d665dec2ae7cd0


commit f4c4b1b107f014244142e9b8a27208a5f3ac52b5
Author: Jim Meyering <address@hidden>
Date:   Sun Jul 24 12:10:31 2011 +0200

    tests: add a test to trigger the bug
    
    * tests/Makefile.am (TESTS): Add it.
    * tests/in-eq-out-infloop: Exercise the bug/fix.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index a3a0f33..1baf269 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -61,6 +61,7 @@ TESTS =                                               \
   grep-dir                                     \
   help-version                                 \
   ignore-mmap                                  \
+  in-eq-out-infloop                             \
   include-exclude                              \
   inconsistent-range                            \
   khadafy                                      \
diff --git a/tests/in-eq-out-infloop b/tests/in-eq-out-infloop
new file mode 100755
index 0000000..726accb
--- /dev/null
+++ b/tests/in-eq-out-infloop
@@ -0,0 +1,26 @@
+#!/bin/sh
+# Demonstrate the disk-filling infloop when redirecting to an input file.
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+require_timeout_
+
+# Use an input file large enough that the problem is reproducible in spite
+# of buffering effects.  Just larger than 256KB should be adequate.
+v=$(printf %063d 0)'
+'
+# 64 * 2^12 = 256k
+for i in 1 2 3 4 5 6 7 8 9 10 11 12; do
+  v="$v$v"
+done
+
+echo "$v" > out || framework_failure_
+echo 'grep: input file `out'\'' is also the output' \
+    > err.exp || framework_failure_
+
+# Require an exit status of 2.
+# grep-2.8 and earlier would infloop.
+timeout 10 grep 0 out >> out 2> err; st=$?
+test $st = 2 || fail=1
+
+compare err.exp err || fail=1
+
+Exit $fail

-----------------------------------------------------------------------

Summary of changes:
 NEWS                    |    5 +++++
 bootstrap.conf          |    3 ++-
 src/main.c              |   26 ++++++++++++++++++++++++++
 src/system.h            |   42 +++++++++++++++++++++++++++++++++++++++++-
 tests/Makefile.am       |    1 +
 tests/in-eq-out-infloop |   26 ++++++++++++++++++++++++++
 6 files changed, 101 insertions(+), 2 deletions(-)
 create mode 100755 tests/in-eq-out-infloop


hooks/post-receive
-- 
grep



reply via email to

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