Bug 1084399 - t/comp/parser.t loads modules from system instead from build directory
Summary: t/comp/parser.t loads modules from system instead from build directory
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: perl
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Pisar
QA Contact: Fedora Extras Quality Assurance
URL: https://rt.perl.org/Ticket/Display.ht...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-04 09:07 UTC by Petr Pisar
Modified: 2014-04-04 13:49 UTC (History)
9 users (show)

Fixed In Version: perl-5.18.2-297.fc21
Clone Of:
Environment:
Last Closed: 2014-04-04 13:49:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Proposed fix (1.83 KB, patch)
2014-04-04 11:37 UTC, Petr Pisar
no flags Details | Diff
Upstream fix ported to 5.18.2 (1.47 KB, patch)
2014-04-04 12:50 UTC, Petr Pisar
no flags Details | Diff

Description Petr Pisar 2014-04-04 09:07:38 UTC
perl-5.18.2-296.fc21 loads modules from system instead from build directory at some tests. E.g. t/comp/parser.t:

$ LD_PRELOAD=../libperl.so strace -fq -eopen,execve ./perl harness comp/parser.t 2>&1 |grep '"/usr/lib64/perl5/'
[pid 13545] open("/usr/lib64/perl5/re.pm", O_RDONLY) = 5
[pid 13545] open("/usr/lib64/perl5/auto/re/re.so", O_RDONLY|O_CLOEXEC) = 5

This is caused by a bug in t/TEST where _cmd() functions forgets to emit "-I" arguments if requested. The _cmd() is called with:

$VAR1 = {
          'return_dir' => undef,
          'testswitch' => '',
          'perl' => './perl',
          'file' => '',
          'utf8' => '',
          'lib' => '../lib',
          'run_dir' => undef,
          'switch' => '',
          'test' => 'comp/parser.t'
        };
$VAR2 = 'perl';

but it returns:

$VAR1 = './perl comp/parser.t ';

while it should return:

$VAR1 = './perl -I../lib comp/parser.t ';

The fix is to change line:

        $cmd = $perl . _quote_args($args) . " $test $redir";

into:
        my $lib = ($options->{lib} eq '') ? '' : " -I$options->{lib}";
        $cmd = $perl . $lib . _quote_args($args) . " $test $redir";

Comment 1 Petr Pisar 2014-04-04 11:37:04 UTC
Created attachment 882662 [details]
Proposed fix

Comment 2 Petr Pisar 2014-04-04 11:41:26 UTC
Reported to upstream <https://rt.perl.org/Ticket/Display.html?id=121579>.

Comment 3 Petr Pisar 2014-04-04 12:50:57 UTC
Created attachment 882684 [details]
Upstream fix ported to 5.18.2

The proposed fix was wrong. Upstream prefers different approach already implemented in this patch.

Comment 4 Petr Pisar 2014-04-04 13:49:32 UTC
Different tests still loads:

/usr/lib64/perl5/vendor_perl/auto/HTML/Parser/Parser.so
/usr/lib64/perl5/vendor_perl/auto/Params/Util/Util.so
/usr/lib64/perl5/vendor_perl/HTML/Entities.pm
/usr/lib64/perl5/vendor_perl/HTML/Parser.pm
and some /usr/share/perl5 stuff.

But these things did not go away even with originally proposed patch, so they are probably isolated execs of perl.

However this is different story, maybe different bug report.


Note You need to log in before you can comment on or make changes to this bug.