Page MenuHomeFreeBSD

Fix an orphan bug and add tests for fork following.
ClosedPublic

Authored by jhb on Jun 14 2015, 5:20 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 3 2024, 12:54 PM
Unknown Object (File)
Jan 8 2024, 12:45 AM
Unknown Object (File)
Jan 4 2024, 9:56 AM
Unknown Object (File)
Dec 26 2023, 10:19 AM
Unknown Object (File)
Dec 21 2023, 7:49 PM
Unknown Object (File)
Nov 3 2023, 3:11 PM
Unknown Object (File)
Oct 27 2023, 4:13 AM
Unknown Object (File)
Jul 9 2023, 6:54 AM
Subscribers

Details

Summary

Clear P_TRACED before reparenting a detached process back to its
original parent. Otherwise the debugee will be set as an orphan of
the debugger.

Add tests for tracing forks via PT_FOLLOW_FORK.

Test Plan
  • The ptrace__follow_fork_parent_detached_unrelated_debugger hangs without the change in sys_process.c. The debugger is hung in wait because when it calls the last wait, the orphan from the parent is still present, but after init harvests the parent it stays asleep with no orphans and no children.

Diff Detail

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

Event Timeline

jhb retitled this revision from to Fix an orphan bug and add tests for fork following..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added a reviewer: kib.
kib edited edge metadata.
kib added inline comments.
sys/kern/sys_process.c
950 ↗(On Diff #6182)

I think the comment which is equivalent to the explanation message of the revision, should be added there.

This revision is now accepted and ready to land.Jun 14 2015, 6:28 AM
sys/kern/sys_process.c
950 ↗(On Diff #6182)

That sounds reasonable to me.

jhb edited edge metadata.
  • Rebase
  • Document why P_TRACED needs to be cleared.
This revision now requires review to proceed.Aug 1 2015, 5:47 AM
kib edited edge metadata.
This revision is now accepted and ready to land.Aug 1 2015, 6:05 AM
jhb marked an inline comment as done.Aug 1 2015, 4:18 PM
This revision was automatically updated to reflect the committed changes.