GNU bug report logs - #17066
a DFA state which is built previously may be re-built in non-UTF8 locales

Previous Next

Package: grep;

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

Date: Sat, 22 Mar 2014 07:00:02 UTC

Severity: normal

Tags: patch

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

Bug is archived. No further changes may be made.

Full log


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

From: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
To: submit <at> debbugs.gnu.org
Subject: a DFA state which is built previously may be re-built in non-UTF8
 locales
Date: Sat, 22 Mar 2014 15:59:11 +0900
[Message part 1 (text/plain, inline)]
Package: grep

When don't pass backref parameter to dfaexec(), a DFA state which is built
previously may be re-built.

In non-UTF8 locales, when reach a state which mbps aren't empty, exit
main loop and call build_state() in dfa.c, even if the state has been
already built.

That will cause increase of processing time, and waste of a lot of
memories.

Fortunately, grep program doesn't pass the code in dfa.c unless
mblen_buf overflows, since backref parameter is specified when dfaexec()
is called with large buffer.

Norihiro
[patch.txt (text/plain, attachment)]

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

Previous Next


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