The Regexp module segfaults on too big data
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=2764
Reported by Johan H Sundström, IDA jhs@pike.ida.liu.se
The Regexp module dumps core on too big datasets (how big seems to vary with architecture - on megalon, this is the limit; other machines have different choking points). I have narrowed down my problem to this test case (original regexp was more useful, as in "^@(([^@]|@@)*)@"):
> pike -e 'Regexp("^(.)*")->split(" "*24952)'
zsh: segmentation fault (core dumped)
> gdb =pike core
GNU gdb 20000110
[...]
This GDB was configured as "i386-pc-solaris2.7"...
Core was generated by `pike -e Regexp("^(.)*")->split(" "*65952)'.
Program terminated with signal 9, Killed.
[...]
Reading symbols
from /usr/local/pike/7.2.220/lib/modules/___Regexp.so...done.
#0 0xdeeb2275 in regmatch (prog=0x8267d62 "\a")
at /home/per/src/Pike/7.2/src/modules/Regexp/pike_regexp.c:888
888 /home/per/src/Pike/7.2/src/modules/Regexp/pike_regexp.c: No such
file or directory.
(gdb) bt
#0 0xdeeb2275 in regmatch (prog=0x8267d62 "\a")
at /home/per/src/Pike/7.2/src/modules/Regexp/pike_regexp.c:888
#1 0xdeeb2321 in regmatch (prog=0x8267d59 "\006")
at /home/per/src/Pike/7.2/src/modules/Regexp/pike_regexp.c:1043
#2 0xdeeb22cb in regmatch (prog=0x8267d56 "\025")
at /home/per/src/Pike/7.2/src/modules/Regexp/pike_regexp.c:1023
#3 0xdeeb2482 in regmatch (prog=0x8267d62 "\a")
at /home/per/src/Pike/7.2/src/modules/Regexp/pike_regexp.c:973
#4 0xdeeb2321 in regmatch (prog=0x8267d59 "\006")
at /home/per/src/Pike/7.2/src/modules/Regexp/pike_regexp.c:1043
#5 0xdeeb22cb in regmatch (prog=0x8267d56 "\025")
at /home/per/src/Pike/7.2/src/modules/Regexp/pike_regexp.c:1023
(loop continues)