[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)
Dmitry Vasilyev via lldb-commits
lldb-commits at lists.llvm.org
Wed Jul 31 03:50:24 PDT 2024
================
@@ -27,11 +27,13 @@ class TestLogHandler : public LogHandler {
: m_stream_sp(stream_sp) {}
void Emit(llvm::StringRef message) override {
+ std::lock_guard<std::mutex> guard(m_mutex);
----------------
slydiman wrote:
Probably I can separate this change to another patch. It is not related to the socket sharing. It is the fix of an old bug.
Host::LaunchProcess() requires to SetMonitorProcessCallback. This callback is called from the child process monitor thread. We cannot control this thread. lldb-server may crash if there is a logging around this callback because TestLogHandler is not thread safe.
I've kept this code here for now because I faced this issue only debugging this patch with 100 simultaneous child processes. It is hard to reproduce it other way. Note also [this comment](https://github.com/llvm/llvm-project/pull/101283#issuecomment-2259628620).
https://github.com/llvm/llvm-project/pull/101283
More information about the lldb-commits
mailing list