diff --git a/compiler-rt/lib/asan/asan_posix.cpp b/compiler-rt/lib/asan/asan_posix.cpp index 4ee8d7d399e9..39685696a0d0 100644 --- a/compiler-rt/lib/asan/asan_posix.cpp +++ b/compiler-rt/lib/asan/asan_posix.cpp @@ -149,6 +149,7 @@ void PlatformTSDDtor(void *tsd) { # endif static void BeforeFork() { + VReport(2, "BeforeFork tid: %llu\n", GetTid()); if (CAN_SANITIZE_LEAKS) { __lsan::LockGlobal(); } @@ -168,6 +169,7 @@ static void AfterFork(bool fork_child) { if (CAN_SANITIZE_LEAKS) { __lsan::UnlockGlobal(); } + VReport(2, "AfterFork tid: %llu\n", GetTid()); } void InstallAtForkHandler() { diff --git a/compiler-rt/lib/dfsan/dfsan_custom.cpp b/compiler-rt/lib/dfsan/dfsan_custom.cpp index 03147a79ed65..dbc00d7ac3ea 100644 --- a/compiler-rt/lib/dfsan/dfsan_custom.cpp +++ b/compiler-rt/lib/dfsan/dfsan_custom.cpp @@ -2859,6 +2859,7 @@ WRAPPER_ALIAS(__isoc99_sscanf, sscanf) WRAPPER_ALIAS(__isoc23_sscanf, sscanf) static void BeforeFork() { + VReport(2, "BeforeFork tid: %llu\n", GetTid()); StackDepotLockBeforeFork(); ChainedOriginDepotLockBeforeFork(); } @@ -2866,6 +2867,7 @@ static void BeforeFork() { static void AfterFork(bool fork_child) { ChainedOriginDepotUnlockAfterFork(fork_child); StackDepotUnlockAfterFork(fork_child); + VReport(2, "AfterFork tid: %llu\n", GetTid()); } SANITIZER_INTERFACE_ATTRIBUTE diff --git a/compiler-rt/lib/hwasan/hwasan_linux.cpp b/compiler-rt/lib/hwasan/hwasan_linux.cpp index d174fb882ca4..68651d3d39d0 100644 --- a/compiler-rt/lib/hwasan/hwasan_linux.cpp +++ b/compiler-rt/lib/hwasan/hwasan_linux.cpp @@ -528,6 +528,7 @@ uptr TagMemoryAligned(uptr p, uptr size, tag_t tag) { } static void BeforeFork() { + VReport(2, "BeforeFork tid: %llu\n", GetTid()); if (CAN_SANITIZE_LEAKS) { __lsan::LockGlobal(); } @@ -547,6 +548,7 @@ static void AfterFork(bool fork_child) { if (CAN_SANITIZE_LEAKS) { __lsan::UnlockGlobal(); } + VReport(2, "AfterFork tid: %llu\n", GetTid()); } void HwasanInstallAtForkHandler() { diff --git a/compiler-rt/lib/lsan/lsan_posix.cpp b/compiler-rt/lib/lsan/lsan_posix.cpp index ddd9fee07e89..593000b9eef9 100644 --- a/compiler-rt/lib/lsan/lsan_posix.cpp +++ b/compiler-rt/lib/lsan/lsan_posix.cpp @@ -97,6 +97,7 @@ void InstallAtExitCheckLeaks() { } static void BeforeFork() { + VReport(2, "BeforeFork tid: %llu\n", GetTid()); LockGlobal(); LockThreads(); LockAllocator(); @@ -108,6 +109,7 @@ static void AfterFork(bool fork_child) { UnlockAllocator(); UnlockThreads(); UnlockGlobal(); + VReport(2, "AfterFork tid: %llu\n", GetTid()); } void InstallAtForkHandler() { diff --git a/compiler-rt/lib/msan/msan_linux.cpp b/compiler-rt/lib/msan/msan_linux.cpp index 894cf17002bb..7140de7e9c54 100644 --- a/compiler-rt/lib/msan/msan_linux.cpp +++ b/compiler-rt/lib/msan/msan_linux.cpp @@ -302,6 +302,7 @@ void MsanTSDDtor(void *tsd) { # endif static void BeforeFork() { + VReport(2, "BeforeFork tid: %llu\n", GetTid()); // Usually we lock ThreadRegistry, but msan does not have one. LockAllocator(); StackDepotLockBeforeFork(); @@ -313,6 +314,7 @@ static void AfterFork(bool fork_child) { StackDepotUnlockAfterFork(fork_child); UnlockAllocator(); // Usually we unlock ThreadRegistry, but msan does not have one. + VReport(2, "AfterFork tid: %llu\n", GetTid()); } void InstallAtForkHandler() { diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp b/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp index bf29aa316f68..5a2d39cd3060 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp @@ -806,6 +806,7 @@ int Finalize(ThreadState *thr) { #if !SANITIZER_GO void ForkBefore(ThreadState* thr, uptr pc) SANITIZER_NO_THREAD_SAFETY_ANALYSIS { + VReport(2, "BeforeFork tid: %llu\n", GetTid()); GlobalProcessorLock(); // Detaching from the slot makes OnUserFree skip writing to the shadow. // The slot will be locked so any attempts to use it will deadlock anyway. @@ -847,6 +848,7 @@ static void ForkAfter(ThreadState* thr, SlotAttachAndLock(thr); SlotUnlock(thr); GlobalProcessorUnlock(); + VReport(2, "AfterFork tid: %llu\n", GetTid()); } void ForkParentAfter(ThreadState* thr, uptr pc) { ForkAfter(thr, false); }