Page MenuHomeFreeBSD

Only kill process group orphans if a remaining member is stopped due to a signal.
ClosedPublic

Authored by jhb on Sep 16 2015, 4:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 8 2024, 8:25 PM
Unknown Object (File)
Feb 28 2024, 4:36 AM
Unknown Object (File)
Jan 8 2024, 4:04 AM
Unknown Object (File)
Dec 20 2023, 1:30 AM
Unknown Object (File)
Dec 8 2023, 7:14 AM
Unknown Object (File)
Nov 24 2023, 8:31 PM
Unknown Object (File)
Jan 12 2023, 9:35 PM
Unknown Object (File)
Jan 8 2023, 4:28 AM
Subscribers

Details

Summary

When a process group leader exits, all of the processes in the group are
sent SIGHUP and SIGCONT if any of the processes are stopped. Currently this
behavior is triggered for any type of process stop including ptrace() stops
and transient stops for single threading during exit() and execve().
Thus, if a debugger is attached to a process in a group when the leader
exits, the entire group can be HUPed. Instead, only send the signals if a
process in the group is stopped due to SIGSTOP.

In particular, gdb creates a new process group each time it runs a new
process. If that process forks a child and gdb follows the child, the
child is killed with SIGHUP when the parent exits.

PR: 201149

Test Plan
  • Run a simple test program that forks a child but doesn't wait for the child in the parent under gdb with follow-fork-mode set to child and using a breakpoint or catchpoint to ensure the child stops while the parent exits. The child will be killed with SIGHUP when it resumes without this change.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb retitled this revision from to Only kill process group orphans if a remaining member is stopped due to a signal..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added a reviewer: kib.
kib edited edge metadata.
This revision is now accepted and ready to land.Sep 16 2015, 4:50 AM
This revision was automatically updated to reflect the committed changes.