HomeFreeBSD

ptrace: Clear TDB_BORN during PT_DETACH.

Description

ptrace: Clear TDB_BORN during PT_DETACH.

If a debugger detaches from a process that has a new thread that has
not yet executed, the new thread will raise a SIGTRAP signal to report
it's thread birth event even after the detach. With the debugger
detached, this results in a SIGTRAP sent to the process and typically
a core dump. Fix this by clearing TDB_BORN from any new threads
during detach.

Bump __FreeBSD_version for debuggers to notice when the fix is
present.

Reported by: GDB's testsuite
Reviewed by: kib, markj (previous version)
Differential Revision: https://reviews.freebsd.org/D39856

Details

Provenance
jhbAuthored on Jun 7 2023, 7:26 PM
Reviewer
kib
Differential Revision
D39856: ptrace: Clear TDB_BORN during PT_DETACH.
Parents
rGaee3611fecba: pmcstat: Tweak typo fix.
Branches
Unknown
Tags
Unknown