develooper Front page | perl.perl5.porters | Postings from March 2007

[perl #42166] panic copying freed scalar in Carp::Heavy

From:
david @ mongueurs . net
Date:
March 29, 2007 23:58
Subject:
[perl #42166] panic copying freed scalar in Carp::Heavy
Message ID:
rt-3.6.HEAD-1687-1175178786-989.42166-75-0@perl.org
# New Ticket Created by  david@mongueurs.net 
# Please include the string:  [perl #42166]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42166 >


This is a bug report for perl from david@landgren.net,
generated with the help of perlbug 1.35 running under perl 5.9.5.


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

Passing @ARGV to a function, and then shifting @ARGV directly and carping the value
results in rather strang errors:

In blead:
david@profane:~/perl% perl5.9.5 -MCarp -le 'f(@ARGV); sub f { my $x = shift(@ARGV); carp($x)}' a v
panic: attempt to copy freed scalar 8134d84 to 8164194 at /usr/local/lib/perl5/5.9.5/Carp/Heavy.pm line 104.

in 5.8.8:
david@profane:~/perl% perl -MCarp -le 'f(@ARGV); sub f { my $x = shift(@ARGV); carp($x)}' a v
Bizarre copy of ARRAY in sassign at /usr/local/lib/perl5/5.8.8/Carp/Heavy.pm line 45.

Someone posted this to Perlmonks:

  http://www.perlmonks.org/index.pl?node_id=607210

David

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl 5.9.5:

Configured by david at Fri Mar 23 09:23:03 CET 2007.

Summary of my perl5 (revision 5 version 9 subversion 5 patch 30712) configuration:
  Platform:
    osname=freebsd, osvers=6.0-stable, archname=i386-freebsd
    uname='freebsd profane.mongueurs.net 6.0-stable freebsd 6.0-stable #5: fri feb 24 11:12:56 cet 2006 root@profane.mongueurs.net:usrobjusrsrcsysprofane i386 '
    config_args='-de -Dusemymalloc -Dusedevel -Duseithreads -Accflags=-DPERL_COPY_ON_WRITE -DPERL_DONT_CREATE_GVSV'
    hint=previous, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=y, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DPERL_DONT_CREATE_GVSV -fno-strict-aliasing -pipe -I/usr/local/include -DPERL_DONT_CREATE_GVSV -DPERL_COPY_ON_WRITE',
    optimize='-O',
    cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -DPERL_DONT_CREATE_GVSV -fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='3.4.4 [FreeBSD] 20050518', 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=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags ='-Wl,-E  -L/usr/local/lib'
    libpth=/usr/lib /usr/local/lib
    libs=-lgdbm -lm -lcrypt -lutil -lc
    perllibs=-lm -lcrypt -lutil -lc
    libc=, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-DPIC -fPIC', lddlflags='-shared  -L/usr/local/lib'

Locally applied patches:
    DEVEL

---
@INC for perl 5.9.5:
    /usr/local/lib/perl5/5.9.5/i386-freebsd
    /usr/local/lib/perl5/5.9.5
    /usr/local/lib/perl5/site_perl/5.9.5/i386-freebsd
    /usr/local/lib/perl5/site_perl/5.9.5
    /usr/local/lib/perl5/site_perl
    .

---
Environment for perl 5.9.5:
    HOME=/home/david
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/home/david/bin:.
    PERL_BADLANG (unset)
    SHELL=/usr/local/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