[Bug 287050] Change in PTRACE_CONTINUE causing valgrind/vgdb to no longer be able to interrupt debuggee

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 26 May 2025 12:24:48 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=287050

--- Comment #8 from Konstantin Belousov <kib@FreeBSD.org> ---
The issue is quite clear, after you provided the test program.
The sleeper is indeed sleeping, and the new attach is careful to not disturb
the
sleep on attach.  In other words, all that PT_CONTINUE does is clear the
stopped
status of the victim, which continues to sleep.  Below is the 'ps l' output for
the sleeper after PT_CONTINUE:
UID PID PPID C PRI NI   VSZ  RSS MWCHAN STAT TT     TIME COMMAND
  0  25   14 3  21  0 14084 2208 nanslp SX   u0  0:00.01 /root/sleeper

I am not sure how to handle it.  I tend to think that PT_ATTACH should grow
an option to request the transient behavior, and by default keep interrupting
the interruptible sleeps.  Then truss and other tools that prefer the soft
attach would specify the option.

Another fix is for your ptracer to do PT_CONTINUE with a signal, then do not
pass the signal back to the app.

-- 
You are receiving this mail because:
You are the assignee for the bug.