I've inherited a program that had been running fine for years, but now is throwing errors all the time, and I have no idea why. As far as I can tell, the only change that was made was adding some debugging code in the general vicinity of the problem. I'm not knowledgeable about any IPC-related stuff, and have been reading what I can, but I don't understand what this is doing, which makes it hard to debug :-(

The program is a web form that shells out to an external (Perl) script to perform a time-consuming task. The structure of the relevant section is more or less this (none of this code is mine):

$SIG{CHLD} = 'IGNORE'; # ignore dead children, to avoid zombie process +es my $child = fork(); if ($child) { # parent; return data $self->return_data( { data => $data } ); } else { # child; run external process my $child_output; eval { # gather a whole lot of data; assemble $external_command use IPC::System::Simple 'capture'; $child_output = capture($external_command); }; $self->log("Error when running [$external_command]: $child_output") +if $child_output; $self->log("Error when running [$external_command]: $@") if $@; CORE::exit(0); }
This is now constantly throwing errors having the form:
Error when running [{external command}]: "{external command}" failed t +o start: "No child processes" at /path/to/web/program.pm line 459.
If anyone could suggest what's going on and how I can fix it, I would be very grateful indeed.

In reply to "No child processes" problem with fork() call 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.