From 5055685cda022119052d86cb468cf2b7f4d19a13 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Thu, 3 Sep 2015 09:36:22 +0000 Subject: Fix deadlock while attaching to inferiors Summary: There was a race condition in the AsyncThread, where we would end up sending a vAttach notification to the thread before it got a chance set up its listener (this can be reproduced by adding a sleep() at the very beginning of ProcessGDBRemote::AsyncThread()). This event would then get lost and we LLDB would deadlock. I fix this by setting up the listener early on, in the ProcessGDBRemote constructor. This should improve the stability of all attach tests. For now, I am removing XTIMEOUT from TestAttachResume, and will watch the buildbots for signs of trouble. Reviewers: clayborg, ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12552 llvm-svn: 246756 --- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h') diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h index 0048004ecd2..c3b201bddeb 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h @@ -358,6 +358,7 @@ protected: Mutex m_last_stop_packet_mutex; GDBRemoteDynamicRegisterInfo m_register_info; Broadcaster m_async_broadcaster; + Listener m_async_listener; HostThread m_async_thread; Mutex m_async_thread_state_mutex; typedef std::vector tid_collection; -- cgit v1.2.3