codeacrobat has asked for the wisdom of the Perl Monks concerning the following question:

Hi fellow monks. I have a problem with Test::Harness. It deadlocks in Test::Harness::Iterator while it is testing Pod. It happens in a lot of CPAN modules. The strange thing is, if I set the new Module in @INC and run the test directly it succeeds.

Can anyone give me insight in what might cause the deadlock?

This is a trace to HTML::Tagset
$ cd HTML-Tagset-3.10 $ make test /usr/bin/perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'bli +b/lib', 'blib/arch')" t/*.t t/00_about_verbose....ok t/01_old_junk.........ok t/pod................. <--- hangs # the test succeeds without Test::Harness $ perl -I `pwd`/blib/lib -T t/pod.t 1..1 ok 1 - blib/lib/HTML/Tagset.pm $ PERLDB_OPTS="AutoTrace=1 NonStop=1 Frame=2" perl -MExtUtils::Command +::MM -de "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t ... entering Test::Harness::Straps::_reset_file_state 605: my($self) = shift; 607: delete @{$self}{qw(max skip_all todo too_many_test +s)}; 607: delete @{$self}{qw(max skip_all todo too_many_test +s)}; 608: $self->{line} = 0; 609: $self->{saw_header} = 0; 610: $self->{saw_bailout}= 0; 611: $self->{lone_not_line} = 0; 612: $self->{bailout_reason} = ''; 613: $self->{'next'} = 1; exited Test::Harness::Straps::_reset_file_state 119: $self->{file} = $name; 120: my %totals = ( 121: max => 0, 122: seen => 0, 133: $self->{totals}{$name} = \%totals; 134: while( defined(my $line = $it->next) ) { entering Test::Harness::Iterator::FH::next 57: my $fh = $_[0]->{fh}; 60: return scalar <$fh>; <-- ultimately hangs here
This is my current Perl ( happens also with latest perl5.8.8 delivered with cygwin. )
$ perl -V Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=cygwin, osvers=1.5.21(0.15642), archname=cygwin-thread-mult +i uname='cygwin_nt-5.1 avenger 1.5.21(0.15642) 2006-07-30 14:21 i686 + cygwin ' config_args='' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemulti +plicity=de fine useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=y, bincompat5005=undef Compiler: cc='gcc', ccflags ='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -p +ipe -Wdecl aration-after-statement -DDEBUGGING', optimize='-O2', cppflags='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -Wdecl +aration-af ter-statement -DDEBUGGING' ccversion='', gccversion='3.4.4 (cygming special) (gdc 0.12, using + dmd 0.125 )', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +2 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize =8 alignbytes=8, prototype=define Linker and Libraries: ld='ld2', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /usr/lib /lib libs=-lgdbm -ldl -lcrypt -lgdbm_compat perllibs=-ldl -lcrypt -lgdbm_compat libc=/usr/lib/libc.a, so=dll, useshrplib=true, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags=' -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: DEBUGGING MULTIPLICITY MYMALLOC PERL_IMPLICIT_CONTEXT PERL_USE_SAFE_PUTENV USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Built under cygwin Compiled at Sep 9 2006 14:16:59

Replies are listed 'Best First'.
Re: Deadlock in Test::Harness::Iterator
by jkeenan1 (Deacon) on Sep 10, 2006 at 23:46 UTC
    I was not able to reproduce your problem using Perl 5.8.7 on darwin os version 7.9.0 (Mac OS X 10.4).

    [HTML-Tagset-3.10] 511 $ perl Makefile.PL;make Checking if your kit is complete... Looks good Writing Makefile for HTML::Tagset cp Tagset.pm blib/lib/HTML/Tagset.pm Manifying blib/man3/HTML::Tagset.3 [HTML-Tagset-3.10] 512 $ make test PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" " +test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00_about_verbose....ok + t/01_old_junk.........ok + t/pod.................ok + All tests successful. Files=3, Tests=4, 1 wallclock secs ( 0.25 cusr + 0.12 csys = 0.37 C +PU) [HTML-Tagset-3.10] 515 $ prove -vb t/pod.t t/pod....1..1 ok 1 - blib/lib/HTML/Tagset.pm ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.18 cusr + 0.05 csys = 0.23 C +PU) [HTML-Tagset-3.10] 518 $ perl -T -Iblib/lib t/pod.t 1..1 ok 1 - blib/lib/HTML/Tagset.pm

    Note that t/pod.t is simply an instance of Test::Pod::all_pod_files_ok() which some CPAN authors (including Andy, but not me!) like to throw into their test suites.

    use Test::More; eval "use Test::Pod 1.14"; plan skip_all => "Test::Pod 1.14 required for testing POD" if $@; all_pod_files_ok();

    If, as you say, this problem occurs with many CPAN modules, can you determine whether it is this function which is causing the hang? If so, then it may be something specific to the interaction of Test::Pod and Test::Harness on cygwin.

    Jim Keenan
Re: Deadlock in Test::Harness::Iterator
by codeacrobat (Chaplain) on Sep 11, 2006 at 05:53 UTC
    *sigh* I forgot to include the tons of Oracle paths in my PERL5LIB.
    PERL5LIB=C:\oracle\product\10.2.0\db_1\perl\5.8.3\lib\MSWin32-x86;C:\o +racle\product\10.2. 0\db_1\perl\5.8.3\lib;C:\oracle\product\10.2.0\db_1\perl\5.8.3\lib\MSW +in32-x86;C :\oracle\product\10.2.0\db_1\perl\site\5.8.3;C:\oracle\product\10.2.0\ +db_1\perl\ site\5.8.3\lib;C:\oracle\product\10.2.0\db_1\sysman\admin\scripts; avenger ~/.cpan/build/HTML-Tagset-3.10 $ unset PERL5LIB avenger ~/.cpan/build/HTML-Tagset-3.10 $ make test /usr/bin/perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'bli +b/lib', 'b lib/arch')" t/*.t t/00_about_verbose....ok t/01_old_junk.........ok t/pod.................ok All tests successful. Files=3, Tests=4, 1 wallclock secs ( 0.61 cusr + 0.43 csys = 1.04 C +PU)
    I guess all_pod_ok() checks those oracles docs too :-)