Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix resource leak in listening thread. #18

Closed
wants to merge 1 commit into from

Commits on Jun 24, 2021

  1. Fix resource leak in listening thread.

    The thread launched to listen on the socket while the nscd request is
    processed was being written to a temporary thread_t. This means the
    thread couldn't be pthread_join'd, which is what would release its
    resources (which includes the memory allocated for the thread's stack),
    and this allocation would live on until nscd is killed. To avoid having
    to control the thread lifetime, we can simply pthread_detach it, which
    makes it so returning from the thread function releases its resources.
    
    This commit fixes an issue where practically each new nscd request would
    add (thread stack size + guard page size) bytes to the memory in use by
    nscd.
    ericonr committed Jun 24, 2021
    Configuration menu
    Copy the full SHA
    0ea4e10 View commit details
    Browse the repository at this point in the history