This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [patch] Fix dlclose / exit running in parallel resulting in dtor being called twice
- From: Florian Weimer <fweimer at redhat dot com>
- To: Paul Pluzhnikov <ppluzhnikov at google dot com>
- Cc: GLIBC Devel <libc-alpha at sourceware dot org>, "Carlos O'Donell" <carlos at redhat dot com>
- Date: Wed, 06 Feb 2019 10:37:08 +0100
- Subject: Re: [patch] Fix dlclose / exit running in parallel resulting in dtor being called twice
- References: <CALoOobMptbtaA-vfcyQuepxZrMzsPKPqTWMZbO=vwK9s0FoGhQ@mail.gmail.com>
* Paul Pluzhnikov:
> +void *
> +open_library (const char * pathname)
> +{
> + void *dso;
> + char *err;
> +
> + /* Open the DSO. */
> + dso = dlopen (pathname, RTLD_NOW|RTLD_GLOBAL);
> + if (dso == NULL)
> + {
> + err = dlerror ();
> + fprintf (stderr, "%s\n", err);
> + exit (1);
> + }
> + /* Clear any errors. */
> + dlerror ();
> + return dso;
> +}
Why did you add the dlerror call in the success case?
Thanks,
Florian