develooper Front page | perl.perl5.porters | Postings from April 2003

[perl #21922] regexp segfault

Thread Next
April 9, 2003 19:07
[perl #21922] regexp segfault
Message ID:
# New Ticket Created by 
# Please include the string:  [perl #21922]
# in the subject line of all future correspondence about this issue. 
# <URL: >

This is a bug report for perl from,
generated with the help of perlbug 1.34 running under perl v5.8.0.

[Please enter your report here]

$ perl -e '$_ = " " x 50000; /(?:  |)*/'
Segmentation fault
$ perl -e '$_ = " " x 50000; /(?:  |a)*/'
Segmentation fault
$ perl -e '$_ = " " x 50000; /(?: |aa)*/'
Segmentation fault
$ perl -e '$_ = " " x 50000; /(?:aa|[^a])*/'
Segmentation fault
$ perl -e '$_ = " " x 50000; /(?:ab|[^c])*/'
Segmentation fault

There a lot of other regexps like these which also die by segfault
if string is long enough (usually string should be >4100 bytes,
but critical string size depend on environment [perl binary?]).

I've tested this bug on perl 5.8.0 and 5.6.1.

I've extracted these simple examples from very very big regexp.
And I don't really understand what and why happens.

[Please do not change anything below this line]
Site configuration information for perl v5.8.0:

Configured by root at Tue Feb 11 17:22:15 EET 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
    osname=linux, osvers=2.4.19, archname=i686-linux-thread-multi
    uname='linux home.power 2.4.19 #1 ×ÓË Á×Ç 18 00:22:21 eest 2002 i686 unknown '
    config_args='-Dprefix=/usr -Doptimize= -O3 -march=athlon -mcpu=athlon  -d -e -s -Dinstallprefix=/usr -Dusethreads'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize=' -O3 -march=athlon -mcpu=athlon ',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing'
    ccversion='', gccversion='3.0', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -ldbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil
    libc=/lib/, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:

@INC for perl v5.8.0:

Environment for perl v5.8.0:
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About