GNU bug report logs - #17516
[PATCH] grep: no count newline at the head of a text buffer

Previous Next

Package: grep;

Reported by: Norihiro Tanaka <noritnk <at> kcn.ne.jp>

Date: Sat, 17 May 2014 01:31:01 UTC

Severity: critical

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17516 in the body.
You can then email your comments to 17516 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#17516; Package grep. (Sat, 17 May 2014 01:31:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Norihiro Tanaka <noritnk <at> kcn.ne.jp>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Sat, 17 May 2014 01:31:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
To: bug-grep <at> gnu.org
Subject: [PATCH] grep: no count newline at the head of a text buffer
Date: Sat, 17 May 2014 10:20:51 +0900
[Message part 1 (text/plain, inline)]
Severity: critical

When cleared caches of transition tables, number of newline is counted
incorrectly, As a result, grep may crash.

I confirmed crash of grep with a text case in bug#15191

  http://dobrokot.ru/dump/slow_dfa_merge.2013-08-26.tar.gz

  $ env LC_ALL=C time -p src/egrep -f regex.re input_lines.txt

When `p' is beginning, p[-1] is out of the buffer.  Therefore, we
shouldn't count it.

Norihiro
[0001-grep-no-count-newline-at-the-head-of-a-text-buffer.patch (application/octet-stream, attachment)]

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Sat, 17 May 2014 05:09:02 GMT) Full text and rfc822 format available.

Notification sent to Norihiro Tanaka <noritnk <at> kcn.ne.jp>:
bug acknowledged by developer. (Sat, 17 May 2014 05:09:03 GMT) Full text and rfc822 format available.

Message #10 received at 17516-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Norihiro Tanaka <noritnk <at> kcn.ne.jp>, 17516-done <at> debbugs.gnu.org
Subject: Re: bug#17516: [PATCH] grep: no count newline at the head of a text
 buffer
Date: Fri, 16 May 2014 22:08:41 -0700
Thanks for catching that; I installed the patch with a slightly reworded 
ChangeLog entry.




Information forwarded to bug-grep <at> gnu.org:
bug#17516; Package grep. (Sat, 17 May 2014 23:00:04 GMT) Full text and rfc822 format available.

Message #13 received at 17516 <at> debbugs.gnu.org (full text, mbox):

From: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
To: 17516 <at> debbugs.gnu.org
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, jim <at> meyering.net
Subject: Re: bug#17516: [PATCH] grep: no count newline at the head of a text
 buffer
Date: Sun, 18 May 2014 07:59:12 +0900
[Message part 1 (text/plain, inline)]
Thanks for the review and push.

I also submit a test case for this bug.  It fails in grep-2.18.146-ebf3,
and succeeds in current master.
[0001-tests-add-test-case-previous-fix-previous-change.patch (text/plain, attachment)]

Information forwarded to bug-grep <at> gnu.org:
bug#17516; Package grep. (Sun, 18 May 2014 00:31:01 GMT) Full text and rfc822 format available.

Message #16 received at 17516 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Norihiro Tanaka <noritnk <at> kcn.ne.jp>, 17516 <at> debbugs.gnu.org
Cc: jim <at> meyering.net
Subject: Re: bug#17516: [PATCH] grep: no count newline at the head of a text
 buffer
Date: Sat, 17 May 2014 17:29:52 -0700
Norihiro Tanaka wrote:

> I also submit a test case for this bug.

Thanks, I installed that.




Information forwarded to bug-grep <at> gnu.org:
bug#17516; Package grep. (Thu, 22 May 2014 04:35:02 GMT) Full text and rfc822 format available.

Message #19 received at 17516 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, 17516 <at> debbugs.gnu.org
Subject: Re: bug#17516: [PATCH] grep: no count newline at the head of a text
 buffer
Date: Wed, 21 May 2014 21:34:02 -0700
[Message part 1 (text/plain, inline)]
On Sat, May 17, 2014 at 3:59 PM, Norihiro Tanaka <noritnk <at> kcn.ne.jp> wrote:
> Thanks for the review and push.
>
> I also submit a test case for this bug.  It fails in grep-2.18.146-ebf3,
> and succeeds in current master.

Thanks again.
However, that new test made it so "make syntax-check" would fail.
I've suppressed that new failure via the attached:
[0001-maint-avoid-new-false-positive-syntax-check-failure.patch (application/octet-stream, attachment)]

Information forwarded to bug-grep <at> gnu.org:
bug#17516; Package grep. (Thu, 22 May 2014 04:53:02 GMT) Full text and rfc822 format available.

Message #22 received at 17516 <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Jim Meyering <jim <at> meyering.net>, Norihiro Tanaka <noritnk <at> kcn.ne.jp>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, 17516 <at> debbugs.gnu.org
Subject: Re: bug#17516: [PATCH] grep: no count newline at the head of a text
 buffer
Date: Wed, 21 May 2014 22:52:30 -0600
[Message part 1 (text/plain, inline)]
On 05/21/2014 10:34 PM, Jim Meyering wrote:
> On Sat, May 17, 2014 at 3:59 PM, Norihiro Tanaka <noritnk <at> kcn.ne.jp> wrote:
>> Thanks for the review and push.
>>
>> I also submit a test case for this bug.  It fails in grep-2.18.146-ebf3,
>> and succeeds in current master.
> 
> Thanks again.
> However, that new test made it so "make syntax-check" would fail.
> I've suppressed that new failure via the attached:

It's also possible to rewrite the line:

grep -f in 'in' >out || fail=1

so as to avoid needing the suppression (I'm not sure which is prettier).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-grep <at> gnu.org:
bug#17516; Package grep. (Thu, 22 May 2014 04:56:01 GMT) Full text and rfc822 format available.

Message #25 received at 17516 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Eric Blake <eblake <at> redhat.com>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, Norihiro Tanaka <noritnk <at> kcn.ne.jp>,
 17516 <17516 <at> debbugs.gnu.org>
Subject: Re: bug#17516: [PATCH] grep: no count newline at the head of a text
 buffer
Date: Wed, 21 May 2014 21:55:30 -0700
On Wed, May 21, 2014 at 9:52 PM, Eric Blake <eblake <at> redhat.com> wrote:
> On 05/21/2014 10:34 PM, Jim Meyering wrote:
>> On Sat, May 17, 2014 at 3:59 PM, Norihiro Tanaka <noritnk <at> kcn.ne.jp> wrote:
>>> Thanks for the review and push.
>>>
>>> I also submit a test case for this bug.  It fails in grep-2.18.146-ebf3,
>>> and succeeds in current master.
>>
>> Thanks again.
>> However, that new test made it so "make syntax-check" would fail.
>> I've suppressed that new failure via the attached:
>
> It's also possible to rewrite the line:
>
> grep -f in 'in' >out || fail=1
>
> so as to avoid needing the suppression (I'm not sure which is prettier).

Thanks for the suggestion.
Since this is a false-positive after all, I prefer to keep the
work-around out of the primary source file, even if that
means exempting this entire file from that one syntax-check.
It is unlikely to matter.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 19 Jun 2014 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 3 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.