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

dlopen: make error handling thread safe #431

Merged
merged 1 commit into from
Nov 3, 2023
Merged

Commits on Nov 3, 2023

  1. dlopen: make error handling thread safe

    The dlerror() value is stored in thread local storage and thus checking
    the error from go code is not safe because go can schedule goroutines
    on any other thread at any time. This means it is possible that between
    the dlsym() or dlclose() call the code get moved to another thread and
    thus the dlerror() value is not what we expect. Instead because we read
    now from another thread it will be an error from a different call.
    
    A test is added which without this fix is able to reproduce the
    problem somewhat reliably.
    
    This issue was observed in the podman CI[1] which uses the sdjournal
    API.
    
    [1] containers/podman#20569
    
    Signed-off-by: Paul Holzinger <pholzing@redhat.com>
    Luap99 committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    d1df97f View commit details
    Browse the repository at this point in the history