[all-commits] [llvm/llvm-project] 8bdddc: Fix lldb crash while handling concurrent vfork() (...
jeffreytan81 via All-commits
all-commits at lists.llvm.org
Wed Mar 6 10:50:45 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8bdddcf0bb5a40e6ce6cbf7fc6b7ce576e2b032d
https://github.com/llvm/llvm-project/commit/8bdddcf0bb5a40e6ce6cbf7fc6b7ce576e2b032d
Author: jeffreytan81 <jeffreytan at meta.com>
Date: 2024-03-06 (Wed, 06 Mar 2024)
Changed paths:
M lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
M lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
M lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
A lldb/test/API/functionalities/fork/concurrent_vfork/Makefile
A lldb/test/API/functionalities/fork/concurrent_vfork/TestConcurrentVFork.py
A lldb/test/API/functionalities/fork/concurrent_vfork/main.cpp
Log Message:
-----------
Fix lldb crash while handling concurrent vfork() (#81564)
We got user reporting lldb crash while the debuggee is calling vfork()
concurrently from multiple threads.
The crash happens because the current implementation can only handle
single vfork, vforkdone protocol transaction.
This diff fixes the crash by lldb-server storing forked debuggee's <pid,
tid> pair in jstopinfo which will be decoded by lldb client to create
StopInfoVFork for follow parent/child policy. Each StopInfoVFork will
later have a corresponding vforkdone packet. So the patch also changes
the `m_vfork_in_progress` to be reference counting based.
Two new test cases are added which crash/assert without the changes in
this patch.
---------
Co-authored-by: jeffreytan81 <jeffreytan at fb.com>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list