This is the mail archive of the
glibc-bugs-regex@sources.redhat.com
mailing list for the glibc project.
[Bug regex/558] New: regcomp and regexec bug
- From: "vprodan dot hosting at artstyle dot ru" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs-regex at sources dot redhat dot com
- Date: 18 Nov 2004 02:06:03 -0000
- Subject: [Bug regex/558] New: regcomp and regexec bug
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
Some regular expressions make regcomp to eat CPU and memory.
Try run date |egrep '.{1,2048}' and enjoy the result if you're patient enough.
Test case:
#include <stdio.h>
#include <regex.h>
int main(void) {
char s[] = "/.{1,2048}.{1,2048}.{1,2048}.{1,2048}.{1,2048}/";
regex_t reg;
int res;
fprintf(stderr, "starting\n");
res = regcomp(®, s, REG_EXTENDED);
fprintf(stderr, "regcomp(®, '%s', REG_EXTENDED) = %d\n", s, res);
}
This bug appeared in between 2.2.5 and 2.3:
> date: 2002/02/27 19:00:56; author: drepper; state: Exp; lines: +7 -8399
> Check in complete rewrite.
--
Summary: regcomp and regexec bug
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: regex
AssignedTo: gotom at debian dot or dot jp
ReportedBy: vprodan dot hosting at artstyle dot ru
CC: glibc-bugs-regex at sources dot redhat dot com,glibc-
bugs at sources dot redhat dot com,vprodan dot hosting
at artstyle dot ru
GCC build triplet: i686-pc-linux-gnu
http://sources.redhat.com/bugzilla/show_bug.cgi?id=558
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.