Page MenuHomeFreeBSD

EVFILT_PROCDESC: support NOTE_FORK
ClosedPublic

Authored by kib on Fri, Jul 17, 5:41 AM.
Tags
None
Referenced Files
F165602131: D58292.id182159.diff
Sat, Aug 8, 7:00 PM
F165592090: D58292.id182152.diff
Sat, Aug 8, 6:23 PM
F165586762: D58292.id182124.diff
Sat, Aug 8, 6:03 PM
F165519214: D58292.diff
Sat, Aug 8, 12:51 PM
Unknown Object (File)
Fri, Aug 7, 5:17 PM
Unknown Object (File)
Fri, Aug 7, 6:12 AM
Unknown Object (File)
Fri, Aug 7, 6:12 AM
Unknown Object (File)
Fri, Aug 7, 6:12 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Fri, Jul 17, 5:41 AM
lib/libsys/kqueue.2
597 ↗(On Diff #182106)
601 ↗(On Diff #182106)
602 ↗(On Diff #182106)

Also, if the process raises NOTE_EXIT, the last PID will be overwritten (but I think we will return NOTE_FORK | NOTE_EXIT).

605 ↗(On Diff #182106)

Perhaps mention ptrace(2) explicitly?

sys/kern/sys_procdesc.c
521

Probably you want to kn->kn_flags &= ~NOTE_FORK here?

kib marked 5 inline comments as done.Fri, Jul 17, 1:57 PM
kib added inline comments.
sys/kern/sys_procdesc.c
521

Hm, no. I will explicitly mention that exit code is returned.

kib marked an inline comment as done.

Update the man page with the review comments.

sys/kern/sys_procdesc.c
521

(I meant kn->kn_fflags above of course.)

kib marked an inline comment as done.Fri, Jul 17, 2:11 PM
kib added inline comments.
sys/kern/sys_procdesc.c
521

I do want (need) to see NOTE_FORK in this situation.

kib marked an inline comment as done.

Report NOTE_FORK for procdesc after the child is attached to the debugger.

In D58292#1337327, @kib wrote:

Report NOTE_FORK for procdesc after the child is attached to the debugger.

I suggest adding a test for this, or at least a comment explaining why it is important.

lib/libsys/kqueue.2
597 ↗(On Diff #182152)

since you use it below. Or write, The process identifier (PID) of the ...

605 ↗(On Diff #182152)
606 ↗(On Diff #182152)
kib marked 3 inline comments as done.Fri, Jul 17, 8:48 PM
In D58292#1337327, @kib wrote:

Report NOTE_FORK for procdesc after the child is attached to the debugger.

I suggest adding a test for this, or at least a comment explaining why it is important.

I added the comment. truss(1) in the cap mode is the practical test.

Add comment for the placement of NOTE_FORK activation.
Edit the man page.

markj added inline comments.
lib/libsys/kqueue.2
629 ↗(On Diff #182159)
sys/kern/kern_fork.c
830
832
833
This revision is now accepted and ready to land.Sun, Jul 19, 6:38 PM
kib marked 4 inline comments as done.

Edit comments and the man page update.

This revision now requires review to proceed.Sun, Jul 19, 6:50 PM
This revision was not accepted when it landed; it landed in state Needs Review.Sun, Jul 19, 8:41 PM
This revision was automatically updated to reflect the committed changes.