HomeFreeBSD

Do not go into sleep in sleepq_catch_signals() when SIGSTOP from

Description

Do not go into sleep in sleepq_catch_signals() when SIGSTOP from
PT_ATTACH was consumed.

In particular, do not clear TDP_FSTP in ptracestop() if td_wchan is
non-NULL. Leave it to sleepq_catch_signal() to clear and convert zero
return code to EINTR.

Otherwise, per submitter report, if the PT_ATTACH SIGSTOP was
delivered right after the thread was added to the sleepqueue but not
yet really sleep, and cursig() caused debugger attach, the thread
sleeps instead of returning to the userspace boundary with EINTR.

PR: 231445
Reported by: Efi Weiss <valmarelox@gmail.com>
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D20381

Details

Provenance
kibAuthored on
Reviewer
markj
Differential Revision
D20381: Do not go into sleep in sleepq_catch_signals() when SIGSTOP from PT_ATTACH was consumed.
Parents
rS348359: Add posixshmcontrol(1) page.
Branches
Unknown
Tags
Unknown