[compiler-rt] 16784c0 - test/msan/sigwait: Don't silently ignore assertion failures

Evgenii Stepanov via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 23 14:18:02 PDT 2020


Author: Gui Andrade
Date: 2020-06-23T14:10:51-07:00
New Revision: 16784c0558c43ccbc0242c7429bc065c68163cbd

URL: https://github.com/llvm/llvm-project/commit/16784c0558c43ccbc0242c7429bc065c68163cbd
DIFF: https://github.com/llvm/llvm-project/commit/16784c0558c43ccbc0242c7429bc065c68163cbd.diff

LOG: 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

Added: 
    

Modified: 
    compiler-rt/test/msan/sigwait.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/msan/sigwait.cpp b/compiler-rt/test/msan/sigwait.cpp
index 222fc34a1698..80f3f21ffff3 100644
--- a/compiler-rt/test/msan/sigwait.cpp
+++ b/compiler-rt/test/msan/sigwait.cpp
@@ -4,6 +4,7 @@
 #include <assert.h>
 #include <signal.h>
 #include <sys/time.h>
+#include <sys/wait.h>
 #include <unistd.h>
 
 #include <sanitizer/msan_interface.h>
@@ -19,7 +20,9 @@ void test_sigwait() {
 
   if (pid_t pid = fork()) {
     kill(pid, SIGUSR1);
-    _exit(0);
+    int child_stat;
+    wait(&child_stat);
+    _exit(!WIFEXITED(child_stat));
   } else {
     int sig;
     int res = sigwait(&s, &sig);


        


More information about the llvm-commits mailing list