[Lldb-commits] [PATCH] D40472: DWZ 09/12: Protect DWARFDebugInfo::m_compile_units by a new mutex

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 27 10:52:53 PST 2017


clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

DWARFDebugInfo::ParseCompileUnitHeadersIfNeeded() seems broken, see inlined comments.



================
Comment at: source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp:114-119
+    {
+      // C++14: std::lock_guard<std::shared_timed_mutex>
+      // guard(m_dwz_uniq_mutex);
+      std::lock_guard<std::recursive_mutex> guard(m_dwz_uniq_mutex);
+      m_compile_units.push_back(cu_sp);
     }
----------------
So if some code calls DWARFDebugInfo::ParseCompileUnitHeadersIfNeeded() after this loop has added 1 compile unit they will return and be able to proceed? This doesn't make sense.


================
Comment at: source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h:80
+  // C++14: mutable std::shared_timed_mutex m_dwz_uniq_mutex;
+  mutable std::recursive_mutex m_dwz_uniq_mutex;
+
----------------
Why is this named m_dwz_uniq_mutex? Seems to be protected m_compile_units. Should this be named "m_compile_units_mutex"?


https://reviews.llvm.org/D40472





More information about the lldb-commits mailing list