develooper Front page | perl.perl5.porters | Postings from August 2009

[perl #68688] lib/parent/t/parent-pmc.t fail when Perl is built with -DPERL_DISABLE_PMC

From:
perlbug-followup
Date:
August 20, 2009 06:32
Subject:
[perl #68688] lib/parent/t/parent-pmc.t fail when Perl is built with -DPERL_DISABLE_PMC
Message ID:
rt-3.6.HEAD-2466-1250772858-1394.68688-75-0@perl.org
# New Ticket Created by  merijnb@ms.com 
# Please include the string:  [perl #68688]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=68688 >



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


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

When you build Perl with -DPERL_DISABLE_PMC it will fail the lib/parent/t/parent-pmc.t
test in this manner: 

lib/parent/t/parent-pmc.......................................#   Failed test 'Block ran until the end'
#   at ../lib/parent/t/parent-pmc.t line 28.
#          got: undef
#     expected: '1'
FAILED at test 1


I looked at the best way to skip this test but there doesn't seem to be a nice flag
in Config. Checking other tests I found only one related to this flag (there might be more 
of course), t/comp/require.t. I adapted the code from that test to skip the parent-pmc
tests in the patch that follows.

I'm not sure skipping is the best solution, but it seems reasonable to do so for this 
test if pmc files are disabled. We disable them to gain a small performance advantage.

--- /var/tmp/build.merijnb/parent-pmc.t	2009-08-20 08:37:43.000000000 -0400
+++ ./lib/parent/t/parent-pmc.t	2009-08-20 08:36:20.000000000 -0400
@@ -1,10 +1,18 @@
 #!/usr/bin/perl -w
+
+my $ccflags;
 BEGIN {
     if( $ENV{PERL_CORE} ) {
         chdir 't' if -d 't';
         chdir '../lib/parent';
         @INC = '..';
     }
+    # Right. We really really need Config here.
+    require Config;
+    die "Failed to load Config for some reason"
+        unless $Config::Config{version};
+    $ccflags = $Config::Config{ccflags};
+    die "Failed to get ccflags for some reason" unless defined $ccflags;
 }
 
 use strict;
@@ -12,6 +20,7 @@
 use lib 't/lib';
 
 plan skip_all => ".pmc are only available with 5.6 and later" if $] < 5.006;
+plan skip_all => ".pmc files are ignored in this build" if ($ccflags =~ /(?:^|\s)-DPERL_DISABLE_PMC\b/);
 plan tests => 3;
 
 use vars qw($got_here);



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

Configured by merijnb at Thu Aug 20 06:18:57 EDT 2009.

Summary of my perl5 (revision 5 version 10 subversion 1) configuration:
   
  Platform:
    osname=linux, osvers=2.4.21-47.0.1.elhugemem, archname=i686-linux-thread-multi
    uname='linux paias693 2.4.21-47.0.1.elhugemem #1 smp fri oct 13 17:48:02 edt 2006 i686 i686 i386 gnulinux '
    config_args='-des -Dusemymalloc=n -Duselargefiles -Ud_flock -Accflags=-DPERL_DISABLE_PMC -Duseithreads -Dcc=gcc -Dbool=char -DHAS_BOOL -fexceptions -Doptimize=-O3 -Ui_db -Ui_gdbm -Duselargefiles -Dafsroot=/ms -Darchlib=//ms/dist/perl5/PROJ/core/5.10.1-RC2/.exec/ia32.linux.2.4.glibc.2.3/lib/perl5 -Darchlibexp=//ms/dist/perl5/PROJ/core/5.10.1-RC2/.exec/ia32.linux.2.4.glibc.2.3/lib/perl5 -Dbin=//ms/dist/perl5/PROJ/core/5.10.1-RC2/.exec/ia32.linux.2.4.glibc.2.3/bin -Dbinexp=//ms/dist/perl5/PROJ/core/5.10.1-RC2/.exec/ia32.linux.2.4.glibc.2.3/bin -Dccflags=-DAPPLLIB_EXP="/ms/dist/perl5/VERS/5.10.1-RC2-core/lib/perl5:/ms/dist/perl5/VERS/5.10-core/lib/perl5" -Dinstallarchlib=//ms/dev/perl5/core/5.10.1-RC2/install/.exec/ia32.linux.2.4.glibc.2.3/lib/perl5 -Dinstallbin=//ms/dev/perl5/core/5.10.1-RC2/install/.exec/ia32.linux.2.4.glibc.2.3/bin -Dinstallman1dir=//ms/dev/perl5/core/5.10.1-RC2/install/.exec/ia32.linux.2.4.glibc.2.3/man/man1 -Dinstallman3dir=//ms/dev/perl5/core/5.10.1-RC2
 /install/.exec/ia32.linux.2.4.glibc.2.3/man/man3 -Dinstallprivlib=//ms/dev/perl5/core/5.10.1-RC2/install/.exec/ia32.linux.2.4.glibc.2.3/lib/perl5 -Dinstallscript=//ms/dev/perl5/core/5.10.1-RC2/install/.exec/ia32.linux.2.4.glibc.2.3/bin -Dinstallsitearch=//ms/dev/perl5/core/5.10.1-RC2/install/.exec/ia32.linux.2.4.glibc.2.3/lib/perl5 -Dinstallsitelib=//ms/dev/perl5/core/5.10.1-RC2/install/.exec/ia32.linux.2.4.glibc.2.3/lib/perl5 -Dman1dir=//ms/dist/perl5/PROJ/core/5.10.1-RC2/.exec/ia32.linux.2.4.glibc.2.3/man/man1 -Dman1direxp=//ms/dist/perl5/PROJ/core/5.10.1-RC2/.exec/ia32.linux.2.4.glibc.2.3/man/man1 -Dman3dir=//ms/dist/perl5/PROJ/core/5.10.1-RC2/.exec/ia32.linux.2.4.glibc.2.3/man/man3 -Dman3direxp=//ms/dist/perl5/PROJ/core/5.10.1-RC2/.exec/ia32.linux.2.4.glibc.2.3/man/man3 -Dpager=/ms/dist/fsf/bin/less -Dperladmin=perlcore@ms.com -Dperlpath=//ms/dist/perl5/PROJ/core/5.10.1-RC2/.exec/ia32.linux.2.4.glibc.2.3/bin/perl -Dprefix=/ms/dist/perl5 -Dprefixexp=/ms/dist/perl5 -Dprivl
 ib=//ms/dist/perl5/PROJ/core/5.10.1-RC2/.exec/ia32.linux.2.4.glibc.2
.3/lib/perl5 -Dprivlibexp=//ms/dist/perl5/PROJ/core/5.10.1-RC2/.exec/ia32.linux.2.4.glibc.2.3/lib/perl5 -Dscriptdir=//ms/dist/perl5/PROJ/core/5.10.1-RC2/.exec/ia32.linux.2.4.glibc.2.3/bin -Dscriptdirexp=//ms/dist/perl5/PROJ/core/5.10.1-RC2/.exec/ia32.linux.2.4.glibc.2.3/bin -Dstartperl=#!//ms/dist/perl5/PROJ/core/5.10.1-RC2/.exec/ia32.linux.2.4.glibc.2.3/bin/perl'
    hint=recommended, useposix=true, d_sigaction=define
    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 -Dbool=char -DHAS_BOOL -fexceptions', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DAPPLLIB_EXP="/ms/dist/perl5/VERS/5.10.1-RC2-core/lib/perl5:/ms/dist/perl5/VERS/5.10-core/lib/perl5" -DPERL_DISABLE_PMC -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O3',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DAPPLLIB_EXP="/ms/dist/perl5/VERS/5.10.1-RC2-core/lib/perl5:/ms/dist/perl5/VERS/5.10-core/lib/perl5" -DPERL_DISABLE_PMC -fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='3.2.3 20030502 (Red Hat Linux 3.2.3-58)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='gcc -Dbool=char -DHAS_BOOL -fexceptions', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.3.2.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.3.2'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O3 -L/usr/local/lib'

Locally applied patches:
    RC2

---
@INC for perl 5.10.1:
    lib
    /ms/dist/perl5/VERS/5.10.1-RC2-core/lib/perl5
    /ms/dist/perl5/VERS/5.10-core/lib/perl5
    //ms/dist/perl5/PROJ/core/5.10.1-RC2/.exec/ia32.linux.2.4.glibc.2.3/lib/perl5
    .

---
Environment for perl 5.10.1:
    HOME=/ms/user/m/merijnb
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LC_ALL=C
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/ms/user/m/merijnb/local/bin://ms/dist/3rd/PROJ/perforce/2008.2/exec://ms/dist/releng/PROJ/p4tools/prod://ms/dist/perl5/PROJ/core/5.8/bin://ms/dist/perl5/bin://ms/dist/afs/PROJ/vms/beta/common/bin://ms/dist/afs/PROJ/vms/beta/common/sbin://ms/dist/msde/PROJ/msde/1.7/bin:/ms/dist/aurora/bin:/usr/local/bin:/usr/bin:/bin:/usr/kerberos/bin:/ms/dist/perl5/bin:/ms/dist/fsf/bin:/ms/dist/afs/bin:/usr/X11R6/bin:/usr/bin/X11:/ms/dist/aurora/sbin:/usr/sbin:/sbin:/usr/etc:/ms/dist/afs/sbin:.
    PERL_BADLANG (unset)
    SHELL=/bin/ksh




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