[lldb-dev] Deadlock with DWARF logging and symbol enumeration

Thomas Goodfellow via lldb-dev lldb-dev at lists.llvm.org
Mon Jul 1 03:39:29 PDT 2019


I'm describing this initially through email rather than raising a defect
because I haven't developed a usable reproduction (I'm working on an
out-of-tree target based off the v8 release) and because it only bites with
DWARF logging enabled it's unlikely to affect many people.

The deadlock comes from SymbolVendor::FindFunctions() holding a module lock
across the delegated FindFunctions() call, which for SymbolFileDWARF
results in TaskMapToInt() passing the task to a worker "task runner"
thread. With DWARF logging enabled the worker thread calls
Module::GetDescription() from LogMessageVerboseBacktrace(), which tries to
claim the same mutex.

With a simple workaround (don't always enable DWARF logging) this
particular instance is easy to avoid but perhaps there are other cases or
some wider implications, e.g. rules for task runner behaviour to avoid such
states? (possibly part of the problem is that the FindFunctions() interface
looks synchronous so holding a recursive mutex across the call isn't
obviously risky)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20190701/0ec0f2b7/attachment.html>


More information about the lldb-dev mailing list