Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem invoking super class after upgrading from 5.16.2 to 5.18.1

0 views
Skip to first unread message

Michael Gerdau

unread,
Feb 18, 2014, 7:10:33 PM2/18/14
to per...@perl.org
Hi list !

I have some legacy modules originating in the dim past of perl 5.6.x
which is to say there are likely quite a few quirks in the code.

However the stuff used to work up and including until perl 5.16.2
With 5.18.1 under certain circumstances it runs into a recursive loop
and finally stops when all memory is eaten up.

The objects are related like this:
foo
bar inherits from foo

The new() constructor of both does bless them using a stmt
ST(0) = sv_2mortal(sv_bless(newRV_noinc((SV*)hv),stash));
and stash is initialized by
if (sv_isobject(pkg))
stash = SvSTASH(SvRV(pkg));
else
stash = gv_stashsv(pkg, TRUE);
with pkg being the first parameter passed to new().

Both foo and bar also have a sub AUTOLOAD.

Inside the sub AUTOLOAD of bar there is
$self->SUPER::fum(@_)
and fum being a sub of foo.

In 5.16.2 (and all prior versions I tried over the years) this works
as expected by finally invoking foo->fum.

In 5.18.1 (by means of stepping through it in the debugger) the line
$self->SUPER::fum(@_)
inside bar->AUTOLOAD again invokes bar->AUTOLOAD where it hits once
again the line
$self->SUPER::fum(@_)
which again invokes ... and there is a recursive loop.

In both cases @ISA correctly shows foo.

I have read the perldelta.pod of 5.18.0 but nothing I've read there rang
a bell (which could easily have been due to me simply not knowing what
to look for)

Could someone pls provide a pointer where I could look further or
if this isn't the proper list give advice which is ?

Thank you for your time,
Michael
--
Michael Gerdau email: m...@qata.de
GPG-keys available on request or at public keyserver

Jan Dubois

unread,
Feb 18, 2014, 9:24:57 PM2/18/14
to Michael Gerdau, per...@perl.org
On Tue, Feb 18, 2014 at 4:10 PM, Michael Gerdau <m...@qata.de> wrote:
> Hi list !

Hi Michael!

> I have some legacy modules originating in the dim past of perl 5.6.x
> which is to say there are likely quite a few quirks in the code.
>
> The new() constructor of both does bless them using a stmt
> ST(0) = sv_2mortal(sv_bless(newRV_noinc((SV*)hv),stash));
> and stash is initialized by
> if (sv_isobject(pkg))
> stash = SvSTASH(SvRV(pkg));
> else
> stash = gv_stashsv(pkg, TRUE);
> with pkg being the first parameter passed to new().
>
> Both foo and bar also have a sub AUTOLOAD.
>
> Inside the sub AUTOLOAD of bar there is
> $self->SUPER::fum(@_)
> and fum being a sub of foo.

Hey, that looks like some code I have written.. :)

> In 5.16.2 (and all prior versions I tried over the years) this works
> as expected by finally invoking foo->fum.
>
> In 5.18.1 (by means of stepping through it in the debugger) the line
> $self->SUPER::fum(@_)
> inside bar->AUTOLOAD again invokes bar->AUTOLOAD where it hits once
> again the line
> $self->SUPER::fum(@_)
> which again invokes ... and there is a recursive loop.

You are hitting this bug:

https://rt.perl.org/Public/Bug/Display.html?id=120694

It has been fixed in 5.18.2.

Cheers,
-Jan

Michael Gerdau

unread,
Feb 19, 2014, 3:38:28 AM2/19/14
to per...@perl.org
> Hi Michael!

Hallo Jan !

[snip]

> that looks like some code I have written.. :)

I thought you might recognize it :)

> You are hitting this bug:
>
> https://rt.perl.org/Public/Bug/Display.html?id=120694
>
> It has been fixed in 5.18.2.

The bug looks very familiar. Thanks for the pointer. So I will upgrade
to 5.18.2 and all will be fine again.

Best wishes,
0 new messages