So by running my script like so:

PERLDB_OPTS="NonStop=1 LineInfo=debug.out AutoTrace"
/home/utils/perl-5.8.8/bin/perl -d ./RSM.pl

I have been able to see precisely where the hang is occurring.  The
child gets all the way to exec'ing:
POE::Wheel::Run::new(/home/utils/perl-5.8.8/lib/site_perl/5.8.8/POE/Whee
l/Run.pm:498):
498:            exec(join(" ", $program, @$prog_args))
499:              or die "can't exec ($program) in child pid $$: $!";

But the parent is stuck waiting to read from a pipe:
POE::Wheel::Run::new(/home/utils/perl-5.8.8/lib/site_perl/5.8.8/POE/Whee
l/Run.pm:546):
546:      <$sem_pipe_read>;

Ideas?  Thoughts?  Suggestions?

-----Original Message-----
From: Eric Busto 
Sent: Wednesday, March 14, 2007 11:36 AM
To: poe@perl.org
Subject: POE::Wheel::Run->new not returning?

I'm using POE::Wheel::Run to spawn off child rsync processes.  Every so
often (i.e. every 1 in 50 to 100 calls), the new method fails to return.
Since it seems a bit random, I'm stumped on how to go about figuring
this out.  Has anyone else encountered this before, or have any ideas?

I'm not doing anything crazy, I don't believe:

$heap->{task}   = POE::Wheel::Run->new (
                Program         => $cmd,
                StdoutEvent     => 'child_stdout',
                StderrEvent     => 'child_stderr',
                ErrorEvent      => 'child_error'
);

$kernel->sig_child($heap->{task}->PID(), 'child_done');
print now(), " Back from POE::Wheel::Run new\n";

Most of the time I see the print line, but when I don't, a strace of the
perl process shows:

# strace -p 14399
Process 14399 attached - interrupt to quit
read(23, 

And a gdb backtrace:

(gdb) bt
#0  0x0000003bb48b7e52 in __read_nocancel () from /lib64/tls/libc.so.6
#1  0x00000000004b9da1 in PerlIOUnix_read ()
#2  0x00000000004b8b0e in Perl_PerlIO_read ()
#3  0x00000000004baeff in PerlIOBuf_fill ()
#4  0x00000000004b8dbd in Perl_PerlIO_fill ()
#5  0x00000000004b964a in PerlIOBase_read ()
#6  0x00000000004b8b0e in Perl_PerlIO_read ()
#7  0x00000000004bc4a3 in PerlIO_getc ()
#8  0x0000000000474f23 in Perl_sv_gets ()
#9  0x0000000000468a9b in Perl_do_readline ()
#10 0x00000000004653ae in Perl_runops_standard ()
#11 0x000000000041eae8 in S_run_body ()
#12 0x000000000041ea20 in perl_run ()
#13 0x000000000041bb64 in main ()
(gdb) 

------------------------------------------------------------------------
-----------
This email message is for the sole use of the intended recipient(s) and
may contain
confidential information.  Any unauthorized review, use, disclosure or
distribution
is prohibited.  If you are not the intended recipient, please contact
the sender by
reply email and destroy all copies of the original message.
------------------------------------------------------------------------
-----------

Reply via email to