From: Jim Ingham Date: Wed, 29 Jul 2015 00:40:36 +0000 (+0000) Subject: Lock the owners mutex in the BreakpointSite before updating the hit X-Git-Tag: studio-1.4~1326 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff244c1d9754b0632401a2bd36612afb7392cf44;p=platform%2Fupstream%2Fllvm.git Lock the owners mutex in the BreakpointSite before updating the hit counts. If you delete a breakpoint belonging to a site just as you are processing a hit on that site, you could cause the BreakpointSite loop to access a now deleted location. llvm-svn: 243507 --- diff --git a/lldb/source/Breakpoint/BreakpointSite.cpp b/lldb/source/Breakpoint/BreakpointSite.cpp index e9ce812..95b67b0 100644 --- a/lldb/source/Breakpoint/BreakpointSite.cpp +++ b/lldb/source/Breakpoint/BreakpointSite.cpp @@ -205,6 +205,7 @@ BreakpointSite::ValidForThisThread (Thread *thread) void BreakpointSite::BumpHitCounts() { + Mutex::Locker locker(m_owners_mutex); for (BreakpointLocationSP loc_sp : m_owners.BreakpointLocations()) { loc_sp->BumpHitCount();