Skip Menu |

This queue is for tickets about the indirect CPAN distribution.

Report information
The Basics
Id: 47902
Status: resolved
Priority: 0/
Queue: indirect

People
Owner: Nobody in particular
Requestors: zefram [...] fysh.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.16
Fixed in: 0.17



Subject: "no indirect" leaking again
Date: Wed, 15 Jul 2009 12:45:50 +0100
To: bug-indirect [...] rt.cpan.org
From: Zefram <zefram [...] fysh.org>
With indirect 0.16, the effect of "no indirect" is leaking into required modules in some cases. It doesn't happen in the simplest cases: $ perl -le 'no indirect ":fatal"; use Time::HiRes; print 1' 1 $ Time::HiRes does a "bootstrap Time::HiRes;", which is not being affected. But in more complicated cases, with multiple modules, some doing "no indirect" and requiring other modules, eventually I've had the "bootstrap Time::HiRes;" fall over: $ perl -MMy::Complicated::Module -le 'print 1' Indirect call of method "bootstrap" on object "Time::HiRes" at /usr/local/lib/perl/5.10.0/Time/HiRes.pm line 65. Compilation failed in require at ... The minimum test case that I've got it down to involves three files (a test script and two modules to require), each only a couple of lines long. A tarball is attached. It fails thus: $ perl indirect_leak.t Indirect call of method "import" on object "A" at il2.pm line 2. Compilation failed in require at indirect_leak.t line 3. BEGIN failed--compilation aborted at indirect_leak.t line 3. $ Anything shorter, such as omitting the no-op il1.pm module or collapsing the "use" statements to direct code inclusion, causes the test to pass. My perl version data is also attached. -zefram
Download indirect_leak.tar.gz
application/octet-stream 250b

Message body not shown because it is not plain text.

Message body is not shown because sender requested not to inline it.

This is actually a shortcoming in how I used to store the callback coderef. The 0.16 release just exposed it. Before 0.16, the default callbacks for warning and dieing used to build their error message from a private coderef. This made them eligible for cloning because they were capturing over an outer lexical. In 0.16, they use the new indirect::msg() public sub so they are no longer cloned. About why this error happens if the callback isn't cloned, I don't know, but this really feels like the false indirect report you get is a subproduct of another error : if you localize $@ in the handler, you get the dreaded "Unknown error" which usually means that you died in an exotic place and that the error message was lost. The solution I adopted was to force all anon subs passed as the hook to be cloned. This fixes the issue on the testcase and will be in next release. Thanks again for reporting.