Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.85k stars 527 forks source link

Perl 5.8.0 h2xs test 95 fails when locincpth is undefined #5990

Closed p5pRT closed 20 years ago

p5pRT commented 21 years ago

Migrated from rt.perl.org#17786 (status was 'resolved')

Searchable as RT17786$

p5pRT commented 21 years ago

From shprentzj@nima.mil

Summary​: When configuration parameter locincpth (local include path) is undefined\, h2xs test 95 fails.

Explanation​: While installing perl 5.8.0 on a Sun Netra running Solaris 2.8\, all "make test" tests passed except h2xs test 95. That test died while trying to split the uninitialized value\, $Config{locincpth}. Arusha\, my system management tool of choice\, deliberately undefined Locincpth by running perl's configure script with the "-Aundef​:locincpth=" parameter.

Question​: Must locincpth have some value or can h2xs be patched to accept undefined locincpth values?

--------- More background material below ------------

Here is a detailed excerpt from the h2xs test​:

% cd lib % ../perl h2xs.t 1..113 ok 1 - open 'h2xst.h' ok 2 - close 'h2xst.h' ...... ok 94 - running ../perl "-I../lib" "-I../../lib" ../utils/h2xs -f -n h2xst h2xst.h -b 5.8.0 2>&1 not ok 95 - running ../perl "-I../lib" "-I../../lib" ../utils/h2xs -f -n h2xst h2xst.h -b 5.8.0 2>&1 # Failed test (h2xs.t at line 169) # got​: 'Use of uninitialized value in split at ../utils/h2xs line 711. # Writing h2xst/ppport.h # Writing h2xst/h2xst.pm # Writing h2xst/h2xst.xs # Writing h2xst/fallback/const-c.inc # Writing h2xst/fallback/const-xs.inc # Writing h2xst/Makefile.PL # Writing h2xst/README # Writing h2xst/t/1.t # Writing h2xst/Changes # Writing h2xst/MANIFEST # ' # expected​: 'Writing h2xst/ppport.h # Writing h2xst/h2xst.pm # Writing h2xst/h2xst.xs # Writing h2xst/fallback/const-c.inc # Writing h2xst/fallback/const-xs.inc # Writing h2xst/Makefile.PL # Writing h2xst/README # Writing h2xst/t/1.t # Writing h2xst/Changes # Writing h2xst/MANIFEST # ' ok 96 - check for h2xst/ppport.h ...... ok 113 - unlink 'h2xst.h' # Looks like you failed 1 tests of 113.

Looking near line 711 of h2xs\, I find​:

  @​paths = (File​::Spec->curdir()\, $Config{usrinc}\,   (split ' '\, $Config{locincpth})\, '/usr/include');

Suspecting that locincpth might not be defined\, I tried​:

% ./perl -Ilib -MConfig -wle 'print $Config{locincpth}' Use of uninitialized value in print at -e line 1.

I'm using Arusha \<http​://arusha.sourceforge.net>\, a system management tool to configure and install perl (and other applications). It explicilty undefines locincpth during perl's configuration. Among many configuration arguments\, Arusha specifies "-Aundef​:locincpth=".

------------ perlbug -d output below -------------


Flags​:   category=   severity=


Site configuration information for perl v5.8.0​:

Configured by shprentj at Fri Oct 4 17​:02​:33 EDT 2002.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration​:   Platform​:   osname=solaris\, osvers=2.8\, archname=sun4-solaris   uname='sunos gold 5.8 generic_108528-09 sun4u sparc sunw\,ultrasparc-iii-cengine '   config_args='-de -Dprefix=/our/.-ark-deploy/perl--5.8.0 -Dbin=/our/.-ark-deploy/perl--5.8.0/bin -Dscriptdir=/our/.-ark-deploy/perl--5.8.0/bin -Dprivlib=/our/.-ark-deploy/perl--5.8.0/lib/perl -Darchlib=/our/.-ark-deploy/perl--5.8.0/lib/perl -Dman1dir=/our/.-ark-deploy/perl--5.8.0/man/man1 -Dman3dir=/our/.-ark-deploy/perl--5.8.0/man/man3 -Dsiteprefix=/our -Dsitebin=/our/bin -Dsitescript=/our/bin -Dsitelib=/our/lib/perl/site-perl -Dsitearch=/our/lib/perl/site-perl -Dsiteman1=/our/man/man1 -Dsiteman3=/our/man/man3 -Dcc=/our/bin/gcc -Dlibs=-lsocket -lnsl -ldl -lm -lc -Accflags=-O2 -mcpu=ultrasparc -I/our/.-ark-deploy/perl--5.8.0/include -Aldflags= -L/our/.-ark-deploy/perl--5.8.0/lib -Wl\,-R/our/.-ark-deploy/perl--5.8.0/lib -Alddlflags=-G -L/our/.-ark-deploy/perl--5.8.0/lib -Wl\,-R/our/.-ark-deploy/perl--5.8.0/lib -Aundef​:locincpth= -Aundef​:loclibpth='   hint=recommended\, useposix=true\, d_sigaction=define   usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef   useperlio=define d_sfio=undef uselargefiles=define usesocks=undef   use64bitint=undef use64bitall=undef uselongdouble=undef   usemymalloc=n\, bincompat5005=undef   Compiler​:   cc='/our/bin/gcc'\, ccflags ='-O2 -mcpu=ultrasparc -I/our/.-ark-deploy/perl--5.8.0/include -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'\,   optimize='-O'\,   cppflags='-O2 -mcpu=ultrasparc -I/our/.-ark-deploy/perl--5.8.0/include -fno-strict-aliasing'   ccversion=''\, gccversion='3.2'\, gccosandvers='solaris2.8'   intsize=4\, longsize=4\, ptrsize=4\, doublesize=8\, byteorder=4321   d_longlong=define\, longlongsize=8\, d_longdbl=define\, longdblsize=16   ivtype='long'\, ivsize=4\, nvtype='double'\, nvsize=8\, Off_t='off_t'\, lseeksize=8   alignbytes=8\, prototype=define   Linker and Libraries​:   ld='/our/bin/gcc'\, ldflags =' -L/our/.-ark-deploy/perl--5.8.0/lib -Wl\,-R/our/.-ark-deploy/perl--5.8.0/lib '   libpth=/usr/lib /usr/ccs/lib /usr/local/lib   libs=-lsocket -lnsl -ldl -lm -lc   perllibs=-lsocket -lnsl -ldl -lm -lc   libc=/lib/libc.so\, so=so\, useshrplib=false\, libperl=libperl.a   gnulibc_version=''   Dynamic Linking​:   dlsrc=dl_dlopen.xs\, dlext=so\, d_dlsymun=undef\, ccdlflags=' '   cccdlflags='-fPIC'\, lddlflags=' -G -L/our/.-ark-deploy/perl--5.8.0/lib -Wl\,-R/our/.-ark-deploy/perl--5.8.0/lib'

Locally applied patches​:  


@​INC for perl v5.8.0​:   /our/.-ark-deploy/perl--5.8.0/lib/perl   /our/lib/perl/site-perl   /our/lib/perl/site-perl   /our/lib/perl/site-perl   .


Environment for perl v5.8.0​:   HOME=/home/shprentj   LANG (unset)   LANGUAGE (unset)   LC_COLLATE=en_US.ISO8859-1   LC_CTYPE=en_US.ISO8859-1   LC_MESSAGES=C   LC_MONETARY=en_US.ISO8859-1   LC_NUMERIC=en_US.ISO8859-1   LC_TIME=en_US.ISO8859-1   LD_LIBRARY_PATH (unset)   LOGDIR (unset)   PATH=/our/bin​:/usr/openwin/bin​:/usr/bin​:/usr/local/bin​:/usr/ccs/bin​:.   PERL_BADLANG (unset)   SHELL=/bin/csh

--

Joel Shprentz National Imagery and Mapping Agency Mailstop N-17 Washington Navy Yard\, Building 213 1200 First Street\, SE Washington\, DC 20303-0001

202-685-3534

p5pRT commented 21 years ago

From @doughera88

On 7 Oct 2002\, Joel Shprentz wrote​:

Summary​: When configuration parameter locincpth (local include path) is undefined\, h2xs test 95 fails.

Explanation​: While installing perl 5.8.0 on a Sun Netra running Solaris 2.8\, all "make test" tests passed except h2xs test 95. That test died while trying to split the uninitialized value\, $Config{locincpth}. Arusha\, my system management tool of choice\, deliberately undefined Locincpth by running perl's configure script with the "-Aundef​:locincpth=" parameter.

I think you've hit upon two separate bugs here.

First\, -Aundef​:locincpth= is not working correctly. It's supposed to set locincpth=''\, but instead\, it's setting locincpth=undef. This is a Configure bug. (Oddly\, if you use the simpler -Ulocincpth= Configure command line option\, you do get the right value. I'm unclear of the intent of "Arusha" here.)

In any case\, I think h2xs does ok with locincpth=''. It's the value of undef that causes problems.

Question​: Must locincpth have some value or can h2xs be patched to accept undefined locincpth values?

h2xs could\, I suppose\, be patched to accept undef\, but that's not supposed to happen. At worst\, locincpth is supposed to be empty.

Thanks for the detailed report. A workaround is to manually change your config.sh to read

  locincpth=''

and then

  sh Configure -S   make depend   make

I don't have a fix for this offhand\, but Arusha might be able to work around it by using -Ulocincpth= instead of the -A syntax. That might be worth testing and reporting back to the Arusha developers.

Thanks for the well-researched bug report.

  Andy Dougherty doughera@​lafayette.edu

p5pRT commented 21 years ago

From shprentzj@nima.mil

Andy Dougherty wrote​:

On 7 Oct 2002\, Joel Shprentz wrote​:

Summary​: When configuration parameter locincpth (local include path) is undefined\, h2xs test 95 fails.

Explanation​: While installing perl 5.8.0 on a Sun Netra running Solaris 2.8\, all "make test" tests passed except h2xs test 95. That test died while trying to split the uninitialized value\, $Config{locincpth}. Arusha\, my system management tool of choice\, deliberately undefined Locincpth by running perl's configure script with the "-Aundef​:locincpth=" parameter.

I think you've hit upon two separate bugs here.

First\, -Aundef​:locincpth= is not working correctly. It's supposed to set locincpth=''\, but instead\, it's setting locincpth=undef. This is a Configure bug. (Oddly\, if you use the simpler -Ulocincpth= Configure command line option\, you do get the right value. I'm unclear of the intent of "Arusha" here.)

According to Will Partain\, one of Arusha's authors\, the intent is to tightly control which libraries and include files are used when building Perl (or any other application). This makes the behavior of Perl (and other applications) more predictable because we know\, for example\, which zlib version was compiled in.

I will try "-Ulocincpth=".

Thanks for the quick response.

p5pRT commented 21 years ago

From shprentzj@nima.mil

Andy Dougherty wrote​:

On 7 Oct 2002\, Joel Shprentz wrote​:

Arusha\, my system management tool of choice\, deliberately undefined Locincpth by running perl's configure script with the "-Aundef​:locincpth=" parameter.

... -Aundef​:locincpth= is not working correctly. It's supposed to set locincpth=''\, but instead\, it's setting locincpth=undef. This is a Configure bug. (Oddly\, if you use the simpler -Ulocincpth= Configure command line option\, you do get the right value. ...)

In any case\, I think h2xs does ok with locincpth=''. It's the value of undef that causes problems.

I replaced "-Aundef​:locincpth=" with "-Ulocincpth=" in Arusha's sidai/package/perl.xml configuration file and used Arusha to rebuild Perl from scratch. All tests pass including h2xs test 95.

Thanks for your help.

p5pRT commented 20 years ago

From shprentzj@nima.mil

I should have marked this "resolved" in October\, but now can add that the solution works for Perl 5.8.2 as well.

p5pRT commented 20 years ago

shprentzj@nima.mil - Status changed from 'new' to 'resolved'