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)
Sun, Dec 15, 1:28 PM
Unknown Object (File)
Wed, Dec 11, 3:24 AM
Unknown Object (File)
Sun, Dec 8, 10:07 AM
Unknown Object (File)
Sun, Dec 8, 10:07 AM
Unknown Object (File)
Sun, Dec 8, 10:06 AM
Unknown Object (File)
Sun, Dec 8, 10:06 AM
Unknown Object (File)
Sun, Dec 8, 10:06 AM
Unknown Object (File)
Sat, Dec 7, 4:51 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