Subject: | run_forked("/usr/bin/echo test") captures no output |
For our HP-UX builds we get test failures from test 5 in t/03_run-forked.t about 80% of the time. This can be reproduced with this simple script:
#!perl
use strict;
use IPC::Cmd qw(run_forked);
my $cmd = shift || "/usr/bin/echo test";
my $r = run_forked($cmd);
#use Data::Dump; dd $r;
print "not " unless $r->{stdout} =~ /test/;
print "ok\n";
When it fails the script hangs for about 9 seconds before it exits. The failure to capture output also happens for simple commands like "ls /", not for more complex ones like "ls -l /" or "echo test; echo". I believe this to be timing related. It might look like the process doesn't get a chance to set up capturing for commands that execute quickly.
When it fails the script hangs for about 9 seconds before it exits. The failure to capture output also happens for simple commands like "ls /", not for more complex ones like "ls -l /" or "echo test; echo". I believe this to be timing related. It might look like the process doesn't get a chance to set up capturing for commands that execute quickly.
perl -V
Summary of my perl5 (revision 5 version 16 subversion 3) configuration:
Platform:
osname=hpux, osvers=11.00, archname=PA-RISC1.1-thread-multi
uname='hp-ux bertha b.11.00 u 9000800 136901587 unlimited-user license '
config_args='-ders -Dcc=cc -Dusethreads -Duseithreads -Uinstallusrbinperl -Ulocincpth= -Uloclibpth= -Dsh=/usr/bin/sh -Dd_attribut=undef -Dd_attribute_warn_unused_result=undef -Dd_u32align=define -Aprepend:libswanted=cl -Dvendorprefix=/home/gecko/ap1604/vendor -Dvendorlib=/home/gecko/ap1604/vendor/lib -Dvendorarch=/home/gecko/ap1604/vendor/lib -Darchname=PA-RISC1.1 -Accflags=+DAportable +DS2.0 -Doptimize=-O -Accflags=+Z -Accflags=-DUSE_SITECUSTOMIZE -Duselargefiles -Accflags=-DPERL_RELOCATABLE_INCPUSH -Dprefix=/home/gecko/ap1604 -Dprivlib=/home/gecko/ap1604/lib -Darchlib=/home/gecko/ap1604/lib -Dsiteprefix=/home/gecko/ap1604/site -Dsitelib=/home/gecko/ap1604/site/lib -Dsitearch=/home/gecko/ap1604/site/lib -Dsed=/usr/bin/sed -Duseshrplib -Dcf_by=ActiveState -Dcf_email=support@ActiveState.com'
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='cc', ccflags =' -D_POSIX_C_SOURCE=199506L -D_REENTRANT -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +DAportable +DS2.0 +Z -DUSE_SITECUSTOMIZE -DPERL_RELOCATABLE_INCPUSH -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ',
optimize='-O',
cppflags='-Aa -D__STDC_EXT__ -D_HPUX_SOURCE -D_POSIX_C_SOURCE=199506L -D_REENTRANT -D_HPUX_SOURCE -Wl,+vnocompatwarnings +DAportable +DS2.0 +Z -DUSE_SITECUSTOMIZE -DPERL_RELOCATABLE_INCPUSH'
ccversion='B.11.X.35098-35101.GP', gccversion='', gccosandvers=''
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='/usr/bin/ld', ldflags =''
libpth=/lib /usr/lib /usr/ccs/lib /usr/local/lib
libs=-lcl -lnsl -lnm -lndbm -lmalloc -ldld -lm -lcrypt -lsec -lpthread -lc
perllibs=-lcl -lnsl -lnm -lmalloc -ldld -lm -lcrypt -lsec -lpthread -lc
libc=/lib/libc.sl, so=sl, useshrplib=true, libperl=libperl.sl
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferred '
cccdlflags='+Z', lddlflags='-b +vnocompatwarnings'
Characteristics of this binary (from libperl):
Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT
PERL_MALLOC_WRAP PERL_PRESERVE_IVUV
PERL_RELOCATABLE_INCPUSH USE_ITHREADS USE_LARGE_FILES
USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
USE_REENTRANT_API USE_SITECUSTOMIZE
Built under hpux
Compiled at Dec 30 2013 13:11:43