[all-commits] [llvm/llvm-project] 4fd517: [lsan] Be more conservative in SuspendedThreadsLis...

Leonard Grey via All-commits all-commits at lists.llvm.org
Wed Jun 28 01:40:37 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4fd517d6133e8ad2a35da60f5e0cd76d61868157
      https://github.com/llvm/llvm-project/commit/4fd517d6133e8ad2a35da60f5e0cd76d61868157
  Author: Leonard Grey <lgrey at chromium.org>
  Date:   2023-06-28 (Wed, 28 Jun 2023)

  Changed paths:
    M compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_mac.cpp

  Log Message:
  -----------
  [lsan] Be more conservative in SuspendedThreadsListMac::GetRegistersAndSP

Currently, we only return REGISTERS_UNAVAILABLE_FATAL if we receive
KERN_INVALID_ARGUMENT from thread_status. In reality, there are other
possible return values (MACH_SEND_INVALID_DEST for example) that make it
dangerous to read memory. This can be demonstrated by running
create_thread_leak.cpp in standalone mode where it will appear to hang
due to a EXC_BAD_ACCESS while scanning the stack.

This change reverses the current logic to treat MIG_ARRAY_TOO_LARGE as
non-fatal, and all other errors as fatal.

Differential revision: https://reviews.llvm.org/D153072




More information about the All-commits mailing list