Page MenuHomeFreeBSD

kqueue EVFILT_PROC: avoid collision between NOTE_CHILD and NOTE_EXIT
ClosedPublic

Authored by vangyzen on Jan 12 2016, 7:42 PM.
Tags
None
Referenced Files
F82708089: D4900.id12802.diff
Wed, May 1, 9:23 PM
F82708087: D4900.id.diff
Wed, May 1, 9:23 PM
F82708073: D4900.id12217.diff
Wed, May 1, 9:23 PM
F82708053: D4900.id12225.diff
Wed, May 1, 9:23 PM
F82679702: D4900.diff
Wed, May 1, 1:48 PM
Unknown Object (File)
Fri, Apr 26, 9:44 PM
Unknown Object (File)
Jan 17 2024, 9:44 PM
Unknown Object (File)
Jan 7 2024, 8:01 PM
Subscribers

Details

Summary

NOTE_CHILD and NOTE_EXIT return something in kevent.data: the parent
pid (ppid) for NOTE_CHILD and the exit status for NOTE_EXIT.
Do not let the two events be combined, since one would overwrite
the other's data.

PR: 180385
MFC after: 2 weeks
Submitted by: David A. Bright <david_a_bright@dell.com>
Sponsored by: Dell Inc.

Test Plan

A unit test is included.

Diff Detail

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

Event Timeline

vangyzen retitled this revision from to kqueue EVFILT_PROC: avoid collision between NOTE_CHILD and NOTE_EXIT.
vangyzen updated this object.
vangyzen edited the test plan for this revision. (Show Details)
vangyzen edited edge metadata.

On the surface I think this looks good. Keeping NOTE_CHILD and NOTE_EXIT separate is definitely the right approach to avoid losing data.

tests/sys/kqueue/proc.c
98 ↗(On Diff #12217)

I would probably say that a pipe() is best for a test, even if it is more work than a bare sleep().

194 ↗(On Diff #12217)

s/CHILD/EXIT/

Use a pipe, instead of sleeping, for process synchronization.

Fix a copy-and-paste-o.

tests/sys/kqueue/proc.c
98 ↗(On Diff #12225)

Agreed. In fact, the code that found this uses a pipe.

This revision was automatically updated to reflect the committed changes.