Bug 874 - regcomp regression
Summary: regcomp regression
Alias: None
Product: glibc
Classification: Unclassified
Component: regex (show other bugs)
Version: unspecified
: P2 critical
Target Milestone: ---
Assignee: GOTO Masanori
Depends on:
Reported: 2005-04-26 09:49 UTC by Jan de Groot
Modified: 2005-04-26 13:15 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Jan de Groot 2005-04-26 09:49:02 UTC
The regcomp function in current CVS and Fedora rawhide no longer accepts
dual-bracket regular expressions.

This piece of code works on GNU libc <= 2.3.5, FreeBSD and OpenBSD without
problems, but with the additional regcomp change that has been done to CVS this
piece of code returns 7, which means a problem with brackets (missing ] while
opened with [ for example). This issue also affects tools like grep.

#include <sys/types.h>
#include <regex.h>
#include <stdlib.h>
#include <stdio.h>

main (int argc, char **argv)
  int err;
  regex_t r;
  err = regcomp (&r, "[[:space:]]", REG_EXTENDED);
  if (err != 0) {
    printf("%d\n", err);
  return 0;
Comment 1 Jakub Jelinek 2005-04-26 10:31:32 UTC
Does that testcase really file for you?
I can't reproduce this on Fedora glibc-2.3.5-1 on i686 nor with CVS glibc
on x86-64.  regcomp in all cases returns 0.
Comment 2 Jan de Groot 2005-04-26 10:46:31 UTC
I get this behaviour with glibc-20050415T0909 as found in Fedora rawhide CVS.
Currently recompiling with other options to make sure it isn't a compile f*ckup
instead of a real bug.
Comment 3 Jan de Groot 2005-04-26 13:15:32 UTC
Seems this bug is caused by specific options in ./configure our glibc package
maintainer didn't check.

I changed the build parameters for ./configure to use exactly the same lines as
the specfile in fedora CVS says and now it works fine.