Skip Menu |

This queue is for tickets about the indirect CPAN distribution.

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

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

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: 0.25



Subject: indirect.pm breaks %^H
Date: Tue, 5 Jul 2011 17:41:54 +0100
To: bug-indirect [...] rt.cpan.org
From: Zefram <zefram [...] fysh.org>
An interaction between indirect.pm and implicit module loading breaks %^H. I'm seeing this on Perl 5.10.1, where some code that I'm running at compile time happens to perform a utf8 regexp match and this overwrites the contents of %^H, but only if indirect.pm was loaded earlier. Here's my test case: $ perl -le 'require indirect; %^H=(foo=>1,bar=>2); print join",",%^H; $x = "foo"; utf8::upgrade($x); $x =~ /foo/i; print join",",%^H' bar,2,foo,1 indirect,,bar,2,foo,1 The extra entry in %^H is indirect=>undef. If I'm loading Lexical::SealRequireHints as well, due to using one of my lexical-scoping modules, the old %^H entries disappear: $ perl -le 'use Lexical::SealRequireHints; require indirect; %^H=(foo=>1,bar=>2); print join",",%^H; $x = "foo"; utf8::upgrade($x); $x =~ /foo/i; print join",",%^H' bar,2,foo,1 indirect, It looks as though indirect is causing the %^H of some module's compilation to be copied into the runtime %^H. L:SRH causes the old %^H contents to disappear because it prevents the old entries leaking *into* the module's compilation. I have not managed to reproduce the problem by replacing the regexp match with 'require "utf8_heavy.pl"' or any other single require. Unsurprisingly, the problem does not occur on 5.12. Taking into account the previous issues we've had with indirect.pm leaking lexical state, it appears that its workaround for the core bug is difficult to get right. You might want to consider using L:SRH instead, which seems to be more reliable. -zefram
Subject: Re: [rt.cpan.org #69291] AutoReply: indirect.pm breaks %^H
Date: Mon, 18 Jul 2011 11:31:54 +0100
To: Bugs in indirect via RT <bug-indirect [...] rt.cpan.org>
From: Zefram <zefram [...] fysh.org>
As discussed on IRC: With indirect-0.24, the bogus indirect=>undef entries no longer appear. With indirect loaded on its own, %^H is no longer molested by regexp match. With L:SRH invoked, %^H gets completely cleared by the regexp match, regardless of whether indirect is invoked. So I conclude that my guess about the nature of the bug was incorrect, and there were in fact two interacting bugs. The bug in indirect has been fixed, and there remains a bug in L:SRH for me to fix. -zefram
For the record, indirect was wrongly vivifying the 'indirect' key in %^H because I confused the API of hv_fetch() with the one of hv_fetch_ent() when passing the hash value of "indirect" as the last argument of hv_fetch() (which should be the lvalue flag). This has been fixed in version 0.25. Thanks for reporting this. Vincent.