llvm-project/lldb
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
..
cmake Add support for reading line tables from PDB files. 2016-03-02 22:05:52 +00:00
docs Include -c, -core in the lldb(1) man page 2015-12-16 15:37:21 +00:00
examples Python 3 - modernize exception catching syntax. 2015-11-03 19:49:05 +00:00
include/lldb Don't crash if the TypeSP is empty. 2016-03-15 21:58:28 +00:00
lit Rename MSVC top-level folder to avoid name collision. 2016-01-13 22:00:44 +00:00
lldb.xcodeproj Bump the lldb version # in the xcode project files from 2016-03-15 04:36:11 +00:00
lldb.xcworkspace Working on getting the OSX build green 2015-05-12 02:20:27 +00:00
packages/Python/lldbsuite Switch from unittest2.expectedFailure to our own decorator on TestSTL 2016-03-16 10:39:33 +00:00
resources Bump the lldb version # in the xcode project files from 2016-03-15 04:36:11 +00:00
scripts Check for a NULL input filehandle before referencing it. 2016-03-11 18:49:38 +00:00
source Fix deadlock due to thread list locking in 'bt all' with obj-c 2016-03-17 18:52:41 +00:00
test Fix ResourceWarning about unclosed file in use_lldb_suite_root.py. 2016-01-15 22:22:35 +00:00
third_party/Python/module Put progress.py back, apparently this can't be deleted. 2015-12-09 21:32:28 +00:00
tools Bump the lldb version # in the xcode project files from 2016-03-15 04:36:11 +00:00
unittests Fix a bunch of signedness warnings in unittests 2016-03-11 09:00:23 +00:00
utils Python 3: Modernize exception raising syntax. 2015-11-03 21:01:45 +00:00
www Update the website with lots of new info about building / testing. 2016-02-24 22:19:23 +00:00
.arcconfig
.clang-format Update .clang-format file to support break after return type. 2015-12-28 22:09:29 +00:00
.gitignore modify Xcode build to use cmake/ninja for internal llvm/clang 2016-01-28 07:36:44 +00:00
CMakeLists.txt Fix CMake dependency on lldb.py 2015-11-18 21:09:55 +00:00
CODE_OWNERS.txt Added myself to the CODE_OWNERS.txt list for a few subsystems. 2015-11-09 01:24:36 +00:00
INSTALL.txt Revert the patch to Test Commit Access 2015-07-06 11:26:51 +00:00
LICENSE.TXT
use_lldb_suite_root.py Preparation for turning lldbsuite into a Python package. 2015-10-27 22:33:47 +00:00