Deadlock with DWARF logging and symbol enumeration

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)