bug-grep
[Top][All Lists]
Advanced

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

bug#19252: [PATCH] dfa: matching at next position or infinit loop in mat


From: Jim Meyering
Subject: bug#19252: [PATCH] dfa: matching at next position or infinit loop in matching mode
Date: Tue, 2 Dec 2014 08:35:32 -0800

On Tue, Dec 2, 2014 at 6:25 AM, Norihiro Tanaka <address@hidden> wrote:
> After failed to match in matching mode, dfa transits initial state
> when not allow newline or next state when allow new line instead of
> return NULL.
>
> That will cause next matching at position or infinit loop.  By the
> way, theere is no affair for grep in order that it always uses not
> matching mode but searching mode.

Thank you for the patches.

I'm not sure I understand the above paragraph.
Is this what you intended?

    That will cause an invalid match or an infinite loop.
    By the way, there is no option to make grep use
    searching mode rather than matching mode.

Perhaps your intent is to say that the above makes it hard
to trigger this bug, thus why there is no test case?

> First patch fixes the bug, and second patch simplifies around the code.

For a bug fix, we need three more things:
  1) a NEWS entry describing the effect of the bug and
      mentioning affected release numbers
  2) a test case that triggers the bug(s)
  3) a commit log entry that references the "git desc"-style
      commit hash of the change that introduced the bug

Can you provide a test case to trigger this?
Is it easier to construct a test case using gawk?

Even if it is quite hard, or possibly even if it requires
adding some new undocumented option or test-only
code, with a tool like DFA/grep, it is worthwhile (I would
say "required") to spend the time to create a test to go
along with every newly discovered bug.

I will look more closely at the affected code in the
next day or two.

Jim





reply via email to

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