Module Name:    src
Committed By:   kamil
Date:           Sun Oct 13 03:19:57 UTC 2019

Modified Files:
        src/sys/kern: kern_sig.c

Log Message:
Fix one the the root causes of unreliability of the ptrace(2)ed threads

In case of sigswitchin away in issignal() and continuing the execution on
PT_CONTINUE (or equivalent call), there is a time window when another
thread could cause the process state to be changed to PS_STOPPING.

In the current logic, a thread would receive signal 0 (no-signal) and exit
from issignal(), returning to userland and never finishing the process of
stopping all LWPs. This causes hangs waitpid() waiting for SIGCHLD and
the callout polling for the state of the process in an infinite loop.

Instead of prompting for a returned signal from a debugger, repeat the
issignal() loop, this will cause checking the PS_STOPPING flag again and
sigswitching away in the scenario of stopping the process.

To generate a diff of this commit:
cvs rdiff -u -r1.370 -r1.371 src/sys/kern/kern_sig.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Reply via email to