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

[perl #128465] set_mro too lazy, permits unmergeable inheritance

From:
Kent Fredric
Date:
June 23, 2016 10:35
Subject:
[perl #128465] set_mro too lazy, permits unmergeable inheritance
Message ID:
rt-4.0.18-13729-1466678141-701.128465-75-0@perl.org
# New Ticket Created by  Kent Fredric 
# Please include the string:  [perl #128465]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=128465 >


This is a bug report for perl from kentnl@cpan.org,
generated with the help of perlbug 1.40 running under perl 5.25.1.


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

calling set_mro( $Package, 'c3' ) where $Package pertains to a class with an unmergeable inheritance.

This means the call succeeds, but the modified class will then die fatally
as soon as somebody invokes "can" or "mro::get_linear_isa"


Attached is a test that demonstrates that set_mro does not fail as expected,

but does fail upon calling ->can() 


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

Configured by kent at Sat May 21 11:49:03 NZST 2016.

Summary of my perl5 (revision 5 version 25 subversion 1) configuration:
   
  Platform:
    osname=linux, osvers=4.4.0-gentoo-r1, archname=x86_64-linux
    uname='linux katipo2 4.4.0-gentoo-r1 #33 smp preempt fri jan 29 01:03:50 nzdt 2016 x86_64 intel(r) core(tm) i5-2410m cpu @ 2.30ghz genuineintel gnulinux '
    config_args='-de -Dprefix=/home/kent/perl5/perlbrew/perls/5.25.1-nossp-sdbm-nopmc -Doptimize= -fno-stack-protector -O3 -march=native -mtune=native -Dman1dir=none -Dman3dir=none -Dusedevel -Accflags= -fno-stack-protector -DPERL_HASH_FUNC_SDBM -DPERL_DISABLE_PMC -Aldflags= -fno-stack-protector -Aeval:scriptdir=/home/kent/perl5/perlbrew/perls/5.25.1-nossp-sdbm-nopmc/bin'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-stack-protector -DPERL_HASH_FUNC_SDBM -DPERL_DISABLE_PMC -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize=' -fno-stack-protector -O3 -march=native -mtune=native',
    cppflags='-fno-stack-protector -DPERL_HASH_FUNC_SDBM -DPERL_DISABLE_PMC -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong'
    ccversion='', gccversion='5.3.0', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags ='  -fno-stack-protector -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include-fixed /usr/lib /usr/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64
    libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.23.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.23'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared  -fno-stack-protector -O3 -march=native -mtune=native -L/usr/local/lib -fstack-protector-strong'


---
@INC for perl 5.25.1:
    /home/kent/perl5/perlbrew/perls/5.25.1-nossp-sdbm-nopmc/lib/site_perl/5.25.1/x86_64-linux
    /home/kent/perl5/perlbrew/perls/5.25.1-nossp-sdbm-nopmc/lib/site_perl/5.25.1
    /home/kent/perl5/perlbrew/perls/5.25.1-nossp-sdbm-nopmc/lib/5.25.1/x86_64-linux
    /home/kent/perl5/perlbrew/perls/5.25.1-nossp-sdbm-nopmc/lib/5.25.1
    .

---
Environment for perl 5.25.1:
    HOME=/home/kent
    LANG=en_NZ.UTF8
    LANGUAGE (unset)
    LC_CTYPE=en_NZ.UTF8
    LC_TIME=en_NZ.UTF8
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/kent/perl5/perlbrew/bin:/home/kent/perl5/perlbrew/perls/5.25.1-nossp-sdbm-nopmc/bin:/home/kent/perl5/perlbrew/bin:/home/kent/perl5/perlbrew/perls/5.22.1-nossp-sdbm-nopmc/bin:/home/kent/.perl6/2013.04/bin:/home/kent/.gem/ruby/1.8/bin/:/home/kent/.rvm/gems/ruby-2.1.2/bin:/home/kent/.rvm/gems/ruby-2.1.2@global/bin:/home/kent/.rvm/rubies/ruby-2.1.2/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/5.3.0:/usr/games/bin:/home/kent/.rvm/bin:/home/kent/.rvm/bin
    PERL5LIB=
    PERLBREW_BASHRC_VERSION=0.74
    PERLBREW_HOME=/home/kent/.perlbrew
    PERLBREW_LIB=
    PERLBREW_MANPATH=/home/kent/perl5/perlbrew/perls/5.25.1-nossp-sdbm-nopmc/man
    PERLBREW_PATH=/home/kent/perl5/perlbrew/bin:/home/kent/perl5/perlbrew/perls/5.25.1-nossp-sdbm-nopmc/bin
    PERLBREW_PERL=5.25.1-nossp-sdbm-nopmc
    PERLBREW_ROOT=/home/kent/perl5/perlbrew
    PERLBREW_VERSION=0.74
    PERL_BADLANG (unset)
    PERL_LOCAL_LIB_ROOT=
    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