Skip to content

Commit 16784c0

Browse files
archshifteugenis
authored andcommitted
test/msan/sigwait: Don't silently ignore assertion failures
Summary: As the parent process would return 0 independent of whether the child succeeded, assertions in the child would be ignored. Reviewers: eugenis Reviewed By: eugenis Subscribers: #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D82400
1 parent f64dc4e commit 16784c0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler-rt/test/msan/sigwait.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <assert.h>
55
#include <signal.h>
66
#include <sys/time.h>
7+
#include <sys/wait.h>
78
#include <unistd.h>
89

910
#include <sanitizer/msan_interface.h>
@@ -19,7 +20,9 @@ void test_sigwait() {
1920

2021
if (pid_t pid = fork()) {
2122
kill(pid, SIGUSR1);
22-
_exit(0);
23+
int child_stat;
24+
wait(&child_stat);
25+
_exit(!WIFEXITED(child_stat));
2326
} else {
2427
int sig;
2528
int res = sigwait(&s, &sig);

0 commit comments

Comments
 (0)