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

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

Thread Previous
From:
bulk88
Date:
February 1, 2018 00:13
Subject:
[perl #132795] t/porting/bench.t uses system perl's /lib duringtesting
Message ID:
rt-4.0.24-13192-1517443996-880.132795-75-0@perl.org
# New Ticket Created by  bulk88 
# Please include the string:  [perl #132795]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=132795 >


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 do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
Site configuration information for perl 5.27.9:

Configured by Administrator at Tue Jan 30 20:34:30 2018.

Summary of my perl5 (revision 5 version 27 subversion 9) configuration:
  
  Platform:
    osname=MSWin32
    osvers=5.2.3790
    archname=MSWin32-x86-multi-thread
    uname=''
    config_args='undef'
    hint=recommended
    useposix=true
    d_sigaction=undef
    useithreads=define
    usemultiplicity=define
    use64bitint=undef
    use64bitall=undef
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='cl'
    ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -GL -DWIN32 
-D_CONSOLE -DNO_STRICT -D_CRT_SECURE_NO_DEPRECATE 
-D_CRT_NONSTDC_NO_DEPRECATE  -DPERL_TEXTMODE_SCRIPTS 
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DWIN32_NO_REGISTRY'
    optimize='-O1 -MD -Zi -DNDEBUG -GL'
    cppflags='-DWIN32'
    ccversion='15.00.30729.01'
    gccversion=''
    gccosandvers=''
    intsize=4
    longsize=4
    ptrsize=4
    doublesize=8
    byteorder=1234
    doublekind=3
    d_longlong=undef
    longlongsize=8
    d_longdbl=define
    longdblsize=8
    longdblkind=0
    ivtype='long'
    ivsize=4
    nvtype='double'
    nvsize=8
    Off_t='__int64'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='link'
    ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -ltcg        
-libpath:"c:\perl\lib\CORE"        -machine:x86'
    libpth="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib"
    libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib 
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib 
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib 
odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
    perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib 
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib 
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib 
odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
    libc=msvcrt.lib
    so=dll
    useshrplib=true
    libperl=perl527.lib
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_win32.xs
    dlext=dll
    d_dlsymun=undef
    ccdlflags=' '
    cccdlflags=' '
    lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf -ltcg    
    -libpath:"c:\perl\lib\CORE"        -machine:x86'


---
@INC for perl 5.27.9:
    lib
    C:/p527/srcnew/lib

---
Environment for perl 5.27.9:
    CYGWIN=tty
    HOME (unset)
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/usr/lib/x86:/usr/X11R6/lib
    LOGDIR (unset)
    PATH=C:\WINDOWS\system32;C:\Program Files (x86)\Microsoft Visual 
Studio 9.0\VC\BIN;C:\Program Files\Microsoft 
SDKs\Windows\v6.0A\bin;C:\Perl\bin;C:\WINDOWS;C:\Program Files 
(x86)\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files 
(x86)\Git\bin;C:\sp3220\c\bin;
    PERL_BADLANG (unset)
    SHELL (unset)


Thread Previous


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