Export to GitHub

perl-compiler - issue #201

Subroutine import redefined at /.../Config.pm


Posted on Nov 12, 2013 by Massive Bear

What steps will reproduce the problem? 1. > perlcc -r -e 'use Storable; *Storable::CAN_FLOCK = sub { 1 } if $ENV{fake}; print qq{check ok\n}' Subroutine import redefined at /usr/local/cpanel/3rdparty/perl/514/lib/perl5/5.14.3/i386-linux-64int/Config.pm line 38. check ok

What is the expected output? What do you see instead?

> perl -e 'use Storable; *Storable::CAN_FLOCK = sub { 1 } if $ENV{fake}; print qq{check ok\n}' check ok

Please use labels and text to provide additional information.

Comment #1

Posted on Nov 12, 2013 by Massive Lion

(No comment was entered for this change.)

Comment #2

Posted on Nov 12, 2013 by Massive Bear

minimal script to reproduce the problem

cat script.pl

sub can { require Config; import Config; return $Config{'d_flock'}; }

use IO::File; my $x = $ENV{fake} ? IO::File->new : undef ;

can() if $ENV{fake}; print "ok\n";

1;

Comment #3

Posted on Nov 12, 2013 by Grumpy Rhino

First will have to add the special case #183 for ->import methods

Comment #4

Posted on Nov 12, 2013 by Grumpy Rhino

Workaround: use -UConfig in the cmdline

Comment #5

Posted on Nov 14, 2013 by Grumpy Rhino

Issue 221 has been merged into this issue.

Comment #6

Posted on Nov 14, 2013 by Grumpy Rhino

(No comment was entered for this change.)

Comment #7

Posted on Nov 14, 2013 by Grumpy Rhino

Interestingly fixed by adding -v,-Dp

Comment #8

Posted on Nov 14, 2013 by Grumpy Rhino

%INC is wrong

Comment #9

Posted on Nov 14, 2013 by Grumpy Rhino

Issue 221 has been merged into this issue.

Comment #10

Posted on Nov 14, 2013 by Massive Lion

Possibly related to issue 219. I think the problem goes away once that's resolved.

Comment #11

Posted on Nov 14, 2013 by Grumpy Rhino

I see now what's going on:

initializing *!, *+ or *- too early when *INC is not yet setup will lead to all these problems. %INC is wrong (redefinition or not found warnings), *! fails to initialize. So the bisect indeed points to the right commit

Comment #12

Posted on Nov 18, 2013 by Grumpy Rhino

Tracked in #27, first testcase.

I guess the reason is wrong handling of GV imports (aliases). We don't share shared GPs yet, and the EGV of *DynaLoader::Config seems to be missing in this case. But even if we had the EGV the shared GP will be a copy, and not shared.

Status: Duplicate

Labels:
Type-Defect Priority-Critical Milestone-NextRelease