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

[ID 19991024.001] uninitialized lex as filehandle segmentation fault

Thread Next
From:
skimo
Date:
October 24, 1999 10:23
Subject:
[ID 19991024.001] uninitialized lex as filehandle segmentation fault
Message ID:
19991024172213.9075.qmail@pool.gv.kotnet.org
This is a bug report for perl from skimo@pool.gv.kotnet.org,
generated with the help of perlbug 1.27 running under perl 5.00562.


-----------------------------------------------------------------
[Please enter your report here]

Using an unitialized lexical as a filehandle can result in
a segmentation fault.
I'm sorry for not having a sample program, but I've
identified the guilty parties.

in pp_rv2gv in pp.c
                    GV *gv = (GV *) newSV(0);
                    STRLEN len = 0;
                    char *name = "";
                    if (cUNOP->op_first->op_type == OP_PADSV) {
                        SV *padname = *av_fetch(PL_comppad_name, cUNOP->op_first
->op_targ, 4);
                        name = SvPV(padname,len);

This code creates an sv with a zero SvPVX.

Later on, in S_pad_findlex in op.c,
this results in a segmentation fault.

            if ((sv = svp[off]) &&
                sv != &PL_sv_undef &&
                seq <= SvIVX(sv) &&
                seq > I_32(SvNVX(sv)) &&
                strEQ(SvPVX(sv), name))

skimo

[Please do not change anything below this line]
-----------------------------------------------------------------

---
Site configuration information for perl 5.00562:

Configured by skimo at Fri Oct 15 20:57:29 CEST 1999.

Summary of my perl5 (revision 5.0 version 5 subversion 62) configuration:
  Platform:
    osname=linux, osvers=2.1.125, archname=i586-linux-thread
    uname='linux pool 2.1.125 #24 fri oct 16 13:44:56 mest 1998 i586 unknown '
    config_args='-Doptimize=-g -Dusethreads -Duseshrplib -Dprefix=/usr -des'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define useperlio=undef d_sfio=undef
    use64bits=undef usemultiplicity=undef
  Compiler:
    cc='cc', optimize='-g', gccversion=egcs-2.91.60 19981201 (egcs-1.1.1 release)
    cppflags='-D_REENTRANT -Dbool=char -DHAS_BOOL -DDEBUGGING -fno-strict-aliasing -I/usr/local/include'
    ccflags ='-D_REENTRANT -Dbool=char -DHAS_BOOL -DDEBUGGING -fno-strict-aliasing -I/usr/local/include'
    stdchar='char', d_stdstdio=define, 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 -ldb -ldl -lm -lpthread -lc -lposix -lcrypt
    libc=/lib/libc-2.1.2.so, so=so, useshrplib=true, libperl=libperl.so
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/5.00562/i586-linux-thread/CORE'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl 5.00562:
    /usr/lib/perl5/5.00562/i586-linux-thread
    /usr/lib/perl5/5.00562
    /usr/lib/site_perl/5.00562/i586-linux-thread
    /usr/lib/site_perl
    .

---
Environment for perl 5.00562:
    HOME=/home/skimo
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/skimo/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/openwin/bin:/usr/games/bin:/usr/games:.
    PERL_BADLANG (unset)
    SHELL=/usr/bin/zsh

Message from the perl bug squashing team at 'perlbug@perl.org'

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