[all-commits] [llvm/llvm-project] 129394: asan_memory_profile: Fix for deadlock in memory pr...

Sanjeet Karan Singh via All-commits all-commits at lists.llvm.org
Fri Mar 31 21:11:00 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 129394ff50ed28a0b85d742c8ae315758bb22582
  Author: Sanjeet Karan Singh <ssingh6 at ciena.com>
  Date:   2023-03-31 (Fri, 31 Mar 2023)

  Changed paths:
    M compiler-rt/lib/asan/asan_memory_profile.cpp

  Log Message:
  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

More information about the All-commits mailing list