Move SIGABRT to SIGKILL to make sure the child process is terminated by a signal.
SIGABRT can't guarantee this because the child process can install signal handler for SIGABRT.
Add a final _exit(1) after ChildProcessFn in case execvp() fails.
Change-Id: I353720b10c6ea42826efcafce5ff2699fd246e22
close(start_signal_pipe[1]);
close(exec_child_pipe[0]);
ChildProcessFn(args_, start_signal_pipe[0], exec_child_pipe[1]);
+ _exit(0);
}
// In parent process.
close(start_signal_pipe[0]);
auto workload = Workload::CreateWorkload({"sleep", "10"});
ASSERT_TRUE(workload != nullptr);
ASSERT_TRUE(workload->Start());
- ASSERT_EQ(0, kill(workload->GetPid(), SIGABRT));
+ ASSERT_EQ(0, kill(workload->GetPid(), SIGKILL));
while (!signaled) {
}
}