git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Test failures in t4034

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 20, 2012, 00:56 UTC
Message-ID
<7vboi6nzym.fsf@alter.siamese.dyndns.org>
In-Reply-To
<5030FD49.6060704@ramsay1.demon.co.uk>
Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
Show 13 quoted lines
> I had the same problem (or at least it *looks* like the same problem) on Linux
> last year (May 2011), which turned out to be a bug in the regex routines in an
> old version of glibc. 
>
> I don't know OS X at all, so this may not be relevent; does OS X use glibc?
> (I didn't think so, but ...)
>
> I sent some patches to the list which may be helpful. I can't get to gmane to
> look up a reference, but you need to search for:
>
>     [RFC/PATCH] userdiff.c: Avoid old glibc regex bug causing t4034-*.sh test failures
>
> sent on 3rd May 2011.

Thanks; that's $gmane/172676 for people who prefer easier to read threading interface.

Show 6 quoted lines
> Also, in the same thread, a reply to Jonathan Nieder on 7th May contains a
> test which checks whether your regex routines suffer this bug.
>
> These patches were not applied since I didn't think this would be a common
> problem. I simply set NO_REGEX=1 in my config.mak, since the compat/ regex
> routines don't suffer from this problem.
You also said:
  This is an RFC because:
   - A simple fix would be for me to put NO_REGEX=1 in my config.mak,
     since the compat/regex routines don't suffer this problem.
   - I suspect this bug is old enough that it will not affect many users.
   - I have not audited the other non-matching list expressions in
     userdiff.c
   - blame, grep and pickaxe all call regcomp() with the REG_NEWLINE
     flag, but get the regex from the user (eg from command line).
I think:
 - the second "this is old enough" assumption was broken again by
   Brian this week ;-)
 - the first "Use NO_REGEX if your regexp library is broken" is a
   reasonable thing to do; is this something we may want to throw
   into the platform specific section of the top-level Makefile?
 - among the fourth, "blame" and "grep" goes line by line, and even
   though pickaxe is primarily meant to take multi-line pattern, I
   do not think people give multi-line pattern when they use it in
   the regexp mode.  So I do not think they pose a real issue even
   though they get an arbitrary pattern from the user.
 - the third, combined with the fact that end user can define their
   own pattern, is a killer.  We cannot really afford to let broken
   regex library to break us.

I think a sensible way to go in the longer term, while we wait these old regexp libraries die out, is to help people to avoid building git without NO_REGEX on platforms where they need it.

Thanks for digging an old article.
Previous: Johannes SixtNext: Ramsay Jones
Message 5 of 10 in “Test failures in t4034”
  1. Brian GernhardtAug 18, 2012
  2. Junio C HamanoAug 19, 2012
  3. Ramsay JonesAug 19, 2012
  4. Johannes SixtAug 19, 2012
  5. Junio C HamanoAug 20, 2012
  6. Ramsay JonesAug 21, 2012
  7. Junio C HamanoAug 21, 2012
  8. Ramsay JonesSep 1, 2012
  9. Junio C HamanoSep 3, 2012
  10. Junio C HamanoAug 19, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.