Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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):
This is now constantly throwing errors having the form:$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); }
If anyone could suggest what's going on and how I can fix it, I would be very grateful indeed.Error when running [{external command}]: "{external command}" failed t +o start: "No child processes" at /path/to/web/program.pm line 459.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "No child processes" problem with fork() call
by dave_the_m (Monsignor) on Jul 13, 2019 at 06:47 UTC | |
|
Re: "No child processes" problem with fork() call
by stevieb (Canon) on Jul 12, 2019 at 19:50 UTC | |
by Anonymous Monk on Jul 12, 2019 at 20:04 UTC | |
|
Re: "No child processes" problem with fork() call
by bliako (Abbot) on Jul 12, 2019 at 23:52 UTC | |
by bliako (Abbot) on Jul 13, 2019 at 13:38 UTC |