Skip to main content.
home | support | download

Back to List Archive

Re: Using filter.pm - problems with open2 in Win 2000

From: <Allan_Watts(at)not-real.amp.com.au>
Date: Mon Jan 19 2004 - 22:42:15 GMT
Dave,

> Add waitpid to windows_fork() in Filter.pm 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.

Interesting that you found it a bit erratic.   In fact 64 files completed
was the best I ever got - which was always after rebooting my PC (I didn't
think you had to do that with Win 2000 ).   If re-running in the same
Command Prompt session after failure, the session froze usually on the 2nd
file, sometimes the 3rd ...

I had actually tried adding waitpid $pid,0; to filter.pm as suggested.   I
thought I had got the same error message (open2: IO::Pipe: Can't
spawn-NOWAIT:etc) ... but having run it so many times now, can't be sure ..
and it became time consuming when rebooting between runs..  However I tried
again with waitpid as suggested - first thing this morning after powering
up and reading my email.   The result:  it filtered the first 3 files and
then the session froze... Last messages before freezing are below.   I
guess I could pinpoint exactly where it is freezing...

Bill,
>  .. 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.

Actually for pdf files I only get success with 32 files, then it fails...
with the message "open2: IO::Pipe: Can't spawn-NOWAIT:etc  "

>  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.

I too couldn't figure out why waitid could be called straight after the
call to open2.

When I was first trying to figure out what was happening I was trying to
call it after the target file was finished with - but I couldn't get it to
work - which I attributed to my lack of Perl skills.  Which is why I put
together the little test routine - and discovered that waitid seemed to
solve the problem if called straight after the open2 call. Which should
have meant that I could easily call it in windows_fork() ..And was
disappointed when it didn't seem to work.. (was time to call in the
experts!)


Regards
Allan.
----------------------------------------------------------------------------------------------------------

Final Content type for c:/data/swish/test/doc03.doc is text/plain
  >Filter SWISH::Filters::Doc2txt=HASH(0x1ca2814) converted from
[application/ms
word] to [text/plain]

Content-Length: 137
Last-Mtime: 1074080814
Document-Type: TXT*
Path-Name: c:/data/swish/test/doc03.doc

The cat sat on the mat

Now is the time for all good men to come to the aid of the party.

The quick brown fox jumps over the lazy dog.


>> Starting to process new document: application/msword
 ++Checking filter [SWISH::Filters::Doc2txt=HASH(0x1ca2814)] for
application/msw
ord










This email message and any accompanying attachments may contain
information that is confidential and is subject to legal privilege. If you are not
the intended recipient, do not read, use, disseminate, distribute or copy this 
message or attachments. If you have received this message in error, please 
notify the sender immediately and delete this message. Any views expressed
in this message are those of the individual sender, except where the sender
expressly, and with authority, states them to be the views of AMP. Before 
opening any attachments, please check them for viruses and defects.
Received on Mon Jan 19 22:44:42 2004