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

[perl #24271] Segmentation fault caused by capturing regex

Thread Next
October 22, 2003 20:04
[perl #24271] Segmentation fault caused by capturing regex
Message ID:
# New Ticket Created by 
# Please include the string:  [perl #24271]
# 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]
The following script generates a "Segmentation fault":

#!/usr/bin/perl -w
$_ = "12 24\n" x 3176;  
/(\d+[\n ]+)*/g;        

If "x 3176" is replaced with "x 3175" or any lower repetition there
is no Segmentation fault.

But the "x 3176" limit is specific to this machine. The same version of
perl running on a bigger Sun machine running SunOS 5.9 does not 
segmentation fault until "x 3177". A Mac OSX cluster running  perl, v5.6.0 
gives a segmentation fault at "x 286".

The following script generates a "Segementation fault" on every machine I've
tried it on:

#!/usr/bin/perl -w
for ($i=200; $i < 1000000; $i++) {
        $_ = "12 24\n" x $i;    
        print $i, "\n";
        /(\d+[\n ]+)*/g;

Phillip SanMiguel

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

Configured by babernat at Thu May 29 14:53:33 EST 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
    osname=solaris, osvers=2.8, archname=sun4-solaris-thread-multi
    uname='sunos silverjack 5.8 generic_108528-14 sun4u sparc sunw,ultra-4 '
    config_args='-des -Dcc=gcc -Dusethreads -Duselargefiles'
    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='gcc', ccflags ='-D_REENTRANT -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    cppflags='-D_REENTRANT -fno-strict-aliasing'
    ccversion='', gccversion='3.2.2', gccosandvers='solaris2.8'
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib '
    libpth=/usr/local/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -lgdbm -ldb -ldl -lm -lrt -lpthread -lc
    perllibs=-lsocket -lnsl -ldl -lm -lrt -lpthread -lc
    libc=/lib/, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'

Locally applied patches:

@INC for perl v5.8.0:

Environment for perl v5.8.0:
    LANG (unset)
    LANGUAGE (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