[Lldb-commits] [PATCH] D41909: Fix deadlock in dwarf logging

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 11 08:08:24 PST 2018

clayborg added a comment.

In https://reviews.llvm.org/D41909#973299, @tberghammer wrote:

> Why do we need to lock the Module mutex in SymbolVendor::FindFunctions? I think a better option would be to remove that lock and if it is needed then lock it just for the calls where it necessary. The fact that SymbolVendor locks a mutex inside a Module feels like a pretty bad layering violation for me what can cause many other deadlocks so it would be nice to fix that instead of hacking it around here.

Module + ObjectFile + SymbolVendor + SymbolFile all lock the module's mutex before doing anything that might be adding information to the Module. SymbolVendor::FindFunctions will lazily parse functions from the debug info and populate things inside the module, so the lock is required. You can't put individual locks on Module + ObjectFile + SymbolVendor + SymbolFile as it _will_ cause deadlocks.


More information about the lldb-commits mailing list