bug#24941: Early termination bug in grep 2.26

2016-11-19 Thread Jim Meyering
On Sat, Nov 19, 2016 at 1:47 AM, Paul Eggert wrote: > This turned into more work than I expected, as I kept finding performance > glitches and/or correctness bugs in the neighborhood. I installed the > attached set of patches. Patch 03 is the crucial one. Patch 10 trivially > fixes an earlier test

bug#24941: Early termination bug in grep 2.26

2016-11-19 Thread Paul Eggert
This turned into more work than I expected, as I kept finding performance glitches and/or correctness bugs in the neighborhood. I installed the attached set of patches. Patch 03 is the crucial one. Patch 10 trivially fixes an earlier test of mine and I'm too lazy to write a separate email for it

bug#24941: Early termination bug in grep 2.26

2016-11-15 Thread Jim Meyering
On Tue, Nov 15, 2016 at 3:33 PM, Paul Eggert wrote: > On 11/15/2016 03:13 PM, Jim Meyering wrote: >> >>We should retain the optimization when reading from stdin that is >> neither a pipe nor a tty. > > I am toying with the idea of retaining the optimization only if lseek-to-EOF > succeeds, a h

bug#24941: Early termination bug in grep 2.26

2016-11-15 Thread Paul Eggert
On 11/15/2016 03:13 PM, Jim Meyering wrote: We should retain the optimization when reading from stdin that is neither a pipe nor a tty. I am toying with the idea of retaining the optimization only if lseek-to-EOF succeeds, a heuristic that is a bit more restrictive. This arguably would con

bug#24941: Early termination bug in grep 2.26

2016-11-15 Thread Jim Meyering
On Tue, Nov 15, 2016 at 2:13 PM, Norihiro Tanaka wrote: > > On Tue, 15 Nov 2016 11:35:15 -0800 > Jim Meyering wrote: > >> I suppose you mean in addition to the S_ISFIFO test? That sounds good. >> We should retain the optimization when reading from stdin that is a >> non-pipe. > > This can also ha

bug#24941: Early termination bug in grep 2.26

2016-11-15 Thread Norihiro Tanaka
On Tue, 15 Nov 2016 11:35:15 -0800 Jim Meyering wrote: > I suppose you mean in addition to the S_ISFIFO test? That sounds good. > We should retain the optimization when reading from stdin that is a > non-pipe. This can also happen in stdin. If we redirect stdout to /dev/null, grep-2.26 exits i

bug#24941: Early termination bug in grep 2.26

2016-11-15 Thread Jim Meyering
On Tue, Nov 15, 2016 at 12:17 AM, Paul Eggert wrote: > Jim Meyering wrote: >> >> Paul, what do you think about making your heuristic apply only for >> non-pipes? > > I'm a bit dubious, as grep exits early for other reasons, and did so before > the patch in question. For example, here: > > seq 1000

bug#24941: Early termination bug in grep 2.26

2016-11-15 Thread Paul Eggert
Jim Meyering wrote: Paul, what do you think about making your heuristic apply only for non-pipes? I'm a bit dubious, as grep exits early for other reasons, and did so before the patch in question. For example, here: seq 100 | grep -q . This is as of grep 2.19 (2014), due to a bug re

bug#24941: Early termination bug in grep 2.26

2016-11-14 Thread Jim Meyering
On Sun, Nov 13, 2016 at 5:56 PM, Gary Johnson wrote: > There was some recent discussion on the vim_dev list of a failure to > update a Vim package which was found to be due to an update of grep > from 2.25 to 2.26. The details of the grep behavior are discussed > here: > > https://www.linuxquesti

bug#24941: Early termination bug in grep 2.26

2016-11-13 Thread Gary Johnson
There was some recent discussion on the vim_dev list of a failure to update a Vim package which was found to be due to an update of grep from 2.25 to 2.26. The details of the grep behavior are discussed here: https://www.linuxquestions.org/questions/slackware-14/pkgtools-grep-bug-in-slackware[64]