I had to help someone fix an issue with IPC:Open2 a week or so ago, we were seeing all the processes turn to zombies in a Linux environment.

Our problem was 2 fold, we were not flushing the buffers enough:
$| = 1;
This fixed that problem (buffer by line instead of chunk).

The second problem was a little stranger (zombies invading our machines...late night sci-fi here we come!)

I had to read 3 docs on IPC:Open2 before I found this on the CPAN site (IPC:Open2):
open2() does not wait for and reap the child process after it exits. E +xcept for short programs where it's acceptable to let the operating s +ystem take care of this, you need to do this yourself. This is normal +ly as simple as calling waitpid $pid, 0 when you're done with the pro +cess. Failing to do this can result in an accumulation of defunct or +"zombie" processes. See perlfunc/waitpid for more information.
You won't find this text (unfortunitly) in  perldoc perlipc. Or in the Camel, at least I can't find it :)

Hope this helps, and I'm not making some glaring error :)

In reply to Re: open2 unreliable? by Helter
in thread open2 unreliable? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.