-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Open
Labels
Description
Host::LaunchProcess() requires to SetMonitorProcessCallback. This callback is called from the child process monitor thread. We cannot control this thread anyway. GDBRemoteCommunicationServerPlatform::DebugserverProcessReaped() may cause a crash if this callback will be called from the child monitor thread after destroing the instance of GDBRemoteCommunicationServerPlatform.
llvm-project/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
Lines 521 to 526 in 2d36550
void GDBRemoteCommunicationServerPlatform::DebugserverProcessReaped( | |
lldb::pid_t pid) { | |
std::lock_guard<std::recursive_mutex> guard(m_spawned_pids_mutex); | |
m_port_map.FreePortForProcess(pid); | |
m_spawned_pids.erase(pid); | |
} |
And m_port_map requires an own mutex guard here.