[Lldb-commits] [PATCH] D52406: Make DIE_IS_BEING_PARSED local to the current thread.
Greg Clayton via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Sep 24 08:57:04 PDT 2018
clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.
A little background might help here: The lldb_private::Module lock is used to prevent multiple queries into the DWARF from stomping on each other.
Multi-threaded DWARF parsing was primarily added to speed up indexing and the only place it is used. Is that not true? Indexing is just creating name tables and the accelerator tables we need so that we can partially parse the DWARF later. No type parsing should be happening when indexing. All other accesses to the DWARF must be done via a SymbolFile API that takes the module lock to stop multiple threads from stomping on each other.
This fix will not work for a few reasons:
- multiple threads should not be allowed to parse types at the same time, the module lock must be taken, if that isn't the case, then this needs to be fixed
- even if we were to allow this fix and if multiple threads are able to parse DWARF at the same time, this fix wouldn't work. We have one clang AST per symbol and we convert DWARF into clang ASTs. We can't have multiple threads creating a "class Foo" at the same time and populating them at anytime.
So my main point is we need to use the module lock to avoid having multiple threads doing important work that will cause crashes.
More information about the lldb-commits