Den 2009-12-30 06:39 skrev Bob Friesenhahn:
On Wed, 30 Dec 2009, Peter Rosin wrote:
The thread safety thing can be ignored as libltdl isn't thread safe
and needs to be mutexed anyway. Care to test this patch?
There used to be some useless effort to make it thread safe. Apparently
that is gone now. Regardless, there is also a potential re-entrancy
issue, which could be encountered if a legacy OS interface is supported
(re-implemented) via dlopen() or if some other implementation logic
(e.g. lazy symbol resolution) uses dlsym().
I can't say that I understand what you are describing, but dlerror need
not be reentrant[1], and we do various manipulations of internal state
during lt_dlopen etc, so I don't see how any argument about reentrancy
can hold. What am I missing this time?
[1] http://www.opengroup.org/onlinepubs/009695399/functions/dlerror.html
An alternative approach would be to store loader-specific errors in
loader-specific storage and iterate through the loaders in order to
obtain their error messages.
That is outside the scope of the provided patch.
With this patch, how will the accumulated error strings be reported to
the API user? Some of the error reports will be useless and so it may
not be useful to combine them since a useless report would have the same
significance as an important one. The origin (id of the reporting
loader) would be useful to record. If the origin was part of the string
(or the string is owned by the loader) then that would serve to keep
them distinct.
This patch does of course not address the original issue, it only
addresses the issue with dlerror returning a string to the ltdl user
that might have a limited life span.
Unfortunately, lt_dladderror() is publically exposed so it is difficult
to change its arguments even though it is not documented.
This patch does not change lt_dladderror in a way that I classify as
significant. Do you disagree?
I have not found anything in your message that "kills" the patch, but
yet I get the feeling that you do not like it, and I would like to know
what you think is wrong with it...
Cheers,
Peter