[Lldb-commits] [PATCH] D128264: [lldb/dyld-posix] Avoid reading the module list in inconsistent states

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 21 05:25:22 PDT 2022


labath created this revision.
labath added reviewers: mgorny, emrekultursay.
Herald added a project: All.
labath requested review of this revision.
Herald added a project: LLDB.

New glibc versions (since 2.34 or including this
https://github.com/bminor/glibc/commit/ed3ce71f5c64c5f07cbde0ef03554ea8950d8f2c
patch) trigger the rendezvous breakpoint after they have already added
some modules to the list. This did not play well with our dynamic
loader plugin which was doing a diff of the the reported modules in the
before (RT_ADD) and after (RT_CONSISTENT) states. Specifically, it
caused us to miss some of the modules.

While I think the old behavior makes more sense, I don't think that lldb
is doing the right thing either, as the documentation states that we
should not be expecting a consistent view in the RT_ADD (and RT_DELETE)
states.

Therefore, this patch changes the lldb algorithm to compare the module
list against the previous consistent snapshot. This fixes the previous
issue, and I believe it is more correct in general. It also reduces the
number of times we are fetching the module info, which should speed up
the debugging of processes with many shared libraries.

The change in RefreshModules ensures we don't broadcast the loaded
notification for the dynamic loader (ld.so) module more than once.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128264

Files:
  lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
  lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128264.438654.patch
Type: text/x-patch
Size: 3978 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220621/5b6c7b27/attachment.bin>


More information about the lldb-commits mailing list