Error with dlopen on linux 64 bit

José Fonseca jose.r.fonseca at gmail.com
Mon Nov 16 13:10:44 PST 2015


Hmm. Not sure exactl what's happening.

Maybe the application is somehow dlopening libGL.so (which in this case is
the wrapper) with RTLD_LOCAL, which causes dl.so to also be opened with
RTLD_LOCAL, so `dlsym(RTLD_NEXT, "dlopen")` fails, as RTLD_NEXT will skip
local symbols.  But if that's the case, how can the app dlopen libGL.so
without dl.so symbols being global?

See if the patch attached helps.

I plan to update apitrace to not intercept dlopen -- it causes more
problems than it solves.

Jose

On Mon, Nov 16, 2015 at 6:48 PM, Divick Kishore <divick.kishore at gmail.com>
wrote:

> Hi,
>     I am trying to dump traces for an application for which LD_PRELOAD
> mechnism cannot work (as it something similar to what android emulator
> does). Thus I am trying to trace it using glxtrace.so mechanism as
> mentioned in the docs. For some reason it gives error even before it
> loads the gl libs. It complains with:
>
> apitrace: tracing to  <path>/python3.4.63.trace
> apitrace: error: failed to look up real dlopen
> apitrace: error: couldn't find libGL.so
>
> Looking at the sources I see that dlsym/dlopen themselves are wrapped
> and the actual lookup happens via glibc internal functions
> __libc_dlopen_mode and __libc_dlsym. Furthermore it is able to lookup
> dlsym via __libc_dlsym but when it calls this returned pointer with
> dlsym_ptr(handle, symbol), it returns a NULL pointer. Also I tried
> printing the and dlerror but it print "(null)".
>
> I am not sure why is it unable to lookup the real dlopen.
>
> I would appreciate any help.
> Thanks,
> Divick
> _______________________________________________
> apitrace mailing list
> apitrace at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/apitrace
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/apitrace/attachments/20151116/9710b26c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dlopen.patch
Type: text/x-patch
Size: 838 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/apitrace/attachments/20151116/9710b26c/attachment.bin>


More information about the apitrace mailing list