<div dir="ltr">Hmm. Not sure exactl what's happening.<div><br></div><div>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?<div><br></div><div>See if the patch attached helps.</div><div><br></div><div>I plan to update apitrace to not intercept dlopen -- it causes more problems than it solves.</div><div><br></div><div>Jose<br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 16, 2015 at 6:48 PM, Divick Kishore <span dir="ltr"><<a href="mailto:divick.kishore@gmail.com" target="_blank">divick.kishore@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
    I am trying to dump traces for an application for which LD_PRELOAD<br>
mechnism cannot work (as it something similar to what android emulator<br>
does). Thus I am trying to trace it using glxtrace.so mechanism as<br>
mentioned in the docs. For some reason it gives error even before it<br>
loads the gl libs. It complains with:<br>
<br>
apitrace: tracing to  <path>/python3.4.63.trace<br>
apitrace: error: failed to look up real dlopen<br>
apitrace: error: couldn't find libGL.so<br>
<br>
Looking at the sources I see that dlsym/dlopen themselves are wrapped<br>
and the actual lookup happens via glibc internal functions<br>
__libc_dlopen_mode and __libc_dlsym. Furthermore it is able to lookup<br>
dlsym via __libc_dlsym but when it calls this returned pointer with<br>
dlsym_ptr(handle, symbol), it returns a NULL pointer. Also I tried<br>
printing the and dlerror but it print "(null)".<br>
<br>
I am not sure why is it unable to lookup the real dlopen.<br>
<br>
I would appreciate any help.<br>
Thanks,<br>
Divick<br>
_______________________________________________<br>
apitrace mailing list<br>
<a href="mailto:apitrace@lists.freedesktop.org">apitrace@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/apitrace" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/apitrace</a><br>
</blockquote></div><br></div></div></div></div>