1 // Check that stores in signal handlers are not recorded in origin history.
2 // This is, in fact, undesired behavior caused by our chained origins
3 // implementation being not async-signal-safe.
5 // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -O3 %s -o %t && \
6 // RUN: not %run %t >%t.out 2>&1
7 // RUN: FileCheck %s < %t.out
9 // RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -O3 %s -o %t && \
10 // RUN: not %run %t >%t.out 2>&1
11 // RUN: FileCheck %s < %t.out
13 // Reported deadly signal due to stack-overflow
14 // XFAIL: target={{.*netbsd.*}}
18 #include <sys/types.h>
23 void SignalHandler(int signo
) {
27 int main(int argc
, char *argv
[]) {
31 signal(SIGHUP
, SignalHandler
);
32 kill(getpid(), SIGHUP
);
33 signal(SIGHUP
, SIG_DFL
);
38 // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
39 // CHECK-NOT: in SignalHandler