Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perl 5.18 breaks AUTOLOADER inheritance #13456

Closed
p5pRT opened this issue Dec 4, 2013 · 8 comments
Closed

perl 5.18 breaks AUTOLOADER inheritance #13456

p5pRT opened this issue Dec 4, 2013 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented Dec 4, 2013

Migrated from rt.perl.org#120694 (status was 'resolved')

Searchable as RT120694$

@p5pRT
Copy link
Author

p5pRT commented Dec 4, 2013

From @jandubois

Created by @jandubois

The Win32​::OLE module has a regression test (t/3_ole.t) that uses
AUTOLOAD inheritance.
It has been working since at least 5.006, and possibly earlier up to 5.16.x, but
is broken in 5.18.0. Here is a simplified test program​:

########################################################################
print bless( [] => "foo" )->plugh, "\n";

package foo;
BEGIN { @​ISA = qw(bar) }

sub AUTOLOAD {
  my $self = shift;
  return if $AUTOLOAD eq 'DESTROY';
  print "foo​::AUTOLOAD​: $AUTOLOAD\n";
  $AUTOLOAD = "SUPER​:" . substr $AUTOLOAD, rindex($AUTOLOAD, '​:');
  return $self->$AUTOLOAD(@​_);
}

package bar;

sub AUTOLOAD {
  print "bar​::AUTOLOAD​: $AUTOLOAD\n";
  return "xyzzy";
}

########################################################################

In perl versions prior to 5.18.0 it prints​:

$ perl ~/tmp/autoload.pl
foo​::AUTOLOAD​: foo​::plugh
bar​::AUTOLOAD​: foo​::SUPER​::plugh
xyzzy
foo​::AUTOLOAD​: foo​::DESTROY
bar​::AUTOLOAD​: foo​::SUPER​::DESTROY

In 5.18.0 it recurses endlessly and puts garbage in $AUTOLOAD​:

$ /usr/local/ActivePerl-5.18/bin/perl ~/tmp/autoload.pl
foo​::AUTOLOAD​: foo​::plugh
foo​::AUTOLOAD​: foo​::SUPER​::?
foo​::AUTOLOAD​: foo​::SUPER​::PER​::
foo​::AUTOLOAD​: foo​::SUPER​::
foo​::AUTOLOAD​: foo​::SUPER​::
foo​::AUTOLOAD​: foo​::SUPER​::
foo​::AUTOLOAD​: foo​::SUPER​::
foo​::AUTOLOAD​: foo​::SUPER​::
foo​::AUTOLOAD​: foo​::SUPER​::
foo​::AUTOLOAD​: foo​::SUPER​::

On Windows the garbage looks different​:

foo​::AUTOLOAD​: foo​::plugh
foo​::AUTOLOAD​: foo​::SUPER​::plugh
foo​::AUTOLOAD​: foo​::SUPER​::PER​::
foo​::AUTOLOAD​: foo​::SUPER​::
foo​::AUTOLOAD​: foo​::SUPER​::
foo​::AUTOLOAD​: foo​::SUPER​::
foo​::AUTOLOAD​: foo​::SUPER​::

Perl Info

Flags:
    category=core
    severity=low

Site configuration information for perl 5.18.1:

Configured by ActiveState at Fri Sep 20 20:12:23 PDT 2013.

Summary of my perl5 (revision 5 version 18 subversion 1) configuration:

  Platform:
    osname=darwin, osvers=10.8.0, archname=darwin-thread-multi-2level
    uname='darwin neko.activestate.com 10.8.0 darwin kernel version
10.8.0: tue jun 7 16:33:36 pdt 2011; root:xnu-1504.15.3~1release_i386
i386 '
    config_args='-ders -Dcc=gcc -Dusethreads -Duseithreads
-Uinstallusrbinperl -Ulocincpth= -Uloclibpth= -Duse64bitint -Ud_poll
-Ui_poll -Ui_libutil -Aldflags=-Wl,-search_paths_first
-Alddlflags=-Wl,-search_paths_first -Accflags=-arch x86_64
-Aldflags=-arch x86_64 -Alddlflags=-arch x86_64
-Accflags=-DUSE_SITECUSTOMIZE -Duselargefiles
-Accflags=-DPERL_RELOCATABLE_INCPUSH -Accflags=-fno-merge-constants
-Dprefix=/usr/local/ActivePerl-5.18
-Dprivlib=/usr/local/ActivePerl-5.18/lib
-Darchlib=/usr/local/ActivePerl-5.18/lib
-Dsiteprefix=/usr/local/ActivePerl-5.18/site
-Dsitelib=/usr/local/ActivePerl-5.18/site/lib
-Dsitearch=/usr/local/ActivePerl-5.18/site/lib -Dsed=/usr/bin/sed
-Duseshrplib -Dcf_by=ActiveState -Dcf_email=support@ActiveState.com'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='/usr/bin/gcc', ccflags ='-fno-common -DPERL_DARWIN
-no-cpp-precomp -arch x86_64 -DUSE_SITECUSTOMIZE
-DPERL_RELOCATABLE_INCPUSH -fno-merge-constants -fno-strict-aliasing
-pipe -fstack-protector',
    optimize='-O3',
    cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN
-no-cpp-precomp -arch x86_64 -DUSE_SITECUSTOMIZE
-DPERL_RELOCATABLE_INCPUSH -fno-merge-constants -fno-strict-aliasing
-pipe -fstack-protector'
    ccversion='', gccversion='Apple LLVM version 5.0 (clang-500.2.79)
(based on LLVM 3.3svn)', 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='/usr/bin/cc -mmacosx-version-min=10.5', ldflags ='
-Wl,-search_paths_first -arch x86_64 -fstack-protector'
    libpth=/usr/lib
    libs=-ldbm -ldl -lm -lutil -lc
    perllibs=-ldl -lm -lutil -lc
    libc=, so=dylib, useshrplib=true, libperl=libperl.dylib
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup
-Wl,-search_paths_first -arch x86_64 -fstack-protector'

Locally applied patches:
    ACTIVEPERL_LOCAL_PATCHES_ENTRY


@INC for perl 5.18.1:
    /Users/jan/Library/ActivePerl-5.18/lib
    /usr/local/ActivePerl-5.18/site/lib
    /usr/local/ActivePerl-5.18/lib
    .


Environment for perl 5.18.1:
    DYLD_LIBRARY_PATH (unset)
    HOME=/Users/jan
    LANG=en_CA.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/local/ActivePerl-5.18/bin:/usr/local/heroku/bin:/usr/local/var/rbenv/shims:/Users/jan/bin:/Users/jan/Dropbox/bin:/Users/jan/Library/ActivePerl-5.16/bin:/usr/local/ActivePerl-5.16/site/bin:/usr/local/ActivePerl-5.16/bin:/Users/jan/Library/Python/2.7/bin:/usr/local/bin:/usr/local/share/npm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Dec 5, 2013

From @jkeenan

On Wed Dec 04 14​:03​:25 2013, jdb wrote​:

This is a bug report for perl from jand@​activestate.com,
generated with the help of perlbug 1.39 running under perl 5.18.1.

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

The Win32​::OLE module has a regression test (t/3_ole.t) that uses
AUTOLOAD inheritance.
It has been working since at least 5.006, and possibly earlier up to
5.16.x, but
is broken in 5.18.0. Here is a simplified test program​:

########################################################################
print bless( [] => "foo" )->plugh, "\n";

package foo;
BEGIN { @​ISA = qw(bar) }

sub AUTOLOAD {
my $self = shift;
return if $AUTOLOAD eq 'DESTROY';
print "foo​::AUTOLOAD​: $AUTOLOAD\n";
$AUTOLOAD = "SUPER​:" . substr $AUTOLOAD, rindex($AUTOLOAD, '​:');
return $self->$AUTOLOAD(@​_);
}

package bar;

sub AUTOLOAD {
print "bar​::AUTOLOAD​: $AUTOLOAD\n";
return "xyzzy";
}

########################################################################

In perl versions prior to 5.18.0 it prints​:

$ perl ~/tmp/autoload.pl
foo​::AUTOLOAD​: foo​::plugh
bar​::AUTOLOAD​: foo​::SUPER​::plugh
xyzzy
foo​::AUTOLOAD​: foo​::DESTROY
bar​::AUTOLOAD​: foo​::SUPER​::DESTROY

In 5.18.0 it recurses endlessly and puts garbage in $AUTOLOAD​:

$ /usr/local/ActivePerl-5.18/bin/perl ~/tmp/autoload.pl
foo​::AUTOLOAD​: foo​::plugh
foo​::AUTOLOAD​: foo​::SUPER​::?
foo​::AUTOLOAD​: foo​::SUPER​::PER​::
foo​::AUTOLOAD​: foo​::SUPER​::
foo​::AUTOLOAD​: foo​::SUPER​::
foo​::AUTOLOAD​: foo​::SUPER​::
foo​::AUTOLOAD​: foo​::SUPER​::
foo​::AUTOLOAD​: foo​::SUPER​::
foo​::AUTOLOAD​: foo​::SUPER​::
foo​::AUTOLOAD​: foo​::SUPER​::

Confirmed on blead on the dromedary server (linux x86_64).

On Windows the garbage looks different​:

foo​::AUTOLOAD​: foo​::plugh
foo​::AUTOLOAD​: foo​::SUPER​::plugh
foo​::AUTOLOAD​: foo​::SUPER​::PER​::
foo​::AUTOLOAD​: foo​::SUPER​::
foo​::AUTOLOAD​: foo​::SUPER​::
foo​::AUTOLOAD​: foo​::SUPER​::
foo​::AUTOLOAD​: foo​::SUPER​::

@p5pRT
Copy link
Author

p5pRT commented Dec 5, 2013

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Dec 5, 2013

From @andk

"James E Keenan via RT" <perlbug-followup@​perl.org> writes​:

Confirmed on blead on the dromedary server (linux x86_64).

Bisected to v5.17.3-467-gaae4380

  commit aae4380
  Author​: Father Chrysostomos <sprout@​cpan.org>
  Date​: Mon Sep 17 16​:24​:40 2012 -0700

  [perl #114924] Make method calls work with :​:SUPER packages

--
andreas

@p5pRT
Copy link
Author

p5pRT commented Dec 5, 2013

From @cpansprout

FIxed in 257dc59.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Dec 5, 2013

@cpansprout - Status changed from 'open' to 'resolved'

@p5pRT p5pRT closed this as completed Dec 5, 2013
@p5pRT
Copy link
Author

p5pRT commented Dec 5, 2013

From @rjbs

* Father Chrysostomos via RT <perlbug-followup@​perl.org> [2013-12-05T09​:16​:13]

FIxed in 257dc59.

Suggested for 5.18.2?

--
rjbs

@p5pRT
Copy link
Author

p5pRT commented Dec 5, 2013

From perl5-porters@perl.org

Ricardo Signes wrote​:

* Father Chrysostomos via RT <perlbug-followup@​perl.org> [2013-12-05T09​:16​:13]

FIxed in 257dc59.

Suggested for 5.18.2?

Yes, that's a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant