Subject: | parent killed(?) if child exits early |
Hi,
there seems to be a race condition with using "run". If the child exits
very quickly, the parent disappears.
Example:
use IPC::Run qw( run timeout );
my $in="\n"; my $out; my $err;
print "calling run: ";
run [ "sh", "-c", "exit 7" ], \$in, \$out, \$err, timeout(7);
print "done\n";
Sometimes the parent survives, but most of the time the final "print" is
not reached. With an additional delay everything works fine:
use IPC::Run qw( run timeout );
my $in="\n"; my $out; my $err;
print "calling run: ";
run [ "sh", "-c", "sleep 1; exit 7" ], \$in, \$out,
\$err, timeout(7);
print "done\n";