From 70d60275cc2860bde50e5f9c5b151e94f745ae14 Mon Sep 17 00:00:00 2001 From: Sebastien Hertz Date: Fri, 14 Apr 2017 14:18:36 +0200 Subject: [PATCH] JDWP: fix Dbg::ResumeThread A thread should be resumed if and only if it has been suspended by the debugger. Therefore, we must check the debug suspend count, not the suspend count (which includes debug suspend count). Otherwise we could end up resuming a thread that has been suspended for another reason (like a GC) but not by the debugger itself. Bug: 27385848 Test: art/tools/run-jdwp-tests.sh --mode=host --variant=X64 Change-Id: I70ed6dfc233501e92332634650babf21ba911048 --- runtime/debugger.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/debugger.cc b/runtime/debugger.cc index 868d8dfea..039b60a26 100644 --- a/runtime/debugger.cc +++ b/runtime/debugger.cc @@ -2453,7 +2453,7 @@ void Dbg::ResumeThread(JDWP::ObjectId thread_id) { bool needs_resume; { MutexLock mu2(soa.Self(), *Locks::thread_suspend_count_lock_); - needs_resume = thread->GetSuspendCount() > 0; + needs_resume = thread->GetDebugSuspendCount() > 0; } if (needs_resume) { Runtime::Current()->GetThreadList()->Resume(thread, true); -- 2.11.0