From d9b493f203ab5649809c4b1a5096272ba6e40bda Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 24 Dec 2015 19:14:15 +0100 Subject: executor: don't use WUNTRACED in wait WUNTRACED wait returns when child has stopped. That's not what we want to wait for. If it's stopped we need to timeout wait and kill the stopped child. --- executor/executor.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'executor') diff --git a/executor/executor.cc b/executor/executor.cc index 4b1b38968..6b15aa401 100644 --- a/executor/executor.cc +++ b/executor/executor.cc @@ -221,7 +221,7 @@ int main() kill(pid, SIGKILL); } debug("waitpid(%d)\n", pid); - if (waitpid(pid, &status, __WALL | WUNTRACED) != pid) + if (waitpid(pid, &status, __WALL) != pid) fail("waitpid failed"); debug("waitpid(%d) returned\n", pid); // Drain SIGCHLD signals. @@ -235,7 +235,7 @@ int main() // We've hit 2 systems that mishandle sigtimedwait. uint64_t start = current_time_ms(); for (;;) { - int res = waitpid(pid, &status, __WALL | WUNTRACED | WNOHANG); + int res = waitpid(pid, &status, __WALL | WNOHANG); debug("waitpid(%d)=%d (%d)\n", pid, res, errno); if (res == pid) break; @@ -244,7 +244,7 @@ int main() debug("killing\n"); kill(-pid, SIGKILL); kill(pid, SIGKILL); - int res = waitpid(pid, &status, __WALL | WUNTRACED); + int res = waitpid(pid, &status, __WALL); debug("waitpid(%d)=%d (%d)\n", pid, res, errno); if (res == pid) break; -- cgit mrf-deployment