sdap_select_principal_from_keytab_sync: waitpid() synchronously#8473
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request correctly fixes an issue where a child process could become a zombie by making the waitpid() call blocking. This ensures the parent process waits for the child to terminate. I've added a suggestion to make this call more robust by handling potential interruptions from signals (EINTR), which is a good practice for system calls like waitpid().
alexey-tikhonov
self-requested a review
February 23, 2026 08:51
arrowd
force-pushed
the
ldap-child-wnohang
branch
from
February 23, 2026 15:34
0bda4c3 to
7c5d23a
Compare
arrowd
force-pushed
the
ldap-child-wnohang
branch
from
February 24, 2026 18:24
7c5d23a to
8f6c77a
Compare
alexey-tikhonov
approved these changes
Feb 25, 2026
ikerexxe
reviewed
Feb 25, 2026
ikerexxe
left a comment
Contributor
There was a problem hiding this comment.
Just a minor change and we'll be done
arrowd
force-pushed
the
ldap-child-wnohang
branch
from
February 25, 2026 10:46
8f6c77a to
8e76d1d
Compare
Member
|
Note: Covscan is green. |
Without this change the ldap_child process started by this function ends up in the <defunct> state. kernel trace hints that the process isn't fully finished by the time waitpid is called: 13126 sssd_be CALL wait4(13127,0,0x1<WNOHANG>,0) 13126 sssd_be RET wait4 0 waitpid(ldap_child) failed, process might be leaking According to man waitpid(3), the function returns 0 when passed WNOHANG and there is no child process that can be reported as exited. Omitting WNOHANG fixes the issue. Reviewed-by: Alexey Tikhonov <[email protected]> Reviewed-by: Iker Pedrosa <[email protected]>
Contributor
sssd-bot
force-pushed
the
ldap-child-wnohang
branch
from
February 26, 2026 10:15
8e76d1d to
c4590d4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Without this change the ldap_child process started by this function ends up in the
<defunct>state. kernel trace hints that the process isn't fully finished by the time waitpid is called:According to man waitpid(2), the function returns 0 when passed
WNOHANGand there is no child process that can be reported as exited. OmittingWNOHANGfixes the issue.