diff options
author | Vitaly Buka <vitalybuka@google.com> | 2023-12-12 17:15:57 -0800 |
---|---|---|
committer | Vitaly Buka <vitalybuka@google.com> | 2023-12-12 17:15:57 -0800 |
commit | 615540318e4c2968f2f08e9647c0660ca73f1459 (patch) | |
tree | 4633c223cf19c26024bd9863a6a65c7bd9918e79 | |
parent | 5c4317f5610316cfe5550f1366e1323116529799 (diff) | |
download | llvm-615540318e4c2968f2f08e9647c0660ca73f1459.zip llvm-615540318e4c2968f2f08e9647c0660ca73f1459.tar.gz llvm-615540318e4c2968f2f08e9647c0660ca73f1459.tar.bz2 |
[𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.4
[skip ci]
-rw-r--r-- | compiler-rt/test/sanitizer_common/TestCases/Posix/fork_threaded.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/fork_threaded.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/fork_threaded.cpp index 0526384..1e3a8eb 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Posix/fork_threaded.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/fork_threaded.cpp @@ -4,6 +4,10 @@ // Forking in multithread environment is unsupported. However we already have // some workarounds, and will add more, so this is the test. +// The test try to check two things: +// 1. Internal mutexes used by `inparent` thread do not deadlock `inchild` +// thread. +// 2. Stack poisoned by `inparent` is not poisoned in `inchild` thread. #include <assert.h> #include <pthread.h> @@ -22,7 +26,7 @@ pthread_barrier_t bar; // Without appropriate workarounds this code can cause the forked process to // start with locked internal mutexes. -void CanDeadLock() { +void ShouldNotDeadlock() { // Don't bother with leaks, we try to trigger allocator or lsan deadlock. __lsan::ScopedDisabler disable; char *volatile p = new char[10]; @@ -42,7 +46,7 @@ NOSAN static void *inparent(void *arg) { pthread_barrier_wait(&bar); for (;;) - CanDeadLock(); + ShouldNotDeadlock(); return 0; } @@ -50,7 +54,7 @@ NOSAN static void *inparent(void *arg) { NOSAN static void *inchild(void *arg) { char t[kBufferSize]; check_mem_is_good(t, sizeof(t)); - CanDeadLock(); + ShouldNotDeadlock(); return 0; } |