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

Christian Walde
March 31, 2011 01:09
[perl #87322] Large PERL5LIB ENV values get ignored instead of imported into @INC on Windows 7
Message ID:
# New Ticket Created by  Christian Walde 
# Please include the string:  [perl #87322]
# in the subject line of all future correspondence about this issue. 
# <URL: >

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

[Please describe your issue here]


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):


On Wed, 30 Mar 2011 10:54:57 +0200, Christian Walde <> wrote:
> On Wed, 30 Mar 2011 02:22:32 +0200, <> wrote:
> > I just got this FAIL report today from CPANTesters:
> >
> >
> >
> > 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.
> Of note: The test ( ) clearly has a whole battery of directories in $ENV{PERL5LIB} ( ) 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. ( )
> 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]
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:

     osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
     uname='Win32 strawberryperl #1 Thu Nov  4 19:32:28 2010 i386'
     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
     optimize='-s -O2',
     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"'
     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
   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:

Environment for perl 5.10.1:
     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) Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About