[Lldb-commits] [PATCH] D120755: Fix race condition when launching and attaching.This is a modified version of a previous patch that was reverted: https://reviews.llvm.org/D119797This version only waits for the process to stop when using "launchCommands" or "attachCommands"...

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 7 11:47:52 PST 2022


clayborg added a comment.

I think I found the root cause of the issue in linux and it might fix this test for many other platforms:

commit c41c57468949036a06695f06a97a8e14e8b252bd <https://reviews.llvm.org/rGc41c57468949036a06695f06a97a8e14e8b252bd> (HEAD -> main)
Author: Greg Clayton <gclayton at fb.com>
Date:   Mon Mar 7 11:31:21 2022 -0800

  Fix buildbots after https://reviews.llvm.org/D120755.
  
  This improves this test a lot because before when using the "attachCommands" to run the following commands:
  
  (lldb) target create -d /path/to/a.out
  (lldb) process launch
  
  This was racy as it wasn't stopping the program at the entry point, and the process might run to completion before we can even debug it. With the recent changes to the "attachCommands" we were waiting for the process to stop, but the process might be exited already, and that _should_ have caused the attach to fail since there was no process to attach to. By adding "--stop-at-entry" to the process launch, we ensure this should be less racy and give us a valid process to attach to.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120755



More information about the lldb-commits mailing list