develooper Front page | perl.perl5.porters | Postings from June 2013

[perl #118549] Can't run t/harness with a perl built for gprof

Thread Next
From:
Nicholas Clark
Date:
June 20, 2013 12:55
Subject:
[perl #118549] Can't run t/harness with a perl built for gprof
Message ID:
rt-3.6.HEAD-2552-1371732905-941.118549-75-0@perl.org
# New Ticket Created by  Nicholas Clark 
# Please include the string:  [perl #118549]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=118549 >


This is a bug report for perl from nick@ccl4.org,
generated with the help of perlbug 1.39 running under perl 5.19.1.


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

I've built perl with -pg in the C flags to enabled profiling for gprof.
I can't run t/harness to completion - it bails out like this:

../cpan/IO-Compress/t/105oneshot-zip-store-only.t ................. ok
../cpan/IO-Compress/t/105oneshot-zip.t ............................ ok
../cpan/IO-Compress/t/106prime-bzip2.t ............................ 267/3823 Can't use an undefined value as an ARRAY reference at ../lib/TAP/Parser/Multiplexer.pm line 139.
make: *** [test_harness] Error 4


The Perl code in question is this:

        unless (@ready) {
            return unless $sel->count;
            @ready = $sel->can_read;
        }

        my ( $h, $parser, $stash, @handles ) = @{ shift @ready };
        my $result = $parser->next;


With a little bit of annotation:

diff --git a/cpan/Test-Harness/lib/TAP/Parser/Multiplexer.pm b/cpan/Test-Harness
index 913aa92..4b7f173 100644
--- a/cpan/Test-Harness/lib/TAP/Parser/Multiplexer.pm
+++ b/cpan/Test-Harness/lib/TAP/Parser/Multiplexer.pm
@@ -132,8 +132,15 @@ sub _iter {
         }

         unless (@ready) {
-            return unless $sel->count;
+           my $count = $sel->count;
+            return unless $count;
             @ready = $sel->can_read;
+           use Devel::Peek;
+           use Data::Dumper;
+           unless (defined $ready[0]) {
+               Dump $count;
+               print Dumper \@ready;
+           }
         }

         my ( $h, $parser, $stash, @handles ) = @{ shift @ready };


I can see that $count is 6, and @ready is empty:

===(   48991;42   468/1750   292/1750 )=================================SV = IV(0x101ea70) at 0x101ea80
  REFCNT = 1
  FLAGS = (PADMY,IOK,pIOK)
  IV = 6
$VAR1 = [];
Can't use an undefined value as an ARRAY reference at ../lib/TAP/Parser/Multiplexer.pm line 146.


strace on that annotated version looks like this:

read(3, "ok 1175\n", 65536)             = 8
select(16, [3 4 5 7 8 9], NULL, NULL, NULL) = 1 (in [3])
select(16, [3 8], NULL, NULL, NULL)     = 1 (in [3])
read(3, "ok 1176\n", 65536)             = 8
select(16, [3 4 5 7 8 9], NULL, NULL, NULL) = 1 (in [3])
select(16, [3 8], NULL, NULL, NULL)     = 1 (in [3])
read(3, "ok 1177\n", 65536)             = 8
select(16, [3 4 5 7 8 9], NULL, NULL, NULL) = ? ERESTARTNOHAND (To be restarted)
--- SIGPROF (Profiling timer expired) @ 0 (0) ---
rt_sigreturn(0x1b)                      = -1 EINTR (Interrupted system call)
write(2, "SV = ", 5)                    = 5
write(2, "IV(0x101ea70) at 0x101ea80\n  REF"..., 67) = 67
write(2, "  IV = 6", 8)                 = 8
write(2, "\n", 1)                       = 1
write(1, "$VAR1 = [];\n", 12)           = 12
write(2, "Can't use an undefined value as "..., 97) = 97
rt_sigaction(SIGHUP, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGQUIT, NULL, {SIG_DFL, [], 0}, 8) = 0


So whose bug is it?

1) pp_sselect, for not restarting on that signal?
2) IO::Select for returning a contradictory set of results?
3) TAP::Parser::Multiplexer, for not coping with this?

Nicholas Clark

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
Site configuration information for perl 5.19.1:

Configured by nick at Thu Jun 20 13:27:16 CEST 2013.

Summary of my perl5 (revision 5 version 19 subversion 1) configuration:
  Derived from: e08fc7eabc43f861faa02b59949821de0e73b037
  Platform:
    osname=linux, osvers=2.6.32-5-amd64, archname=x86_64-linux
    uname='linux gcc20 2.6.32-5-amd64 #1 smp mon jan 16 16:22:28 utc 2012 x86_64 gnulinux '
    config_args='-des -Dusedevel -Accflags=-pg -Aldflags=-pg -Alddlflags=-pg -shared'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-pg -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-pg -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.4.5', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -pg -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib/../lib /usr/lib/../lib /lib /usr/lib /lib64 /usr/lib64
    libs=-lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.11.3.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.11.3'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags=' -pg -shared -L/usr/local/lib -fstack-protector'

Locally applied patches:
    

---
@INC for perl 5.19.1:
    lib
    /usr/local/lib/perl5/site_perl/5.19.1/x86_64-linux
    /usr/local/lib/perl5/site_perl/5.19.1
    /usr/local/lib/perl5/5.19.1/x86_64-linux
    /usr/local/lib/perl5/5.19.1
    .

---
Environment for perl 5.19.1:
    HOME=/home/nick
    LANG (unset)
    LANGUAGE=en_US:en
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/nick/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/sbin:/sbin:/usr/sbin
    PERL_BADLANG (unset)
    SHELL=/bin/bash


Thread Next


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