Skip to main content.
home | support | download

Back to List Archive

Re: Using - problems with open2 in Win 2000

From: Bill Moseley <moseley(at)>
Date: Mon Jan 19 2004 - 07:02:59 GMT
On Sun, Jan 18, 2004 at 07:06:58PM -0800, David L Norris wrote:
> Add waitpid to windows_fork() in and see if it helps.  This
> appears to solve the problem for me.  It doesn't always occur with my
> test document.  Only 2 or 3 of my test runs failed on the 65th document.

Thanks Dave for looking at this.  for pdf files it's opening two 
programs, so I assume that means 130 or so zombie processes.  Seems like 
a rather small process table.

> Here's what I'm testing:
> sub windows_fork {
>     my ( $self, @args ) =3D @_;
>     require IPC::Open2;
>     my ( $rdrfh, $wtrfh );
>     my @command =3D map { s/"/\\"/g; qq["$_"] }  @args;
>     my $pid =3D IPC::Open2::open2($rdrfh, $wtrfh, @command );
>    =20
>     waitpid $pid,0;

Argh.  Can you explain why that should go there?  I understand about 
reaping, but why there instead of after reading and closing the file 
handle.  Searching google for things like "waitpid perl windows" is not 
an enjoyable experience. I'm seeing examples of the waitpid with flags=0 
right after the "fork" and also in a more classic style of reaping after 

Bill Moseley
Received on Mon Jan 19 07:03:32 2004