Hello,
The current glibc implementation of dlerror() calls strerror(). The
current implementation of strerror() is not thread-safe. While this
is allowed by POSIX, this is quite inconvenient for thread-safe programs
or library using dlopen() and dlsym().
With dlsym(), checking dlerror() is in fact the "recommended" way to
detect errors. In theory anyway - NULL can be a correct succesful return
value for dlsym().
I would not hold my breath for POSIX to resolve this issue, so can glibc
please provide a proprietary replacement? We need this to fix the libvlc
package (currently "wrongly" calling dlerror()). It could either write
the error message to a provided buffer à la strerror_r() or allocate it
on the heap - whatever.
Best regards,