Subject: | Remove unreliable test depending on return of system under $SIG{CHLD} = 'IGNORE' |
The return value of system $^X, '-e', 0 is unreliable when $SIG{CHILD} is set to 'IGNORE'. The system() return value
reflects the return value of the wait(2) call, but the actual return value will depend on whether the parent process
managed to enter the system call before the kid exists or not, that is it depends on the timing of when the kid and
parent are actually allocated time to run on the CPU.
If the kid has not exited then wait will collect the information from the kid and return 0. If the kid has exited then wait
returns -1 because there are no more kids left to wait for.
Because of this we see test failures under Linux where the results are actually inconsistent between repeated calls to
system.
Subject: | 0001-Remove-unreliable-test-depending-on-return-of-system.patch |
From eb7aeb658b8668e110b70ec18b25929a8593c5a6 Mon Sep 17 00:00:00 2001
From: Gisle Aas <gisle@aas.no>
Date: Wed, 4 Nov 2009 21:52:05 +0100
Subject: [PATCH] Remove unreliable test depending on return of system under $SIG{CHLD} = 'IGNORE'
The return value of system $^X, '-e', 0 is unreliable when $SIG{CHILD}
is set to 'IGNORE'. The system() return value reflects the return
value of the wait(2) call, but the actual return value will depend
on whether the parent process managed to enter the system call before
the kid exists or not, that is it depends on the timing of when the kid
and parent are actually allocated time to run on the CPU.
If the kid has not exited then wait will collect the information from
the kid and return 0. If the kid has exited then wait returns -1
because there are no more kids left to wait for.
Because of this we see test failures under Linux where the results are
actually inconsistent between repeated calls to system.
---
t/IPC-Run3.t | 18 ------------------
1 files changed, 0 insertions(+), 18 deletions(-)
diff --git a/t/IPC-Run3.t b/t/IPC-Run3.t
index bf4db21..12d0d26 100644
--- a/t/IPC-Run3.t
+++ b/t/IPC-Run3.t
@@ -201,24 +201,6 @@ sub {
close FH;
ok $out, "IN1\nIN2\n";
},
-
-# check that run3 doesn't die on platforms where system()
-# returns -1 when SIGCHLD is ignored (RT #14272)
-sub {
- my $system_child_error = eval
- {
- local $SIG{CHLD} = "IGNORE";
- system $^X, '-e', 0;
- $?;
- };
- my $run3_child_error = eval
- {
- local $SIG{CHLD} = "IGNORE";
- run3 [ $^X, '-e', 0 ], \undef, \undef, \undef, { return_if_system_error => 1 };
- $?;
- };
- ok $run3_child_error, $system_child_error;
-},
);
plan tests => 0+@tests;
--
1.6.2.95.g934f7