summaryrefslogtreecommitdiffstats
path: root/runtime/jdwp
diff options
context:
space:
mode:
authorSebastien Hertz <shertz@google.com>2014-02-18 14:16:00 +0100
committerSebastien Hertz <shertz@google.com>2014-02-19 09:10:40 +0000
commit21e729c7859ce7909e85d135f6c9e32bbba38860 (patch)
tree6cb11d1db4e19d4e68a55960e862d7304a41f05a /runtime/jdwp
parent2c3458dbda97b70158ee7ef22d13ce473a2a2147 (diff)
downloadart-21e729c7859ce7909e85d135f6c9e32bbba38860.zip
art-21e729c7859ce7909e85d135f6c9e32bbba38860.tar.gz
art-21e729c7859ce7909e85d135f6c9e32bbba38860.tar.bz2
Fix failing check during JDWP invoke.
Fixes a race where the JDWP thread expects the invoke thread can be suspended (suspend_count != 0) before invoke thread actually updates its suspend count. It happens after the invoke thread signals the JDWP thread to notify invoke is completed but before incrementing its suspend count. In the meantime, the JDWP thread wakes up and checks whether invoke thread has updated its supend count. But there is no way to prevent the JDWP thread to do so before the invoke thread updates its suspend count. We now move the invoke completion code after the suspend count update. Then the JDWP thread wakes up at the right time. Bug: 11247837 Bug: 12578041 Change-Id: Ib6079c6e330671b34217838e26b1e758706d3da6
Diffstat (limited to 'runtime/jdwp')
-rw-r--r--runtime/jdwp/jdwp_event.cc8
1 files changed, 0 insertions, 8 deletions
diff --git a/runtime/jdwp/jdwp_event.cc b/runtime/jdwp/jdwp_event.cc
index e372c26..677b04b 100644
--- a/runtime/jdwp/jdwp_event.cc
+++ b/runtime/jdwp/jdwp_event.cc
@@ -576,14 +576,6 @@ void JdwpState::SuspendByPolicy(JdwpSuspendPolicy suspend_policy, JDWP::ObjectId
Dbg::ExecuteMethod(pReq);
pReq->error = ERR_NONE;
-
- /* clear this before signaling */
- pReq->invoke_needed = false;
-
- VLOG(jdwp) << "invoke complete, signaling and self-suspending";
- Thread* self = Thread::Current();
- MutexLock mu(self, pReq->lock);
- pReq->cond.Signal(self);
}
}