[patch] Fix dlclose / exit running in parallel resulting in dtor being called twice
Florian Weimer
fweimer@redhat.com
Wed Feb 6 15:22:00 GMT 2019
* Paul Pluzhnikov:
> On Wed, Feb 6, 2019 at 1:37 AM Florian Weimer <fweimer@redhat.com> wrote:
>>
>> * Paul Pluzhnikov:
>>
>> > + /* Clear any errors. */
>> > + dlerror ();
>> > + return dso;
>> > +}
>>
>> Why did you add the dlerror call in the success case?
>
> I don't remember / can't recall.
>
> But it seems like it should always be a no-op. Do you have a case
> where dlopen() succeeds and dlerror() is not a no-op?
I think it may matter for dlsym, where you need to look dlerror to tell
if the symbol was NULL, or there was an actual error. But you would
have to clear dlerror *before* dlsym anyway, in case something else had
called dlsym without clearing the error.
Thanks,
Florian
More information about the Libc-alpha
mailing list