Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 99811
Status: resolved
Priority: 0/
Queue: Devel-StackTrace

People
Owner: Nobody in particular
Requestors: ribasushi [...] leporine.io
Cc: ether [...] cpan.org
mst [...] shadowcat.co.uk
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: 2.00



CC: mst [...] shadowcat.co.uk, ether [...] cpan.org
Subject: Constructing a stacktrace within a DESTROY callchain aborts garbage collection, rerunning the destructor at a later point
Contrived example - note GlobalDestruction is only invoked here for brevity, it is completely possible to have the same issue within normal runtime. ~$ perl -MDevel::StackTrace -e ' sub DESTROY { warn "calling destructor and doing foo"; main::foo() }; { my $trace; sub foo { $trace = Devel::StackTrace->new }; { my $obj_to_be_destroyed = bless {} } print $trace->as_string } print "the end\n" ' The fix (as per https://github.com/dbsrgits/dbix-class/pull/63#issuecomment-60512767) is: Devel::StacklTrace must be adjusted to detect it is constructing a stacktrace from within DESTROY (by examining (caller($n))[3] and not create any new refs to the refaddr of the argument to any DESTROY frames found. This issue is also likely the real underlying reason for https://rt.cpan.org/Ticket/Display.html?id=99095
As a side note, Moose now (as of 2.1400) passes no_ref => 1 to the constructor when creating exception objects.