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

(cherry picked from commit 653738e895ba022be1179a95a85089e7bc66dbbe)

Details

Provenance
jhbAuthored on Jun 7 2023, 7:26 PM
Reviewer
kib
Differential Revision
D39856: ptrace: Clear TDB_BORN during PT_DETACH.
Parents
rGb086848fc086: libpfctl: Don't pass stack garbage to free.
Branches
Unknown
Tags
Unknown