develooper Front page | perl.perl5.porters | Postings from March 2011

[perl #87322] Large PERL5LIB ENV values get ignored instead of imported into @INC on Windows 7

From:
Christian Walde
Date:
March 31, 2011 01:09
Subject:
[perl #87322] Large PERL5LIB ENV values get ignored instead of imported into @INC on Windows 7
Message ID:
rt-3.6.HEAD-23755-1301492151-977.87322-75-0@perl.org
# New Ticket Created by  Christian Walde 
# Please include the string:  [perl #87322]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=87322 >


This is a bug report for perl from mithaldu@yahoo.de,
generated with the help of perlbug 1.39 running under perl 5.10.1.


-----------------------------------------------------------------
[Please describe your issue here]



Short:

On Windows 7 environment variable values can be arbitrarily large. However the perl executable ignores $ENV{PERL5LIB} if it goes above 32kbyte, despite being able to read it properly. This behavior can be reproduced with this minimal test script (example run outputs included):

https://gist.github.com/894331


Long:

On Wed, 30 Mar 2011 10:54:57 +0200, Christian Walde <mithaldu@yahoo.de> wrote:
> On Wed, 30 Mar 2011 02:22:32 +0200, perl@0ne.us <perl@0ne.us> wrote:
>
> > I just got this FAIL report today from CPANTesters:
> >
> > http://www.cpantesters.org/cpan/report/0ee8eb99-6c5d-1014-a630-0d8a02da96e1
> >
> > As you can see, the prereq is correctly recognized by the toolchain
> > and loaded - it's even in the lengthy @INC list, BUT when executing the
> > test script it seems like @INC disappears somehow? Since I don't know
> > the details of your setup I have to assume something is broken.
>
> https://gist.github.com/893981
>
> Of note: The test ( https://gist.github.com/893981#L225 ) clearly has a whole battery of directories in $ENV{PERL5LIB} ( https://gist.github.com/893981#L247 ) which the perl executable can obviously see, including the Params::Classify dir as the very first; since that's a Data::Dumper output of %ENV. However @INC remains unchanged by that. ( https://gist.github.com/893981#L579 )
>
> This seems to indicate to me that the perl executable itself is, for whatever reason, flat out ignoring the PERL5LIB and/or failing to inject it into @INC. Other possibilities include Module::Build messing things up or the Windows Perl executable exclusively having issues.

Thanks to a hint from Brian Raven i managed to reduce this to a minimal case and compared it across WinXP, Win7 and a Linux box.

Turns out that:
- on Win XP perl dies if an ENV entry is >28kbyte
- on Linux perl dies if an ENV entry is >128kbyte
- on Win7 perl handles arbitrarily large values in ENV entries, but flat-out ignores any PERL5LIB values over 32kbyte
(all with 5.10, tested with both ActivePerl and Strawberry Perl)

Since this acts the same across both AP and Strawberry, it seems to be a genuine perl core bug.




[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
     category=core
     severity=low
---
Site configuration information for perl 5.10.1:

Configured by 1 at Thu Nov  4 19:37:29 2010.

Summary of my perl5 (revision 5 version 10 subversion 1) configuration:

   Platform:
     osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
     uname='Win32 strawberryperl 5.10.1.4 #1 Thu Nov  4 19:32:28 2010 i386'
     config_args='undef'
     hint=recommended, useposix=true, d_sigaction=undef
     useithreads=define, usemultiplicity=define
     useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
     use64bitint=undef, use64bitall=undef, uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='gcc', ccflags =' -s -O2 -DWIN32 -DHAVE_DES_FCRYPT  -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVCRT_READFIX',
     optimize='-s -O2',
     cppflags='-DWIN32'
     ccversion='', gccversion='3.4.5', gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
     d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=12
     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='long long', lseeksize=8
     alignbytes=8, prototype=define
   Linker and Libraries:
     ld='g++', ldflags ='-s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib"'
     libpth=C:\strawberry\c\lib
     libs= -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32
     perllibs= -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32
     libc=, so=dll, useshrplib=true, libperl=libperl510.a
     gnulibc_version=''
   Dynamic Linking:
     dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
     cccdlflags=' ', lddlflags='-mdll -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib"'

Locally applied patches:


---
@INC for perl 5.10.1:
     C:/strawberry/perl/lib
     C:/strawberry/perl/site/lib
     C:\strawberry\perl\vendor\lib
     .

---
Environment for perl 5.10.1:
     CYGWIN=nodosfilewarning
     HOME (unset)
     LANG (unset)
     LANGUAGE (unset)
     LD_LIBRARY_PATH (unset)
     LOGDIR (unset)
     PATH=c:\cygwin\bin;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\PHP\;C:\Perl\site\bin;C:\Perl\bin;C:\Program Files (x86)\ActiveState Komodo IDE 6\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\TortoiseSVN\bin;C:\Program Files (x86)\TortoiseGit\bin;C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin
     PERL_BADLANG (unset)
     SHELL (unset)




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