5 Commits

Author SHA1 Message Date
Sanjeet Karan Singh
42fc9929ab asan_memory_profile: Fix for deadlock in memory profiler code.
Calling symbolization directly from stopTheWorld was causing deadlock.
For libc dep systems, symbolization uses dl_iterate_phdr, which acquire a
dl write lock. It could deadlock if the lock is already acquired by one of
suspended.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D146990
2023-04-04 16:41:44 -07:00
Vitaly Buka
56876fdd2e Revert "asan_memory_profile: Fix for deadlock in memory profiler code."
Deadlocks with internal symbolizer.
https://lab.llvm.org/buildbot/#/builders/37/builds/21181

This reverts commit 129394ff50ed28a0b85d742c8ae315758bb22582.
2023-04-03 22:59:02 -07:00
Shoaib Meenai
5d4f644b33 [asan] Fix Darwin runtimes compilation
It was failing because of size_t being unknown. I was going to just pull
in stddef.h, but the callback using size_t is only used for Linux and
NetBSD, so limit its definition to those platforms as well.
2023-04-01 02:22:17 -07:00
Sanjeet Karan Singh
129394ff50 asan_memory_profile: Fix for deadlock in memory profiler code.
Wrapping stopTheWorld in dl_iterate_phdr acquire dl_load lock before
calling the function. Acquiring dl_load, allocator and thread registry
locks before calling stopTheWorld ensures no other threads are holding
that locks, we can safely suspend them and reenter in tracer thread.
LockStuffAndStopTheWorld's logic here is same as lsan's implementation
of this function.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D146990
2023-03-31 21:10:34 -07:00
Nico Weber
217222abea compiler-rt: Rename .cc file in lib/asan to .cpp
Like r367463, but for asan.

llvm-svn: 367558
2019-08-01 13:43:28 +00:00