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

Re: Confused by eval behavior

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
July 18, 2016 15:37
Subject:
Re: Confused by eval behavior
Message ID:
20160718153724.GL3477@iabyn.com
On Sun, Jul 03, 2016 at 10:28:22PM +0100, Dave Mitchell wrote:
> On Sat, Jul 02, 2016 at 10:08:36PM +1200, Kent Fredric wrote:
> > On 2 July 2016 at 21:37, Andreas Koenig
> > <andreas.koenig.7os6VVqR@franz.ak.mind.de> wrote:
> > > I'd vote for reverting the change and putting it in a branch until
> > > Variable::Magic has got the right medicine.
> > 
> > 
> > +1: Variable::Magic not being broken very much should be a blocking condition.
> 
> Now reverted with v5.25.2-89-gcc040a9
> 
> The failing Variable::Magic test can be reduced to:
> 
>     use Variable::Magic qw<wizard cast>;
> 
>     my $wiz2 = wizard;
>     my $wiz1 = wizard free => sub { warn "recasting\n"; &cast($_[0], $wiz2); die; };
> 
>     eval {
>      my $v = do { my $val = 123; \$val };
>      &cast($v, $wiz1);
>     };
> 
> When $v goes out scope, the free magic method is called, which attached
> new magic then dies. vmg_call_sv catches the error, then croaks.
> The croak calls die_unwind, which now does FREETMPS, which triggers
> another call to the free method, and so it recurses infinitely.
> 
> I haven't looked closely to see what is being freed by the FREETMPS and
> why.

Vincent, will you have any opportunity to look at this?

-- 
If life gives you lemons, you'll probably develop a citric acid allergy.

Thread Previous | Thread Next


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