[Lldb-commits] [REVIEW] Data race fix in Address.h
gclayton at apple.com
Mon Apr 22 13:39:18 PDT 2013
Looks ok to me.
On Apr 22, 2013, at 12:40 PM, "Malea, Daniel" <daniel.malea at intel.com> wrote:
> Hi all,
> I ran a LLDB through Intel Parallel Inspector XE 2013… a data race and deadlock detection tool, and it found about 16 problems, most of which are data races. Please review the attached patch that fixes the first race in the Address class. I verified this patch reduces the number of problems Inspector finds to 14, which I plan to investigate before writing some tests that exercise the SB-API from multiple threads.
> The problem is that Address is used from multiple threads and m_offset is read and written to without locking, thereby allowing the possibility of partial reads from m_offset. The fix is to wrap m_offset in std::atomic<>.
> Phabricator link for easier reviewing: http://llvm-reviews.chandlerc.com/D706
> (Patch is also attached)
> The details of the race condition are below.
> The write happens here from one thread:
> liblldb.so!SetRawAddress - Address.h:471
> liblldb.so!ChangePC - StackFrame.cpp:252
> liblldb.so!SetPC - RegisterContext.cpp:109
> liblldb.so!UpdateAfterBreakpoint - RegisterContext_x86_64.cpp:722
> liblldb.so!BreakNotify - POSIXThread.cpp:247
> liblldb.so!Notify - POSIXThread.cpp:227
> liblldb.so!RefreshStateAfterStop - ProcessPOSIX.cpp:419
> liblldb.so!ShouldBroadcastEvent - Process.cpp:3647
> liblldb.so!HandlePrivateEvent - Process.cpp:3890
> liblldb.so!RunPrivateStateThread - Process.cpp:3992
> liblldb.so!PrivateStateThread - Process.cpp:3929
> liblldb.so!ThreadCreateTrampoline - Host.cpp:560
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
More information about the lldb-commits