OSDN Git Service

Store method as ArtMethod* instead of jmethodId in Breakpoint
authorMathieu Chartier <mathieuc@google.com>
Wed, 28 Oct 2015 18:10:46 +0000 (11:10 -0700)
committerMathieu Chartier <mathieuc@google.com>
Wed, 28 Oct 2015 22:42:42 +0000 (15:42 -0700)
commit41af5e50d0b5e9d13084a61cfe9dfa6b6e201a40
treed8c47581bf110021fa10c05351d33c5f873e11e3
parent13f6af0f9c8af1fce34e9610ad9d30d4d0434478
Store method as ArtMethod* instead of jmethodId in Breakpoint

Previously we needed a ScopedObjectAccess for Dbg::VisitRoots,
this could cause deadlocks in the following scenario:

GC:
Goes to runnable state while holding mutator lock as shared held.
This occurred in Dbg::VisitRoots when calling Breakpoint::Method.

Other thread:
Calls SuspendAll and suspends the GC thread before it can go back
to suspended thread state. This thread then attempts to exclusive
lock mutator lock, but the GC is suspended while holding it in a
shared state.

Bug: 25336094
Change-Id: Idcb8d34c314b1d6951abe533a0cfa586cc07d7d6
runtime/debugger.cc