[all-commits] [llvm/llvm-project] e1bd33: [lldb] Fix ThreadList assignment race (#98293)

Pavel Labath via All-commits all-commits at lists.llvm.org
Thu Jul 11 05:04:41 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e1bd337865fca9f455225ba37b76595d37bad213
      https://github.com/llvm/llvm-project/commit/e1bd337865fca9f455225ba37b76595d37bad213
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2024-07-11 (Thu, 11 Jul 2024)

  Changed paths:
    M lldb/include/lldb/Target/ThreadList.h
    M lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
    M lldb/source/Target/Process.cpp
    M lldb/source/Target/ThreadList.cpp

  Log Message:
  -----------
  [lldb] Fix ThreadList assignment race (#98293)

ThreadList uses the Process mutex to guard its state. This means its not
possible to safely modify its process member, as the member is required
to lock the mutex.

Fortunately for us, we never actually need to change the process member
(we always just juggle different kinds of thread lists belonging to the
same process).

This patch replaces the process member assignment (which is technically
a race even when it assigns the same value) with an assertion.

Since all this means that the class can never change its process member
value (and it also must be non-null at all times), I've also changed the
member type to a reference.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list