Page MenuHomeFreeBSD

ptrace: add an option to not kill debuggees on debugger exit
ClosedPublic

Authored by kib on May 20 2021, 1:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 7 2024, 11:45 PM
Unknown Object (File)
Jan 9 2024, 9:52 AM
Unknown Object (File)
Dec 23 2023, 1:16 AM
Unknown Object (File)
Nov 24 2023, 1:22 PM
Unknown Object (File)
Nov 11 2023, 8:25 AM
Unknown Object (File)
Nov 8 2023, 2:35 AM
Unknown Object (File)
Oct 23 2023, 12:21 PM
Unknown Object (File)
Oct 10 2023, 7:27 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.May 20 2021, 1:03 AM

Under what conditions would someone set kern_kill_on_dbg_exit=0? (Or, is a system-wide setting sufficient for all uses we'd envision?)

Under what conditions would someone set kern_kill_on_dbg_exit=0? (Or, is a system-wide setting sufficient for all uses we'd envision?)

I think this is a useful setting if you

  • debug a debugger, and do not want the debuggee to be terminated on debugger crash (if you do want the system to automatically clean after crash, then the current behavior is fine)
  • use tools like truss on important live process and do not want that a bug in truss or operator error resulted in killing of the process

I do not see how to make this setting more granular. Making it an option that can be set using ptrace(2) on specific debuggee is practically useless because you need to worry about it in advance.

I would maybe move the sysctl to kern_exit.c and then you can make the knob static instead of a global. I think the change is fine.

Move sysctl node to kern_exit.c

This revision is now accepted and ready to land.May 22 2021, 12:18 AM

Drop any queued SIGTRAPs. They are typically generated by debugging events, but if debugger is killed before consuming them, child dies screaming.

This revision now requires review to proceed.May 23 2021, 4:17 PM
kib added a reviewer: manpages.

More editing of the man page.

Upload the right man page update

bcr added a subscriber: bcr.

OK from manpages.

This revision is now accepted and ready to land.Oct 7 2022, 11:37 PM