[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
Mon Feb 14 17:59:24 PST 2022

ilya-nozhkin added a comment.

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

> Can anyone try out the following patch and see if this stops the race condition
> https://reviews.llvm.org/D119797
> It might solve the problem.

Yeah, now the test passes and VS Code doesn't fall into infinite waiting loop.
I'm still concerned about that weird event dispatching happening during the launch, but lldb-vscode now works, so, I can close this review if you want to investigate this bug sometime later.

In D119548#3321459 <https://reviews.llvm.org/D119548#3321459>, @jingham wrote:

> Target::Launch consumes the "stop at entry" event when it calls WaitForProcessToStop.

Actually, there is a gap between returning from `Process::Launch` and setting up the target's hijacking listener. I think, the stop event sneaks past the target right during this time interval. So, `Target::Launch` can't consume it because there is nothing to consume (i.e. the event has been added to another listener's queue). But I agree that it's odd that this event is broadcasted at all.



More information about the lldb-commits mailing list