[Lldb-commits] [PATCH] D134842: Improve dynamic loader support in DynamicLoaderPOSIXDYLD when using core files.

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 29 04:31:16 PDT 2022


labath added a comment.

In D134842#3822740 <https://reviews.llvm.org/D134842#3822740>, @yinghuitan wrote:

> I am surprised other major companies did not hit this issue.

That could be because this is something specific to your environment. Just to be clear, is this happening for *all* core files or only for some of them? If only some, is there anything special about the state of the applications that produced those core files (e.g. are they in the middle of loading a shared library?)
Even though this may very well be the right fix for middle-of-dlopen core dumps (we can't really wait for the loading to finish), I suspect this is actually masking some other problem, as the amount of time an application spends in the RT_ADD state is very brief, and it shouldn't be doing anything crash-prone while in there.



================
Comment at: lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp:174-181
+  // If we have a core file, we will read the current rendezvous state
+  // from the core file's memory which will indicate there is nothing
+  // to do, but we need it to load all of the shared libraries. If we
+  // don't change this, then "info.state" will be set to eAdd and the
+  // m_previous.state will be eConsistent and GetAction() will return
+  // eNoAction when we need it to return eTakeSnapshot.
+  if (IsCoreFile())
----------------
How about we just change `GetAction` to directly return `eTakeSnapshot` in this case?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134842/new/

https://reviews.llvm.org/D134842



More information about the lldb-commits mailing list