Skip to content

use EVFILT_PROC instead of SIGCHLD on *BSD to monitor child exit#3441

Merged
vtjnash merged 15 commits intolibuv:v1.xfrom
nornagon:nornagon/posix_spawn_evfilt_proc
Jan 31, 2022
Merged

use EVFILT_PROC instead of SIGCHLD on *BSD to monitor child exit#3441
vtjnash merged 15 commits intolibuv:v1.xfrom
nornagon:nornagon/posix_spawn_evfilt_proc

Conversation

@nornagon
Copy link
Copy Markdown
Contributor

@nornagon nornagon commented Jan 25, 2022

This adds a workaround for an xnu kernel bug that sometimes results in SIGCHLD not being delivered. The workaround is to use kevent to listen for EVFILT_PROC/NOTE_EXIT events instead of relying on SIGCHLD on *BSD.

@nornagon nornagon mentioned this pull request Jan 25, 2022
@vtjnash
Copy link
Copy Markdown
Member

vtjnash commented Jan 25, 2022

This looks great. Could you filter the PR here to just contain the 80659a5 commit contents? I have a few minor review comments, but otherwise, I think this should be pretty close to ready.

@nornagon
Copy link
Copy Markdown
Contributor Author

Could you filter the PR here to just contain the 80659a5 commit contents

I'm not sure that's possible with the GitHub UI; I'd have to close this and open a new PR on your fork.

@vtjnash
Copy link
Copy Markdown
Member

vtjnash commented Jan 26, 2022

You cannot do it with the UI, but you can locally do an interactive git rebase, drop those commits, then force push here

@nornagon
Copy link
Copy Markdown
Contributor Author

You cannot do it with the UI, but you can locally do an interactive git rebase, drop those commits, then force push here

but github will still think the base is libuv/libuv:1.x, right? my commits here don't make sense without your commits. not quite sure what you're asking for here.

@vtjnash
Copy link
Copy Markdown
Member

vtjnash commented Jan 26, 2022

I want to merge this change first, then merge my PR (I can rebase after merging this)

@nornagon nornagon force-pushed the nornagon/posix_spawn_evfilt_proc branch from 32c83e2 to 78e32e3 Compare January 26, 2022 21:33
@nornagon
Copy link
Copy Markdown
Contributor Author

ah i see, sorry, i had assumed that this change depended on changes from your PR, but it doesn't. Rebased + title updated.

@nornagon nornagon changed the title posix spawn, take 3 use EVFILT_PROC instead of SIGCHLD on *BSD to monitor child exit Jan 26, 2022
@vtjnash
Copy link
Copy Markdown
Member

vtjnash commented Jan 27, 2022

@nornagon
Copy link
Copy Markdown
Contributor Author

done.

Copy link
Copy Markdown
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will leave this open for the weekend, in case anyone else wants to comment, but merge Monday, if nobody comments before then.

@vtjnash
Copy link
Copy Markdown
Member

vtjnash commented Jan 28, 2022

@vtjnash vtjnash merged commit d9e9085 into libuv:v1.x Jan 31, 2022
@nornagon nornagon deleted the nornagon/posix_spawn_evfilt_proc branch January 31, 2022 20:36
vtjnash added a commit to vtjnash/libuv that referenced this pull request Feb 1, 2022
The kernel may return ESRCH if the child has already exited here.
This is rather annoying, and means we must indirectly handle
notification to our event loop of the process exit.

Refs: libuv#3441
Refs: libuv#3257
vtjnash added a commit that referenced this pull request Feb 1, 2022
The kernel may return ESRCH if the child has already exited here.
This is rather annoying, and means we must indirectly handle
notification to our event loop of the process exit.

Refs: #3441
Refs: #3257
JeffroMF pushed a commit to JeffroMF/libuv that referenced this pull request May 16, 2022
This adds a workaround for an xnu kernel bug that sometimes results in
SIGCHLD not being delivered. The workaround is to use kevent to listen
for EVFILT_PROC/NOTE_EXIT events instead of relying on SIGCHLD on *BSD.
 
Apple rdar: FB9529664
Refs: libuv#3257
JeffroMF pushed a commit to JeffroMF/libuv that referenced this pull request May 16, 2022
The kernel may return ESRCH if the child has already exited here.
This is rather annoying, and means we must indirectly handle
notification to our event loop of the process exit.

Refs: libuv#3441
Refs: libuv#3257
liujinye-sys pushed a commit to open-vela/apps_system_libuv that referenced this pull request Jul 23, 2025
The kernel may return ESRCH if the child has already exited here.
This is rather annoying, and means we must indirectly handle
notification to our event loop of the process exit.

Refs: libuv/libuv#3441
Refs: libuv/libuv#3257
liujinye-sys pushed a commit to open-vela/apps_system_libuv that referenced this pull request Dec 16, 2025
The kernel may return ESRCH if the child has already exited here.
This is rather annoying, and means we must indirectly handle
notification to our event loop of the process exit.

Refs: libuv/libuv#3441
Refs: libuv/libuv#3257
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants