llvm-capstone/lldb
Jason Molenda 66b92830c9
[lldb] [debugserver] Shut down the exception thread when clearing (#70979)
MachProcess has a MachTask as an ivar. In the MachProcess dtor, we call
MachTask::Clear() to clear its state, before running the dtor of all our
ivars, including the MachTask one.

When we attach on darwin, MachProcess calls
MachTask::StartExceptionThread which does the task_for_pid and then
starts a thread to listen for mach messages. Then MachProcess calls
ptrace(PT_ATTACHEXC). If that ptrace() fails, MachProcess will call
MachTask::Clear. But the exception thread is now up & running and is not
stopped; its ivars will be reset by the Clear() method, and its object
will be freed after the dtor runs.

Actually eliciting a crash in this scenario is very timing sensitive; I
hand-modified debugserver to fail to PT_ATTACHEXC trying to simulate it
on my desktop and was unable. But looking at the source, and an
occasional crash report we've received, it's clear that this is
possible.

rdar://117521198
2023-11-01 16:14:36 -07:00
..
bindings Add the ability to get a C++ vtable ValueObject from another ValueObj… (#67599) 2023-10-30 17:46:18 -07:00
cmake [LLDB] Allow specifying a custom exports file (#68013) 2023-10-05 20:17:48 -04:00
docs [lldb][docs][AArch64] Update example in SME docs 2023-10-25 13:12:37 +00:00
examples [lldb/test] Fix failures following ec456ba9ca 2023-10-26 21:21:54 -07:00
include Revert "[lldb/Target] Delay image loading after corefile process creation (#70351)" 2023-10-31 20:35:25 -07:00
packages/Python/lldbsuite [lldb][AArch64] Add SME2's ZT0 register (#70205) 2023-11-01 10:40:25 +00:00
resources [lldb][NFC] Remove copy of debugserver entitlements plist 2023-01-31 12:58:37 -08:00
scripts [lldb] Replace the usage of module imp with module importlib (#70443) 2023-10-31 17:08:55 -03:00
source [clang][NFC] Rename ArgPassingKind to RecordArgPassingKind (#70955) 2023-11-01 20:38:28 +04:00
test [lldb][AArch64] Add SME2's ZT0 register (#70205) 2023-11-01 10:40:25 +00:00
third_party/Python/module [lldb] Remove use of __future__ in python 2023-08-14 14:14:48 -07:00
tools [lldb] [debugserver] Shut down the exception thread when clearing (#70979) 2023-11-01 16:14:36 -07:00
unittests Revert "[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (#70392)" 2023-10-30 17:40:11 -07:00
utils [llvm][tblgen] Add Source Filename for emitSourceFileHeader (#65744) 2023-09-26 13:40:56 +08:00
.clang-format
.clang-tidy
.gitignore
CMakeLists.txt Reland "[CMake] Bumps minimum version to 3.20.0. 2023-05-27 12:51:21 +02:00
CodeOwners.rst [lldb] Remove more references to lldb-vscode (#69696) 2023-10-20 15:08:37 +01:00
LICENSE.TXT
use_lldb_suite_root.py [lldb] Format more Python files with black (#65979) 2023-09-12 08:46:34 +01:00