llvm-project/lldb/source
Stephane Sezer f81049184a Fix deadlock due to thread list locking in 'bt all' with obj-c
Summary:
The gdb-remote async thread cannot modify thread state while the main thread
holds a lock on the state. Don't use locking thread iteration for bt all.

Specifically, the deadlock manifests when lldb attempts to JIT code to
symbolicate objective c while backtracing. As part of this code path,
SetPrivateState() is called on an async thread. This async thread will
block waiting for the thread_list lock held by the main thread in
CommandObjectIterateOverThreads. The main thread will also block on the
async thread during DoResume (although with a timeout), leading to a
deadlock. Due to the timeout, the deadlock is not immediately apparent,
but the inferior will be left in an invalid state after the bt all completes,
and objective-c symbols will not be successfully resolved in the backtrace.

Reviewers: andrew.w.kaylor, jingham, clayborg

Subscribers: sas, lldb-commits

Differential Revision: http://reviews.llvm.org/D18075

Change by Francis Ricci <fjricci@fb.com>

llvm-svn: 263735
2016-03-17 18:52:41 +00:00
..
API Move OperatingSystem plugins to SystemInitializerFull 2016-03-16 08:48:56 +00:00
Breakpoint Add an "offset" option to "break set -n" and "break set -f -l". 2016-03-09 18:59:13 +00:00
Commands Fix deadlock due to thread list locking in 'bt all' with obj-c 2016-03-17 18:52:41 +00:00
Core Remove unnecessary <limits> includes. 2016-03-15 21:11:02 +00:00
DataFormatters This change introduces a "ExpressionExecutionThread" to the ThreadList. 2016-03-12 02:45:34 +00:00
Expression Fix "ninja check-lldb" crash in IRExecutionUnit.cpp 2016-03-09 22:05:17 +00:00
Host Fix null pointer "dereference" in DomainSocket 2016-03-16 14:03:20 +00:00
Initialization Move OperatingSystem plugins to SystemInitializerFull 2016-03-16 08:48:56 +00:00
Interpreter Workaround the fact that "b" is now a separate command object from "_regexp-break", and thus "help b" doesn't show the possible syntaxes 2016-03-15 01:57:10 +00:00
Plugins Fix thread/process ID reading from linux core files 2016-03-16 09:19:57 +00:00
Symbol Fix ClangASTContext::GetFunctionArgumentAtIndex() to not water down the type to the canonical type before handing the type out for the function type. 2016-03-15 22:43:26 +00:00
Target Only try to load the OS plug-in after a shared library load if we don't already have one. 2016-03-15 22:44:07 +00:00
Utility Fix all of the unannotated switch cases to annotate the fall through or do the right thing and break. 2016-02-26 01:20:20 +00:00
CMakeLists.txt Add initial CMake glue for the NetBSD platform 2015-10-24 00:27:04 +00:00
lldb.cpp Add more NetBSD platform glue for lldb 2015-11-07 15:31:54 +00:00