develooper Front page | perl.perl5.porters | Postings from June 2011

[perl #93320] local'izing @DB::args leads to coredump

Sergey Aleynikov
June 22, 2011 12:32
[perl #93320] local'izing @DB::args leads to coredump
Message ID:
# New Ticket Created by  Sergey Aleynikov 
# Please include the string:  [perl #93320]
# 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.39 running under perl 5.14.0.

[Please describe your issue here]

The following script produces core dump on perls from 5.8.8 to 5.14.0

sub cl{
    package DB;
    @DB::args = ();
    return caller(shift);

sub f{
    local @DB::args;
    my @z = cl($_) for (1..3);

f(1,2,3); f(1,2,3);

GDB stack trace is

(gdb) bt
#0  0x0000000800b7e376 in memcpy () from /lib/
#1  0x00000000004bf4a1 in Perl_pp_caller () at pp_ctl.c:1965
#2  0x000000000048ce23 in Perl_runops_standard () at run.c:41
#3  0x0000000000430417 in perl_run (my_perl=Variable "my_perl" is not
) at perl.c:2350
#4  0x000000000041cc69 in main (argc=2, argv=0x7fffffffe998,
# env=0x7fffffffe9b0) at perlmain.c:120
(gdb) f 1
#1  0x00000000004bf4a1 in Perl_pp_caller () at pp_ctl.c:1965
1965            Copy(AvALLOC(ary), AvARRAY(PL_dbargs), AvFILLp(ary) + 1 + off, SV*);
(gdb) p PL_dbargs
$1 = (AV *) 0x703ac0
(gdb) p AvARRAY(PL_dbargs)
$2 = (SV **) 0x1

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

Configured by inferno at Mon May 16 12:53:09 MSD 2011.

Summary of my perl5 (revision 5 version 14 subversion 0) configuration:
    osname=freebsd, osvers=7.3-stable, archname=amd64-freebsd
    uname='freebsd 7.3-stable freebsd 7.3-stable #2: wed oct 13 22:55:27 msd 2010 amd64 '
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=y, bincompat5005=undef
    cc='cc', ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include',
    optimize='-O -g -ggdb3',
    cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.2.1 20070719  [FreeBSD]', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags ='-Wl,-E  -fstack-protector -L/usr/local/lib'
    libpth=/usr/lib /usr/local/lib
    libs=-lgdbm -ldb -lm -lcrypt -lutil -lc
    perllibs=-lm -lcrypt -lutil -lc
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-DPIC -fPIC', lddlflags='-shared  -L/usr/local/lib -fstack-protector'

Locally applied patches:

@INC for perl 5.14.0:

Environment for perl 5.14.0:
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)
    SHELL=/usr/local/bin/zsh Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About