Bug#85799: Stack trace
reassign 85799 libc6
retitle 85799 regexec leaks memory
thanks
It looks like this is a libc6 2.2.1-2 bug. Here's a stack trace at the time of
the segfault:
(gdb) whe
#0 0x401c34dd in free () from /lib/libc.so.6
#1 0x40203ff6 in re_match_2 () from /lib/libc.so.6
#2 0x40203b8d in re_search_2 () from /lib/libc.so.6
#3 0x40203973 in re_search () from /lib/libc.so.6
#4 0x402072ac in regexec () from /lib/libc.so.6
#5 0x804fa25 in __eh_alloc ()
#6 0x400620ea in CommandLine::DispatchArg () from /usr/lib/libapt-pkg.so.3.1
#7 0x8051493 in __eh_alloc ()
#8 0x4016febc in __libc_start_main () from /lib/libc.so.6
I can reproduce the problem with a short C program that calls regexec() in a
loop (attached).
--
- mdz
#include <sys/types.h>
#include <regex.h>
int main(void) {
regex_t re;
if (regcomp(&re, "nls", REG_EXTENDED | REG_ICASE | REG_NOSUB) != 0) {
return 1;
}
for(;;)
regexec(&re, "GNU awk, a pattern scanning and processing language
`awk', a program that you can use to select particular records in a
file and perform operations upon them.
.
Gawk is the GNU Project's implementation of the AWK programming language.
It conforms to the definition of the language in the POSIX 1003.2 Command
Language And Utilities Standard. This version in turn is based on the
description in The AWK Programming Language, by Aho, Kernighan, and
Weinberger, with the additional features defined in the System V Release
4 version of UNIX awk. Gawk also provides more recent Bell Labs awk
extensions, and some GNU-specific extensions.
", 0, 0, 0);
}
Reply to: