[Lldb-commits] [PATCH] D114288: [NFC] Refactor symbol table parsing.
Pavel Labath via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Nov 23 09:44:24 PST 2021
labath added a comment.
I don't believe this solution is correct.
How did this work before? Is it because `ObjectFileELF::GetSymtab` contained the same (incorrect) unique_ptr pattern?
How about we just prime the symtab (or whatever is needed) before we start the thread pool indexing?
================
Comment at: lldb/source/Symbol/ObjectFile.cpp:723
+Symtab *ObjectFile::GetSymtab() {
+ // std::unique_ptr is thread safe to access. If it is already set, then we
+ // can hand out the existing pointer. The symbol table has it's own mutex
----------------
This is not true. unique_ptr makes no guarantees about the safety of concurrent accesses to a single unique_ptr object. While this may work on current hardware (it will most likely work on x86), it will make tsan very unhappy.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114288/new/
https://reviews.llvm.org/D114288
More information about the lldb-commits
mailing list