[Lldb-commits] [PATCH] D119548: [lldb] Fix race condition between lldb-vscode and stop hooks executor

Ilya Nozhkin via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 17 13:44:12 PST 2022


ilya-nozhkin added a comment.

In D119548#3330226 <https://reviews.llvm.org/D119548#3330226>, @clayborg wrote:

> Try out the https://reviews.llvm.org/D119797 patch and see if this fixes this issue? I have just updated it after responding to comments.

Yes, it fixes this particular race. But I think, that the issue is not only with stop hooks and lldb-vscode. Some other tools can do something similar to lldb-vscode and get the same issue. So, I think, it's still worth fixing the event dispatching.



================
Comment at: lldb/source/Target/Process.cpp:2458
+  if (launch_info.GetFlags().Test(eLaunchFlagStopAtEntry))
+    HandlePrivateEvent(first_stop_event_sp);
+
----------------
Btw, this seems to be the line that sends the public stop event. So, adding synchronicity check to the condition should fix the issue as well. But I'd keep the target's hijacking listener too because we still want to intercept all event during the launch, not to remove them.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119548/new/

https://reviews.llvm.org/D119548



More information about the lldb-commits mailing list