[Lldb-commits] [PATCH] D93874: [process] fix exec support on Linux

walter erquinigo via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 28 14:09:50 PST 2020


wallace created this revision.
wallace added reviewers: clayborg, jingham.
wallace requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

On Linux, unlike Darwin, after a process performs exec, the thread id doesn't change. This causes any living thread plans to fail because the original thread is now invalid. This crash only happens if thread plans are still executing when the original thread dies.

I've been testing this on my Linux machine and it happens mostly when I attach to a process that then execs. If LLDB launches that process, this problem almost never happens. As with most race conditions, it's hard to predict and reproduce. In any case, I added a test with an attach scenario that works correctly on my machine.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93874

Files:
  lldb/include/lldb/Target/Process.h
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Target/Process.cpp
  lldb/test/API/functionalities/exec/TestExec.py
  lldb/test/API/functionalities/exec/main.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93874.313899.patch
Type: text/x-patch
Size: 4900 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20201228/40f4006f/attachment.bin>


More information about the lldb-commits mailing list