[Phoenix-pm] [perl #30778] localizing $foo, then glob-aliasing to an LVALUE segfaults when trying to restore.

Scott Walters scott at illogics.org
Thu Jul 22 15:48:49 CDT 2004


Oooh, another coredumper!

-scott

----- Forwarded message from perl5-porters-return-93306-scott=slowass.net at perl.org perlbug-followup at perl.org Thu Jul 22 05: 21: 50 2004 James Mastros <perlbug-followup at perl.org> -----

ID: <rt-3.0.11-30778-92525.1.29717044571009 at perl.org>
List: contact perl5-porters-help at perl.org; run by ezmlm
CC: james at mastros.biz
Checked: Checked
Encoding: utf-8
NewTicket: yes
Status: No, hits=-11.8 required=8.0 No, hits=-6.2 required=7.0
Originator: james at mastros.biz
post: <mailto:perl5-porters at perl.org>
By: la.mx.develooper.com x1.develooper.com
Type: text/plain; charset="utf-8"
Spam-Index: -4.8
Filter-Rule: 
Archive: <http://nntp.perl.org/group/perl.perl5.porters/93306>
help: <mailto:perl5-porters-help at perl.org>
Received: from onion.perl.org (onion.develooper.com [63.251.223.166]) (qmail 14150 invoked by uid 1005); 22 Jul 2004 12:24:08 -0000 (qmail 13409 invoked from network); 22 Jul 2004 12:21:57 -0000
Fog-Index:      7.433
Ticket: perl #30778
Id: <200407221223.i6MCNjI01480 at slowass.net>
Subject: [perl #30778] localizing $foo, then glob-aliasing to an LVALUE segfaults when trying to restore. 
Rating: onion.develooper.com 1.6.2 0/1000/N
unsubscribe: <mailto:perl5-porters-unsubscribe at perl.org>
Date: Thu, 22 Jul 2004 05:23:45 -0700 (PDT) 22 Jul 2004 12:21:43 -0000
by: RT 3.0.11 (http://www.bestpractical.com/rt/)
Version: 1.0
Prevention: perl
Precedence: bulk
To: "mailing list perl5-porters at perl.org moderator for perl5-porters at perl.org perl5-porters at perl.org rt-perl5-testers at x1.develooper.com bugs-perl5-testers at netlabs.develooper.com bugs-bitbucket at netlabs.develooper.com perl5-porters at perl.org perl5-porters at perl.or" <rt-30778 at perl>,
	perl5-porters at perl.org
From: perl5-porters-return-93306-scott=slowass.net at perl.org perlbug-followup at perl.org Thu Jul 22 05: 
	21:  50 2004 James Mastros <perlbug-followup at perl.org>


# New Ticket Created by  James Mastros 
# Please include the string:  [perl #30778]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=30778 >



This is a bug report for perl from james at mastros.biz,
generated with the help of perlbug 1.35 running under perl v5.8.4.


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

Hello, everybody.  I was recently playing with LVALUEs trying to get
exercise 2 of http://perlmonks.org/?node=how's+your+perl?+(II), and managed
to get perl to segfault.  While I was doing strange things with it at the
time, a segfault isn't a good response, ever.

Code:
#!/usr/bin/perl
use warnings;
use Devel::Peek;
$|=1;

{
    local $foo;    # Local *foo instead, and it works.
    my $x;         # Only to shut up warnings -- both lexical and global $x exhibit this behavior
    *foo=\pos($x); # Neccessary
    Dump *foo;
    print "Got here\n";
}
print "Got here\n";
__DATA__

Output:
SV = PVGV(0x8192ef8) at 0x8164ee0
  REFCNT = 5
  FLAGS = (GMG,SMG,MULTI,IN_PAD)
  IV = 0
  NV = 0
  MAGIC = 0x8190960
    MG_VIRTUAL = &PL_vtbl_glob
    MG_TYPE = PERL_MAGIC_glob(*)
    MG_OBJ = 0x8164ee0
  NAME = "foo"
  NAMELEN = 3
  GvSTASH = 0x814cb48   "main"
  GP = 0x8192f30
    SV = 0x8164f40
    REFCNT = 1
    IO = 0x0
    FORM = 0x0
    AV = 0x0
    HV = 0x0
    CV = 0x0
    CVGEN = 0x0
    GPFLAGS = 0x0
    LINE = 7
    FILE = "howsyourperl2.pl_segfault"
    FLAGS = 0xa
    EGV = 0x8164ee0     "foo"
Got here
	
Note the lack of the second "Got here" line.

Backtrace:
(gdb) bt
#0  0x080b27ce in Perl_magic_setpos ()
#1  0x080af335 in Perl_mg_set ()
#2  0x080e76d0 in Perl_leave_scope ()
#3  0x080e5fac in Perl_pop_scope ()
#4  0x080ecfb4 in Perl_pp_leaveloop ()
#5  0x080bbbb9 in Perl_runops_standard ()
#6  0x080635e8 in perl_run ()
#7  0x080633f5 in perl_run ()
#8  0x0805fb9f in main ()

Sorry, I don't have a 5.8.5 or debugging perl handy -- let me know if either
is neccessary.
	    
Thanks!
       -=- James Mastros,
       theorbtwo

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

Configured by Debian Project at Wed May 12 00:32:16 EST 2004.

Summary of my perl5 (revision 5 version 8 subversion 4) configuration:
  Platform:
    osname=linux, osvers=2.4.26-ti1211, archname=i386-linux-thread-multi
    uname='linux kosh 2.4.26-ti1211 #1 sat apr 24 14:46:58 est 2004 i686 gnulinux '
    config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=i386-linux -Dprefix=/usr -Dprivlib=/usr/share/perl/5.8 -Darchlib=/usr/lib/perl/5.8 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.8.4 -Dsitearch=/usr/local/lib/perl/5.8.4 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Uusenm -Duseshrplib -Dlibperl=libperl.so.5.8.4 -Dd_dosuid -des'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='3.3.3 (Debian 20040429)', 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 =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
    perllibs=-ldl -lm -lpthread -lc -lcrypt
    libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libperl.so.5.8.4
    gnulibc_version='2.3.2'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl v5.8.4:
    /etc/perl
    /usr/local/lib/perl/5.8.4
    /usr/local/share/perl/5.8.4
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl/5.8
    /usr/share/perl/5.8
    /usr/local/lib/site_perl
    /usr/local/lib/perl/5.8.3
    /usr/local/share/perl/5.8.3
    /usr/local/lib/perl/5.8.2
    /usr/local/share/perl/5.8.2
    /usr/local/lib/perl/5.8.1
    /usr/local/share/perl/5.8.1
    /usr/local/lib/perl/5.8.0
    /usr/local/share/perl/5.8.0
    .

---
Environment for perl v5.8.4:
    HOME=/home/theorb
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/theorb/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:.
    PERL_BADLANG (unset)
    SHELL=/bin/bash


----- End forwarded message -----



More information about the Phoenix-pm mailing list