llvm-project/lldb/source/Commands
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
..
CMakeLists.txt [cmake] Remove LLVM_NO_RTTI. 2015-09-03 08:46:55 +00:00
CommandCompletions.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes. 2016-02-19 19:33:46 +00:00
CommandObjectApropos.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes. 2016-02-19 19:33:46 +00:00
CommandObjectApropos.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectArgs.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes. 2016-02-19 19:33:46 +00:00
CommandObjectArgs.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectBreakpoint.cpp Add an "offset" option to "break set -n" and "break set -f -l". 2016-03-09 18:59:13 +00:00
CommandObjectBreakpoint.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectBreakpointCommand.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes. 2016-02-19 19:33:46 +00:00
CommandObjectBreakpointCommand.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectBugreport.cpp commands: Use override instead of virtual. 2015-10-07 16:56:17 +00:00
CommandObjectBugreport.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectCommands.cpp A few more improvements on the way to the command alias refactoring 2016-03-08 05:37:15 +00:00
CommandObjectCommands.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectDisassemble.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes. 2016-02-20 00:58:29 +00:00
CommandObjectDisassemble.h Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes. 2016-02-20 00:58:29 +00:00
CommandObjectExpression.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes. 2016-02-19 19:33:46 +00:00
CommandObjectExpression.h Added support to the expression command for dropping into the REPL at will. 2015-10-20 00:55:21 +00:00
CommandObjectFrame.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes. 2016-02-19 19:33:46 +00:00
CommandObjectFrame.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectGUI.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
CommandObjectGUI.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectHelp.cpp Lots of progress on the CommandAlias refactoring 2016-03-14 22:17:04 +00:00
CommandObjectHelp.h When 'help' cannot find a command, produce additional help text that also points the user to the apropos and type lookup commands 2016-02-29 23:22:53 +00:00
CommandObjectLanguage.cpp Replace accidental DOS (and mixed) line endings in a few text files 2016-01-11 18:07:47 +00:00
CommandObjectLanguage.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectLog.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes. 2016-02-20 00:58:29 +00:00
CommandObjectLog.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectMemory.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes. 2016-02-20 00:58:29 +00:00
CommandObjectMemory.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectMultiword.cpp Attempt to fix the Ubuntu buildbot by making FindLongestCommandWord a free template function in lldb_private 2016-03-08 03:48:41 +00:00
CommandObjectPlatform.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in source/Commands/CommandObjectPlatform.cpp; other minor fixes. 2016-02-22 19:02:01 +00:00
CommandObjectPlatform.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectPlugin.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes. 2016-02-20 00:58:29 +00:00
CommandObjectPlugin.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectProcess.cpp This change introduces a "ExpressionExecutionThread" to the ThreadList. 2016-03-12 02:45:34 +00:00
CommandObjectProcess.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectQuit.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
CommandObjectQuit.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectRegister.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes. 2016-02-23 01:43:44 +00:00
CommandObjectRegister.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectSettings.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes. 2016-02-24 02:05:55 +00:00
CommandObjectSettings.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectSource.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes. 2016-02-24 02:05:55 +00:00
CommandObjectSource.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectSyntax.cpp When 'help' cannot find a command, produce additional help text that also points the user to the apropos and type lookup commands 2016-02-29 23:22:53 +00:00
CommandObjectSyntax.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectTarget.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in source/Commands/CommandObjectTarget.cpp; other minor fixes. 2016-02-25 19:02:39 +00:00
CommandObjectTarget.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectThread.cpp Fix deadlock due to thread list locking in 'bt all' with obj-c 2016-03-17 18:52:41 +00:00
CommandObjectThread.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectType.cpp Improve the 'type lookup' command such that it guesses to use the current's frame language as the one to start searching from. 2016-03-15 21:50:51 +00:00
CommandObjectType.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectVersion.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
CommandObjectVersion.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectWatchpoint.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes. 2016-02-24 02:05:55 +00:00
CommandObjectWatchpoint.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectWatchpointCommand.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes. 2016-02-23 01:43:44 +00:00
CommandObjectWatchpointCommand.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00