CC: | rafl [...] debian.org |
Subject: | PATCH: Fix for handling stale pads |
Date: | Thu, 6 Jan 2011 11:29:35 -0800 |
To: | bug-padwalker [...] rt.cpan.org |
From: | "David E. Wheeler" <dwheeler [...] cpan.org> |
I ran into a crash in my Plack app using Devel::StackTrace::WithLexicals. I managed to get it down to this relatively simple test case:
#!/usr/bin/env perl
use 5.12.0;
use utf8;
use Devel::StackTrace::WithLexicals;
use Router::Resource;
use Plack::Builder;
builder {
my $mids = [['StackTrace']];
mount '/pub' => builder {
my $router = router {
resource '/' => sub {
GET { die 'WTF'; };
};
};
mount '/' => builder {
enable @{ $_ } for @{ $mids };
sub { $router->dispatch(shift) };
};
};
};
Throw that into a file, then `plackup file.psgi`, then hit http://localhost:5000/pub/ to see the crash appear in the terminal.
Florian Ragwitz took that and broke it down a bit more and came up with the attached patch, which fixes the crash. I guess it was difficult to come up with a test case to put into the PadWalker test suite, but I think he has a simpler test case than the above that he'll reply with in a bit.
Thanks,
David
Message body is not shown because sender requested not to inline it.