[Lldb-commits] [PATCH] D62316: DWARFContext: Make loading of sections thread-safe

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 23 07:25:10 PDT 2019


labath created this revision.
labath added reviewers: aprantl, JDevlieghere, clayborg.
Herald added a subscriber: arphaman.

SymbolFileDWARF used to load debug sections in a thread-safe manner.
When we moved to DWARFContext, we dropped the thread-safe part, because
we thought it was not necessary.

It turns out this was only mostly correct.

The "mostly" part is there because this is a problem only if we use the
manual index, as that is the only source of intra-module paralelism.
Also, this only seems to occur for extremely simple files (like the ones
I've been creating for tests lately), where we've managed to start
indexing before loading the debug_str section. Then, two threads start
to load the section simultaneously and produce wrong results.

On more complex files, something seems to be loading the debug_str section
before we start indexing, as I haven't been able to reproduce this
there, but I have not investigated what it is.

I've tried to come up with a test for this, but I haven't been able to
reproduce the problem reliably. Still, while doing so, I created a way
to generate many compile units on demand. Given that most of our tests
work with only one or two compile units, it seems like this could be
useful anyway.


https://reviews.llvm.org/D62316

Files:
  lit/SymbolFile/DWARF/parallel-indexing-stress.s
  source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
  source/Plugins/SymbolFile/DWARF/DWARFContext.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62316.200970.patch
Type: text/x-patch
Size: 9610 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190523/c1651ab5/attachment.bin>


More information about the lldb-commits mailing list