aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common.h
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-08-04 17:50:58 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-08-04 17:50:58 +0200
commit3a7200e49b4e697ed93fb88178180ab6171d3f17 (patch)
tree555c10f070c2b40e4b929f6f34f48fd694190c0f /executor/common.h
parentbf45aa5363c1f8db29b7c6fe9d086560857b0db4 (diff)
executor: abort fuse connection
If the test process is not dying after 100ms, abort all fuse connections in the system. This gets rid at least of simple fuse deadlocks, let's see how well this works in all cases.
Diffstat (limited to 'executor/common.h')
-rw-r--r--executor/common.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/executor/common.h b/executor/common.h
index 5419599da..6ba88ea3b 100644
--- a/executor/common.h
+++ b/executor/common.h
@@ -116,6 +116,17 @@ static void install_segv_handler()
#endif
#endif
+#if !GOOS_linux
+#if SYZ_EXECUTOR || SYZ_REPEAT && SYZ_EXECUTOR_USES_FORK_SERVER
+static void kill_and_wait(int pid, int* status)
+{
+ kill(pid, SIGKILL);
+ while (waitpid(-1, status, 0) != pid) {
+ }
+}
+#endif
+#endif
+
#if !GOOS_windows
#if SYZ_EXECUTOR || SYZ_THREADED || SYZ_REPEAT && SYZ_EXECUTOR_USES_FORK_SERVER
static void sleep_ms(uint64 ms)
@@ -573,12 +584,7 @@ static void loop()
continue;
#endif
debug("killing\n");
-#if GOOS_linux
- kill(-pid, SIGKILL);
-#endif
- kill(pid, SIGKILL);
- while (waitpid(-1, &status, WAIT_FLAGS) != pid) {
- }
+ kill_and_wait(pid, &status);
break;
}
#if SYZ_EXECUTOR