develooper Front page | perl.perl5.porters | Postings from July 2013

[perl #119051] SEGFAULT when trying to reference a non-code ref as a code ref

Thread Previous
From:
Kent Fredric
Date:
July 28, 2013 14:21
Subject:
[perl #119051] SEGFAULT when trying to reference a non-code ref as a code ref
Message ID:
rt-3.6.HEAD-2552-1375021300-93.119051-75-0@perl.org
# New Ticket Created by  Kent Fredric 
# Please include the string:  [perl #119051]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=119051 >


This is a bug report for perl from kentfredric@gmail.com,
generated with the help of perlbug 1.39 running under perl 5.19.2.


-----------------------------------------------------------------
[Please describe your issue here]

The following code snippet causes Perl to segfault :

$Foo::nosub  = undef;
my $ref =  *Foo::->{nosub};
my $deref = \&$ref;

warnings and string pragmas have no impact on behaviour.

Granted, this code is somewhat illogical.

Fails on 5.18 and 5.19.2 , but not on 5.16.0

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

Configured by kent at Mon Jul 29 02:03:47 NZST 2013.

Summary of my perl5 (revision 5 version 19 subversion 2) configuration:

  Platform:
    osname=linux, osvers=3.10.0-gentoo, archname=x86_64-linux
    uname='linux katipo2 3.10.0-gentoo #38 smp fri jul 5 08:22:15 nzst
2013 x86_64 intel(r) core(tm) i5-2410m cpu @ 2.30ghz genuineintel
gnulinux '
    config_args='-de
-Dprefix=/home/kent/perl5/perlbrew/perls/perl-5.19.2 -Dusedevel
-Aeval:scriptdir=/home/kent/perl5/perlbrew/perls/perl-5.19.2/bin'
    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=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -pipe -fstack-protector'
    ccversion='', gccversion='4.7.2', 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 =' -fstack-protector'
    libpth=/lib/../lib64 /usr/lib/../lib64 /lib /usr/lib /lib64 /usr/lib64
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.15.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.15'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -fstack-protector'


---
@INC for perl 5.19.2:
    /home/kent/perl5/perlbrew/perls/perl-5.19.2/lib/site_perl/5.19.2/x86_64-linux
    /home/kent/perl5/perlbrew/perls/perl-5.19.2/lib/site_perl/5.19.2
    /home/kent/perl5/perlbrew/perls/perl-5.19.2/lib/5.19.2/x86_64-linux
    /home/kent/perl5/perlbrew/perls/perl-5.19.2/lib/5.19.2
    .

---
Environment for perl 5.19.2:
    HOME=/home/kent
    LANG (unset)
    LANGUAGE (unset)
    LC_CTYPE=en_NZ.UTF8
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/kent/perl5/perlbrew/bin:/home/kent/perl5/perlbrew/perls/perl-5.19.2/bin:/home/kent/.perl6/2013.04/bin:/home/kent/.gem/ruby/1.8/bin/:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.7.2:/usr/games/bin
    PERLBREW_BASHRC_VERSION=0.61
    PERLBREW_HOME=/home/kent/.perlbrew
    PERLBREW_MANPATH=/home/kent/perl5/perlbrew/perls/perl-5.19.2/man
    PERLBREW_PATH=/home/kent/perl5/perlbrew/bin:/home/kent/perl5/perlbrew/perls/perl-5.19.2/bin
    PERLBREW_PERL=perl-5.19.2
    PERLBREW_ROOT=/home/kent/perl5/perlbrew
    PERLBREW_VERSION=0.61
    PERL_BADLANG (unset)
    SHELL=/bin/bash


Thread Previous


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