summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Riss <friss@apple.com>2019-03-06 21:56:14 +0000
committerFrederic Riss <friss@apple.com>2019-03-06 21:56:14 +0000
commitfcda044d22b8632c637a92d3031deae234014b24 (patch)
tree3f91af940eb6d4b04d58c35f1ec8bbc2c9e33fe8
parent94b1ff72f57ac38052aa0a44b12904fba04d5bb6 (diff)
downloadbcm5719-llvm-fcda044d22b8632c637a92d3031deae234014b24.tar.gz
bcm5719-llvm-fcda044d22b8632c637a92d3031deae234014b24.zip
[debugserver] Fix IsUserReady thread filtering
Summary: In 2010 (r118866), filtering code was added to debugserver to avoid reporting threads that were "not ready to be displayed to the user". This code inspects the thread's state and discards threads marked 'uninterruptible'. Turns out, this state is pretty common and not only a characterisitic of 'user-readiness'. This filtering was tracked down as the source of the flakiness of TestQueues and TestConcurrent* with the symptom of missing threads. We discussed with the kernel team and there should be no need for us to filter the restult of task_threads(). Everything that is returned from there can be examined. So I went on and tried to remove the filtering completely. This produces other test failures, where we were reporting more theads than expected. Always threads that had been terminated, but weren't removed from the task bookkeeping structures yet. Those threads always had a PC of 0. This patch changes the heuristic to make the filtering a little less strict and only rejects threads that are 'uninteruptible' *and* have a PC of 0. This has proven to be solid in my testing. Reviewers: jasonmolenda, clayborg, jingham Subscribers: jdoerfert, lldb-commits Differential Revision: https://reviews.llvm.org/D58912 llvm-svn: 355555
-rw-r--r--lldb/tools/debugserver/source/MacOSX/MachThread.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/tools/debugserver/source/MacOSX/MachThread.cpp b/lldb/tools/debugserver/source/MacOSX/MachThread.cpp
index 9c2b6597e16..b51ea694922 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachThread.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/MachThread.cpp
@@ -243,7 +243,7 @@ bool MachThread::IsUserReady() {
case TH_STATE_HALTED:
return true;
}
- return false;
+ return GetPC(0) != 0;
}
struct thread_basic_info *MachThread::GetBasicInfo() {
OpenPOWER on IntegriCloud