[Bug 250954] ptrace(): weird ordering between inheriting debug registers and reporting a new thread
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Mon Nov 9 12:29:37 UTC 2020
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250954
--- Comment #10 from Michał Górny <mgorny at gentoo.org> ---
Hmm, I should have mentioned that this affect LLDB right now.
The scenario where this happens is this:
1. Create breakpoint immediately after pthread_create().
2. When LLDB hits the breakpoint, create a watchpoint.
3. Resume.
The problem is that the new thread is already created at 2. but LLDB does not
know about it, so the watchpoint is created only on thread 1.
We can solve this on LLDB end in either of two ways:
a. Relist all threads (via PT_GETLWPLIST) on every stop. In this case, LLDB at
point 2. would have the correct thread list even though the event is not yet
delivered.
b. Copy dbregs to new threads in LLDB when they are reported. In this case,
the watchpoints are correctly propagated to new threads when LLDB becomes aware
of these threads.
Regardless of this, it would be nice if kernel had predictable behavior here,
i.e. reported the new thread before pthread_create() returned.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list