Bug 118221

Summary: Test::Harness 2.40 while included in 5.8.3 Perl, FAILS build tests!
Product: [Fedora] Fedora Reporter: Scott R. Godin <rhbugzilla>
Component: perlAssignee: Warren Togami <wtogami>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 1CC: bradd+redhat, dg-junk, perl-devel, schwern
Target Milestone: ---   
Target Release: ---   
Hardware: athlon   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-07-22 23:32:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Scott R. Godin 2004-03-13 20:22:38 UTC
Description of problem:
Test::Harness was failing the build tests under the original FC1
5.8.1. Upon updating to 5.8.3 and hoping the problem was resolved, I
checked what was installed (as part of the process) and found it
already updated. Being a suspicious type, I decided to fire up CPAN
and run 'test Test::Harness' which failed in the same place as before. 

Version-Release number of selected component (if applicable):
perl-5.8.3-10

How reproducible:
every time

Steps to Reproduce:
1. Note Test::Harness current is already installed. (some bash aliases
for you: 
   pv () { perl -M$1 -le "print q{$1}->VERSION";}
   m () { perl -MCPAN -e "print CPAN::Shell->format_result(q{Module},
q{$1})";}
 Smile. ;)

3:21pm {31} pcp01723902pcs:/root># pv Test::Harness
2.40

3:22pm {32} pcp01723902pcs:/root># m Test::Harness
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
  Database was generated on Sat, 13 Mar 2004 05:50:02 GMT
Module id = Test::Harness
    DESCRIPTION  Executes perl-style tests
    CPAN_USERID  PETDANCE (Andy Lester <andy>)
    CPAN_VERSION 2.40
    CPAN_FILE    P/PE/PETDANCE/Test-Harness-2.40.tar.gz
    DSLI_STATUS  Smpf (standard,mailing-list,perl,functions)
    MANPAGE      Test::Harness - Run Perl standard test scripts with
statistics
    INST_FILE    /usr/lib/perl5/5.8.3/Test/Harness.pm
    INST_VERSION 2.40

2. Presuming someone tested this at build time, let's just assume it
*could* be wrong, and from within the cpan shell, do

cpan> test Test::Harness

which will download, build and test but NOT install the module.

3. Watch it fail
  
Actual results:
cpan> test Test::Harness
Running test for module Test::Harness
Running make for P/PE/PETDANCE/Test-Harness-2.40.tar.gz
Checksum for
/root/.cpan/sources/authors/id/P/PE/PETDANCE/Test-Harness-2.40.tar.gz ok
Test-Harness-2.40/
Test-Harness-2.40/t/
Test-Harness-2.40/t/sample-tests/
Test-Harness-2.40/t/sample-tests/head_end
Test-Harness-2.40/t/sample-tests/no_nums
Test-Harness-2.40/t/sample-tests/descriptive
Test-Harness-2.40/t/sample-tests/too_many
Test-Harness-2.40/t/sample-tests/combined
Test-Harness-2.40/t/sample-tests/todo
Test-Harness-2.40/t/sample-tests/taint
Test-Harness-2.40/t/sample-tests/switches
Test-Harness-2.40/t/sample-tests/no_output
Test-Harness-2.40/t/sample-tests/vms_nit
Test-Harness-2.40/t/sample-tests/bailout
Test-Harness-2.40/t/sample-tests/with_comments
Test-Harness-2.40/t/sample-tests/die_last_minute
Test-Harness-2.40/t/sample-tests/bignum
Test-Harness-2.40/t/sample-tests/segfault
Test-Harness-2.40/t/sample-tests/inc_taint
Test-Harness-2.40/t/sample-tests/lone_not_bug
Test-Harness-2.40/t/sample-tests/head_fail
Test-Harness-2.40/t/sample-tests/todo_inline
Test-Harness-2.40/t/sample-tests/taint_warn
Test-Harness-2.40/t/sample-tests/skipall_nomsg
Test-Harness-2.40/t/sample-tests/out_of_order
Test-Harness-2.40/t/sample-tests/skip_nomsg
Test-Harness-2.40/t/sample-tests/simple
Test-Harness-2.40/t/sample-tests/die
Test-Harness-2.40/t/sample-tests/shbang_misparse
Test-Harness-2.40/t/sample-tests/skip
Test-Harness-2.40/t/sample-tests/skipall
Test-Harness-2.40/t/sample-tests/simple_fail
Test-Harness-2.40/t/sample-tests/duplicates
Test-Harness-2.40/t/sample-tests/die_head_end
Test-Harness-2.40/t/lib/
Test-Harness-2.40/t/lib/Test/
Test-Harness-2.40/t/lib/Test/Builder.pm
Test-Harness-2.40/t/lib/Test/Simple.pm
Test-Harness-2.40/t/lib/Test/More.pm
Test-Harness-2.40/t/lib/Dev/
Test-Harness-2.40/t/lib/Dev/Null.pm
Test-Harness-2.40/t/lib/if.pm
Test-Harness-2.40/t/base.t
Test-Harness-2.40/t/inc_taint.t
Test-Harness-2.40/t/assert.t
Test-Harness-2.40/t/pod.t
Test-Harness-2.40/t/nonumbers.t
Test-Harness-2.40/t/strap-analyze.t
Test-Harness-2.40/t/callback.t
Test-Harness-2.40/t/ok.t
Test-Harness-2.40/t/strap.t
Test-Harness-2.40/t/00compile.t
Test-Harness-2.40/t/test-harness.t
Test-Harness-2.40/t/prove-switches.t
Test-Harness-2.40/Makefile.PL
Test-Harness-2.40/NOTES
Test-Harness-2.40/bin/
Test-Harness-2.40/bin/prove
Test-Harness-2.40/examples/
Test-Harness-2.40/examples/mini_harness.plx
Test-Harness-2.40/lib/
Test-Harness-2.40/lib/Test/
Test-Harness-2.40/lib/Test/Harness.pm
Test-Harness-2.40/lib/Test/Harness/
Test-Harness-2.40/lib/Test/Harness/Assert.pm
Test-Harness-2.40/lib/Test/Harness/Straps.pm
Test-Harness-2.40/lib/Test/Harness/Iterator.pm
Test-Harness-2.40/MANIFEST
Test-Harness-2.40/META.yml
Test-Harness-2.40/Changes

  CPAN.pm: Going to build P/PE/PETDANCE/Test-Harness-2.40.tar.gz

Test::Harness likes to have Devel::CoreStack, but doesn't require it.
Checking if your kit is complete...
Looks good
Writing Makefile for Test::Harness
cp lib/Test/Harness/Iterator.pm blib/lib/Test/Harness/Iterator.pm
cp lib/Test/Harness/Assert.pm blib/lib/Test/Harness/Assert.pm
cp lib/Test/Harness.pm blib/lib/Test/Harness.pm
cp lib/Test/Harness/Straps.pm blib/lib/Test/Harness/Straps.pm
cp bin/prove blib/script/prove
/usr/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/prove
Manifying blib/man1/prove.1
Manifying blib/man3/Test::Harness::Iterator.3pm
Manifying blib/man3/Test::Harness::Assert.3pm
Manifying blib/man3/Test::Harness::Straps.3pm
Manifying blib/man3/Test::Harness.3pm
  /usr/bin/make  -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00compile.........# Testing Test::Harness 2.40
t/00compile.........ok                                               
       
t/assert............ok                                               
       
t/base..............ok                                               
       
t/callback..........ok                                               
       
t/inc_taint.........ok                                               
       
t/nonumbers.........ok                                               
       
t/ok................ok                                               
       
t/pod...............ok                                               
       
t/prove-switches....ok                                               
       
t/strap-analyze.....ok                                               
       
t/strap.............ok                                               
       
t/test-harness......NOK 40#     Failed test (t/test-harness.t at line
535)   
#          got: 'Scalar found where operator expected at (eval 162)
line 1, near "'int'  $__val"
#       (Missing operator before   $__val?)
# '
#     expected: ''
t/test-harness......ok 208/208# Looks like you failed 1 tests of 208.
       
t/test-harness......dubious                                          
       
        Test returned status 1 (wstat 256, 0x100)
Scalar found where operator expected at (eval 152) line 1, near "'int'
 $__val"
        (Missing operator before   $__val?)
DIED. FAILED test 40
        Failed 1/208 tests, 99.52% okay (less 56 skipped tests: 151
okay, 72.60%)
Failed Test      Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------------------------------------------------------------------
t/test-harness.t    1   256   208    1   0.48%  40
56 subtests skipped.
Failed 1/12 test scripts, 91.67% okay. 1/541 subtests failed, 99.82% okay.
make: *** [test_dynamic] Error 2
  /usr/bin/make test -- NOT OK

cpan>

Expected results:

/usr/bin/make test -- OK

Additional info:

I received a reply from the author of Test::Harness when I originally
reported the bug to him, thinking it was a problem with his module.
this is not the case: 
Date: Tue, 27 Jan 2004 15:04:40 -0600
From: Andy Lester <andy [at] petdance {dot} com>
To: Scott R. Godin <mactech [at] webdragon {dot} net>
Subject: Re: Test::Harness 2.40 under Fedora Core 1 has test errors

> I tried looking at the code but can't (yet) make heads or tails out
of it. 
> heh. hopefully this means something to _you_ however. 

Yeah, basically the default Perl install from Fedora has some goofed
up header files. :-(

xoa

I don't have any more info than this but perhaps Andy can fill us in. 
I'll forward him a copy of the bugreport url

Comment 1 Ruslan U. Zakirov 2004-05-25 13:40:32 UTC
Same things happens for next modules:
Encode, Tie::MLDBM and other.
It's really bad.

Comment 2 Bradd W. Szonye 2004-08-23 05:30:34 UTC
The problem seems to arise from the perl header 
/usr/lib/perl5/5.8.3/i386-linux-thread-multi/bits/typesizes.ph -- 
the definition of __FSID_TYPE translates badly into perl: 
 
    \'struct struct\' { \'int\'  $__val[2]; } 
 
This is not a valid perl expression. It's trying to duplicate 
Fedora's definition of the type, struct { int __val[2]; }. I 
commented out the offending line, and Test::Harness builds without 
warning. I don't know if there's any harm in removing the 
definition, nor do I know what it should look like. 

Comment 3 Michael G Schwern 2004-08-27 22:06:13 UTC
This is not a bug in Test::Harness but rather it is T::H exposing a
bug in h2ph.  h2ph is a utility that generates Perl header (.ph) files
from C header files.  This lets Perl programs get at constants inside
.h files.  It often makes mistakes.  Test::Harness loads wait.ph to
get at some constants in order to translate exit status codes when a
test exits abnormally (see _corestatus()).  wait.ph, it appears, loads
typesizes.ph which has syntax errors.  It is not critical that wait.ph
loads, T::H has fallback logic which is correct for most modern
operating systems.  Unfortunately, despite efforts on T::H's part to
supress them, warnings and errors from loading .ph files often slip
through.

You can remove T::H from the equation by simply doing "require
'wait.ph'" or even more simply "require 'bits/typesizes.ph'".

Best thing to do is to send off a perlbug to p5p with the output of
"require 'bits/typesizes.ph'" as well as copies of bits/typesizes.h
and .ph and let the bug get fixed upstream.  Also you can just try
using 5.8.4, the problem may already be fixed.

Commenting out the offending line in typesizes.ph is an ok interum
solution.