develooper Front page | perl.perl5.porters | Postings from November 1999

[ID 19991123.001] Perl segfault w/ specific weird syntax.

Thread Next
From:
Ian Baker
Date:
November 23, 1999 00:27
Subject:
[ID 19991123.001] Perl segfault w/ specific weird syntax.
Message ID:
19991123001213.A766@blue.touchtonesolutions.com

Hi.  I'm running Perl, version 5.005_03 built for i386-linux

I'm getting a segfault under a particular little strange condition.  The
smallest bit of code I've managed to reproduce it with is as follows:

my $var1 = '';
my $var2 = '';
@arr1 = qw( );
sub

If you save that in a file, let's call it bug.pl, and then execute:

perl -e "require 'bug.pl'"

you'll get a segfault (or, at least, I do).  If you just execute it, it's
fine.

The perl syntax here is obviously incorrect, but finding the bit that's
incorrect without any real error messages is a bit vexing.  Of course, this
isn't a big deal, but if one's just hunting for things to fix...  :)

For some reason, the perl distributed with RH6 doesn't seem to have perlbug
with it, so here's the output from perl -V, and below it you'll find a stack
trace of the core file (c/o gdb):

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=linux, osvers=2.2.1-ac1, archname=i386-linux
    uname='linux porky.devel.redhat.com 2.2.1-ac1 #1 smp mon feb 1 17:44:44 est 1999 i686 unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
    cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    stdchar='char', d_stdstdio=undef, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
    libc=, 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'


Characteristics of this binary (from libperl): 
  Built under linux
  Compiled at Apr  6 1999 23:34:07
  @INC:
    /usr/lib/perl5/5.00503/i386-linux
    /usr/lib/perl5/5.00503
    /usr/lib/perl5/site_perl/5.005/i386-linux
    /usr/lib/perl5/site_perl/5.005
    .

And the stack trace:

#0  0x806f73f in Perl_pad_free ()
#1  0x806f903 in Perl_op_free ()
#2  0x806f7fa in Perl_op_free ()
#3  0x806f7fa in Perl_op_free ()
#4  0x809fe67 in Perl_sv_compile_2op ()
#5  0x80a08a1 in Perl_pp_require ()
#6  0x80b148d in Perl_runops_standard ()
#7  0x80592b8 in perl_run ()
#8  0x805782f in main ()
#9  0x400a5cb3 in __libc_start_main (main=0x80577c0 <main>, argc=3, 
    argv=0xbffff8b4, init=0x8056af4 <_init>, fini=0x80b14fc <_fini>, 
    rtld_fini=0x4000a350 <_dl_fini>, stack_end=0xbffff8ac)
    at ../sysdeps/generic/libc-start.c:78

Thanks!
-Ian

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