bug-gnulib
[Top][All Lists]
Advanced

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

Re: please keep 'memmem' module simple


From: Simon Josefsson
Subject: Re: please keep 'memmem' module simple
Date: Wed, 09 Jan 2008 15:53:35 +0100
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux)

Eric Blake <address@hidden> writes:

> According to Simon Josefsson on 1/9/2008 3:16 AM:
> |
> | For gnutls, the strings are always the same (X.509 PEM headers), and we
> | haven't seen such slowdowns even on large inputs (searching for a 10
> | byte needle in a 500kb input is, while not typical, not uncommon).  What
> | properties do unlucky strings have?
>
> The quadratic nature of the brute force algorithm (which glibc currently
..

Thanks for the explanation.

> So I'm okay with the idea of adding a memmem-simple module that skips the
> quadratic check if the system memmem is otherwise working

Sounds like a plan, then.  I'll see if I can produce a patch.

> (remember, however, that the system memmem may be broken, as on
> cygwin).

Did the old check find that brokenness?  Has this brokenness been
discussed before, and was a m4 test to detect it produced?  I can't see
anything in memmem.m4 about it now.

> But I think it should be done solely through m4 magic - in other
> words, split gl_FUNC_MEMMEM into two macros, where the behavioral
> check is called for both memmem and memmem-simple, but the speed check
> is called only for memmem; both modules can share the lib/memmem.c
> implementation.

Sure.

/Simon




reply via email to

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