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

[perl #24271] Segmentation fault caused by capturing regex

Thread Next
From:
perlbug-followup
Date:
October 22, 2003 20:04
Subject:
[perl #24271] Segmentation fault caused by capturing regex
Message ID:
rt-24271-66384.6.04354621823362@rt.perl.org
# New Ticket Created by  pmiguel@purdue.edu 
# Please include the string:  [perl #24271]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=24271 >


This is a bug report for perl from pmiguel@purdue.edu,
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]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
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:
  Platform:
    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
  Compiler:
    cc='gcc', ccflags ='-D_REENTRANT -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O',
    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/libc.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  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:
    /usr/local/lib/perl5/5.8.0/sun4-solaris-thread-multi
    /usr/local/lib/perl5/5.8.0
    /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris-thread-multi
    /usr/local/lib/perl5/site_perl/5.8.0
    /usr/local/lib/perl5/site_perl/5.7.2
    /usr/local/lib/perl5/site_perl/5.6.1
    /usr/local/lib/perl5/site_perl
    .

---
Environment for perl v5.8.0:
    HOME=/home/pmiguel
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/usr/dt/lib:/usr/local/staden_solaris/lib/solaris-binaries:/home/local/oracle/lib:/usr/lib/:/usr/local/lib:/usr/local/stackpack/lib:/usr/local/stackpack/lib.ext:/usr/gcg/gcgbin/oblib
    LOGDIR (unset)
    PATH=.:/home/pmiguel/bin:/home/pmiguel/bin:/usr/local/bin:/opt/SUNWspro/bin:/usr/bin:/usr/openwin/bin:/usr/local/tex/bin:/usr/ccs/bin:/usr/dt/bin:/usr/ucb:/usr/local/stackpack/bin:/usr/j2se/bin:/usr/local/stackpack/bin:/home/local/oracle/bin:/usr/local/staden_solaris/solaris-bin:/usr/local/stackpack/bin:/usr/gcg/gcgcore/script:/usr/gcg/gcgbin/execute
    PERL_BADLANG (unset)
    SHELL=/usr/bin/tcsh


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About