in reply to "No child processes" problem with fork() call

your error message looks like a system error. Has your OS changed/upgraded? Fork processes limits changed? Are you sure the spawned (extenral) process does what it used to do? Perhaps No child processes - system limit? can help?

Also: your script upon entry forks. Perhaps print something when it enters/forks to count how many forks=children you have (edit: and print something when child exits/returns to offset), perhaps this is a problem caused by a sow-happy driver script.

  • Comment on Re: "No child processes" problem with fork() call

Replies are listed 'Best First'.
Re^2: "No child processes" problem with fork() call
by bliako (Abbot) on Jul 13, 2019 at 13:38 UTC

    Re: No child processes - system limit? shows a way to recreate the problem which it attributes to: Normally, you'd get this error (ECHILD) if you wait for a child, but there is no child

    Also, from the source of IPC::System::Simple (sub capturex() called by capture()):

    # This next line also does an implicit fork. my $pid = open(my $pipe, '-|'); ## no critic if (not defined $pid) { croak sprintf(FAIL_START, $command, $!); } elsif (not $pid) { # Child process, execs command.

    So there is an implicit fork there expectedly. Additional to all your other forks.

    So I would follow dave_the_m's suggestion Re: "No child processes" problem with fork() call and check if fork() does succeed before waiting for that child. fork() may fail when a maximum number of children has been reached according to the OS.