develooper Front page | perl.perl5.porters | Postings from February 2018

[perl #132795] t/porting/bench.t uses system perl's /lib duringtesting

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
February 1, 2018 03:04
Subject:
[perl #132795] t/porting/bench.t uses system perl's /lib duringtesting
Message ID:
rt-4.0.24-32290-1517454242-1730.132795-15-0@perl.org
On Thu, 01 Feb 2018 00:13:16 GMT, bulk88 wrote:
> This is a bug report for perl from bulk88@hotmail.com,
> generated with the help of perlbug 1.41 running under perl 5.27.9.
> 
> 
> -----------------------------------------------------------------
> [Please describe your issue here]
> 
> While upgrading blead perl, I ran into a test failure where 
> t/porting/bench.t (added recently in 5.27.2 in commit 
> 6568b26dddaf1bc89610d859ebe908bebdeb714c ) picked up a /lib in @INC from 
> outside the build directory.
> 
> -----------------------
> C:\p527\srcnew\t>.\perl -I.. -MTestInit porting/bench.t
> porting/bench.t: Perl lib version (5.23.5) doesn't match executable 
> 'C:\p527\src
> new\t\perl.exe' version (5.27.9) at ../lib/Config.pm line 62.
> Compilation failed in require at porting/bench.t line 17.
> BEGIN failed--compilation aborted at porting/bench.t line 17.
> 
> C:\p527\srcnew\t>
> -----------------------
> 
> This is the same family of bugs from now closed ticket 
> https://rt.perl.org/Ticket/Display.html?id=116971 . ".\perl -I.. 
> -MTestInit porting/bench.t" with the -I on cmd line is how harness 
> typically runs test scripts.
> 
> Top of bench.t has
> 
> -------------------
> BEGIN {
>     chdir '..' if -f 'test.pl' && -f 'thread_it.pl';
>     require './t/test.pl';
>     push @INC, 'lib';
> }
> -------------------
> and that chdir changed cwd up one to src tree root, then combined with 
> harness's -I.. made perl reach outside the source tree. I'll note all 
> the other files in t/porting use assignment to @INC not a push(). 
> changing "push @INC, 'lib';" to "@INC = 'lib';" made the test pass 
> (actually skip) for me.
> ----------------
> C:\p527\srcnew\t>.\perl -I.. -MTestInit porting/bench.t
> 1..0 # Skip not linux
> 
> C:\p527\srcnew\t>
> ----------------
> 
> A system call log shows the perl proc reached outside its build dir.
> ------------------------
> 7:06:42.1747735 PM    CreateFile    3352    perl.exe    SUCCESS    
> C:\p527\srcnew\t\porting\bench.t
> 7:06:42.1832055 PM    CreateFile    3352    perl.exe    NAME NOT 
> FOUND    C:\p527\srcnew\TestInit.pmc
> 7:06:42.1843928 PM    CreateFile    3352    perl.exe    SUCCESS    
> C:\p527\srcnew\TestInit.pm
> 7:06:42.1879138 PM    CreateFile    3352    perl.exe    PATH NOT 
> FOUND    C:\p527\srcnew\t\t\TEST
> 7:06:42.1894089 PM    CreateFile    3352    perl.exe    NAME NOT 
> FOUND    C:\p527\srcnew\t\t
> 7:06:42.1915490 PM    CreateFile    3352    perl.exe    SUCCESS    
> C:\p527\srcnew\t\test.pl
> 7:06:42.1941938 PM    CreateFile    3352    perl.exe    SUCCESS    
> C:\p527\srcnew\t
> 7:06:42.1957033 PM    CreateFile    3352    perl.exe    SUCCESS    
> C:\p527\srcnew\t\thread_it.pl
> 7:06:42.1972779 PM    CreateFile    3352    perl.exe    SUCCESS    
> C:\p527\srcnew\t
> 7:06:42.1994306 PM    CreateFile    3352    perl.exe    SUCCESS    
> C:\p527\srcnew
> 7:06:42.2010337 PM    CreateFile    3352    perl.exe    SUCCESS    
> C:\p527\srcnew\t\test.pl
> 7:06:42.2289290 PM    CreateFile    3352    perl.exe    IS DIRECTORY    
> C:\p527\srcnew\t
> 7:06:42.2301291 PM    CreateFile    3352    perl.exe    SUCCESS    
> C:\p527\srcnew
> 7:06:42.2339684 PM    CreateFile    3352    perl.exe    NAME NOT 
> FOUND    C:\p527\srcnew\t\tmp3352A
> 7:06:42.2354930 PM    CreateFile    3352    perl.exe    NAME NOT 
> FOUND    C:\p527\lib\warnings.pmc
> 7:06:42.2366704 PM    CreateFile    3352    perl.exe    SUCCESS    
> C:\p527\lib\warnings.pm
> 7:06:42.2478595 PM    CreateFile    3352    perl.exe    NAME NOT 
> FOUND    C:\p527\lib\strict.pmc
> 7:06:42.2490689 PM    CreateFile    3352    perl.exe    SUCCESS    
> C:\p527\lib\strict.pm
> 7:06:42.2529658 PM    CreateFile    3352    perl.exe    NAME NOT 
> FOUND    C:\p527\lib\Config.pmc
> 7:06:42.2541375 PM    CreateFile    3352    perl.exe    SUCCESS    
> C:\p527\lib\Config.pm
> 7:06:42.2567177 PM    CreateFile    3352    perl.exe    NAME NOT 
> FOUND    C:\p527\lib\vars.pmc
> 7:06:42.2578865 PM    CreateFile    3352    perl.exe    SUCCESS    
> C:\p527\lib\vars.pm
> 7:06:42.2608210 PM    CreateFile    3352    perl.exe    NAME NOT 
> FOUND    C:\p527\lib\warnings\register.pmc
> 7:06:42.2622383 PM    CreateFile    3352    perl.exe    SUCCESS    
> C:\p527\lib\warnings\register.pm
> 7:06:42.2686526 PM    CreateFile    3352    perl.exe    NAME NOT 
> FOUND    C:\p527\srcnew\t\tmp3352A
> 7:06:42.2700992 PM    CreateFile    3352    perl.exe    NAME NOT 
> FOUND    C:\p527\srcnew\t\tmp3352A
> ------------------------

Please review the patch attached.

Thank you very much.
-- 
James E Keenan (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=132795

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About