Skip Menu |

This queue is for tickets about the Devel-OverloadInfo CPAN distribution.

Report information
The Basics
Id: 106379
Status: resolved
Priority: 0/
Queue: Devel-OverloadInfo

People
Owner: Nobody in particular
Requestors: ribasushi [...] leporine.io
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in:
  • 0.003
  • 0.004



Subject: [Need workaround] Calling overload::Overloaded() can corrupt fallback on 5.8.x instanceless classes
See below reproducible (albeit convoluted) case. This is the root cause of Moose starting to crap itself on 5.8.x when ::WithOverloading got cored. --- ~$ perl -e ' use strict; use warnings; { package Foo; # *MUST* be a deref overload standalone, any additional will not do use overload "%{}" => sub { sub {} }, fallback => 1; } { package SubFoo0; use base "Foo"; } { package SubFoo1; use base "Foo"; } for my $peek_overload (0, 1) { my $class = "SubFoo$peek_overload"; if( $peek_overload ) { # if we make an object before calling overload::Overloaded - we are golden # it iss likely some sort of workaround lies this way #bless {}, $class; require Devel::OverloadInfo; Devel::OverloadInfo::overload_info($class); # same effect as above, D::OI is not really needed # overload::Overloaded($class) } my $x = bless {}, $class; warn "Foo!\n" if $x; } '
CC: undisclosed-recipients:;
Subject: Re: [rt.cpan.org #106379] [Need workaround] Calling overload::Overloaded() can corrupt fallback on 5.8.x instanceless classes
Date: Wed, 12 Aug 2015 15:49:51 +0100
To: bug-Devel-OverloadInfo [...] rt.cpan.org
From: ilmari [...] ilmari.org (Dagfinn Ilmari Mannsåker)
"Peter Rabbitson via RT" <bug-Devel-OverloadInfo@rt.cpan.org> writes: Show quoted text
> # if we make an object before calling overload::Overloaded - we are golden > # it iss likely some sort of workaround lies this way > #bless {}, $class;
I went down this route, and it turned out to be even more convoluted than just that, due to tickling other bugs and limitations in perls before 5.12 and 5.18. The current incarnation, which passes on all major versions is here: https://github.com/ilmari/Devel-OverloadInfo/commit/bless-workaround -- - Twitter seems more influential [than blogs] in the 'gets reported in the mainstream press' sense at least. - Matt McLeod - That'd be because the content of a tweet is easier to condense down to a mainstream media article. - Calle Dybedahl
CC: undisclosed-recipients:;
Subject: Re: [rt.cpan.org #106379] [Need workaround] Calling overload::Overloaded() can corrupt fallback on 5.8.x instanceless classes
Date: Wed, 12 Aug 2015 21:46:09 +0100
To: bug-Devel-OverloadInfo [...] rt.cpan.org
From: ilmari [...] ilmari.org (Dagfinn Ilmari Mannsåker)
""(Dagfinn Ilmari Mannsåker)" via RT" <bug-Devel-OverloadInfo@rt.cpan.org> writes: Show quoted text
> I went down this route, and it turned out to be even more convoluted > than just that, due to tickling other bugs and limitations in perls > before 5.12 and 5.18.
Then I relised that the root of the problem was the ->can call in overload::Overloaded() before 5.16, and fixed it in a much simpler way by avoiding that on the affected versions, like so: return {} unless "$]" >= 5.016 ? overload::Overloaded($class) : stash_with_symbol($class, '&()'); Released as v0.003. -- - Twitter seems more influential [than blogs] in the 'gets reported in the mainstream press' sense at least. - Matt McLeod - That'd be because the content of a tweet is easier to condense down to a mainstream media article. - Calle Dybedahl
Fixed in v0.003