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

[ID 20011029.062] CPAN shell Segmentation fault

From:
David Dyck
Date:
October 29, 2001 10:04
Subject:
[ID 20011029.062] CPAN shell Segmentation fault
Message ID:
200110291904.LAA11043@dd.tc.fluke.com
This is a bug report for perl from dcd@tc.fluke.com,
generated with the help of perlbug 1.33 running under perl v5.7.2.


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

[ Anything that causes a seg fault is a bug in the core, wouldn't you agree? ]

I just noticed my cpan script is dumping core.  It doesn't do this from
the command line, but only when reading from a file, and it doesn't dump
core when the trailing semicolon is omited.  It also doesn't dump core
if the leading '1;' is omitted

$ echo '1; use CPAN; shell;' > cpan.script4
$ perl  cpan.script4       

cpan shell -- CPAN exploration and modules installation (v1.59_56)
ReadLine support enabled

cpan> q
Lockfile removed.
Segmentation fault (core dumped)

when run under gdb "where" reports
#0  0x4003cafa in PerlIO_fd_refcnt ()
#1  0x84c35a0 in PerlIO_fd_refcnt ()
#2  0x80fe50d in PerlIO_close (f=0x812e0cc) at perlio.c:1095
#3  0x80fbdc3 in PerlIO_cleanup () at perlio.c:463
#4  0x805c233 in perl_destruct (my_perl=0x81279e8) at perl.c:464
#5  0x805b446 in main (argc=2, argv=0xbffff464, env=0xbffff470)
    at perlmain.c:78
#6  0x805b31e in _start ()

if it helps, after the "q" is typed to the cpan shell,
PerlIO_close() is called 5 times before the crash

Breakpoint 1, PerlIO_close (f=0x812e0d8) at perlio.c:1095
1095            code = (*PerlIOBase(f)->tab->Close) (f);
(gdb) c
Continuing.

Breakpoint 1, PerlIO_close (f=0x812e0dc) at perlio.c:1095
1095            code = (*PerlIOBase(f)->tab->Close) (f);
(gdb) 
Continuing.

Breakpoint 1, PerlIO_close (f=0x812e0d0) at perlio.c:1095
1095            code = (*PerlIOBase(f)->tab->Close) (f);
(gdb) 
Continuing.

Breakpoint 1, PerlIO_close (f=0x812e0d4) at perlio.c:1095
1095            code = (*PerlIOBase(f)->tab->Close) (f);
(gdb) 
Continuing.

Breakpoint 1, PerlIO_close (f=0x812e0cc) at perlio.c:1095
1095            code = (*PerlIOBase(f)->tab->Close) (f);
(gdb) 
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x4003cafa in PerlIO_fd_refcnt ()



[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=high
---
Site configuration information for perl v5.7.2:

Configured by dcd at Sun Oct 28 21:29:24 PST 2001.

Summary of my perl5 (revision 5.0 version 7 subversion 2 patch 12751) configuration:
  Platform:
    osname=linux, osvers=2.4.13-ac4, archname=i686-linux
    uname='linux dd 2.4.13-ac4 #1 sun oct 28 18:37:55 pst 2001 i686 '
    config_args='-Dinstallusrbinperl -Uversiononly -Dusedevel -Doptimize=-O3 -g -de -Dcf_email=dcd@tc.fluke.com'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=define
  Compiler:
    cc='cc', ccflags ='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O3 -g',
    cppflags='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='egcs-2.91.66.1 19990314/Linux (egcs-1.1.2 release)', 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=4
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lgdbm -ldbm -ldb -ldl -lm -lc
    perllibs=-ldl -lm -lc
    libc=/lib/libc.so.5.4.44, 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:
    DEVEL12717

---
@INC for perl v5.7.2:
    /usr/local/lib/perl5/5.7.2/i686-linux
    /usr/local/lib/perl5/5.7.2
    /usr/local/lib/perl5/site_perl/5.7.2/i686-linux
    /usr/local/lib/perl5/site_perl/5.7.2
    /usr/local/lib/perl5/site_perl/5.6.1/i686-linux
    /usr/local/lib/perl5/site_perl/5.6.1
    /usr/local/lib/perl5/site_perl
    .

---
Environment for perl v5.7.2:
    HOME=/home/dcd
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/dcd/bin:/sbin:/usr/local/bin:/bin:/usr/bin:/usr/X11/bin:/usr/games:/usr/local/samba:/home/hobbes/tools/scripts:/home/hobbes/tools/linux:/usr0/hobbes/tools/scripts:/usr0/dcd/bin:/apps/general/bin:/usr/public
    PERL_BADLANG (unset)
    SHELL=/bin/bash




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