apitrace / apitrace

Tools for tracing OpenGL, Direct3D, and other graphics APIs
https://apitrace.github.io/
MIT License
2.62k stars 488 forks source link

apitrace does not catch multiple correct java swing context #409

Open spaceemotion opened 8 years ago

spaceemotion commented 8 years ago

Trace file: http://puu.sh/m9wO0/d8a978509a.trace

I recently discovered apitrace and wanted to test it on one of my applications I am currently working on, but encountered a severe bug that makes me unable to debug it properly.

This is how qapitrace represents the window: ApiTrace output

while this is how the original looked like Java Application

I am using jOGL with a GLCanvas inside a swing application. Thus I think that apitrace is picking up the OpenGL commands from the application itself, but not the one from my main context (if that's even a thing). According to @io7m it might be that apitrace is not collecting all gl calls properly, thus failing in the replace process.

The used version was a self-compiled version of b516c3e0f6770d8acb6b4dff18b39e19cb4e4731

_Edit:_ Alright, so after some more testing (putting the application into a full window using the NEWT GLWindow), this seems to have worked. This is the "proper" trace of the single-windowed application: http://puu.sh/mblds/d788230397.trace

_Edit 2:_ After looking through the trace a bit further, it seems like apitrace indeed has a problem with multiple contexts. The API calls I am doing are not even showing up in the list.

jrfonseca commented 8 years ago

The trace has no OpenGL draw calls whatsoever. So it does seem that apitrace failed to intercept many of those OpenGL calls.

I'll need to repro this myself to investigate further.

But I wonder if the problem is specific to Mac OS X, or this particular JOGL application.

Could you try the same app on a different OS, or alternatively, a different JOGL application on Mac OS X?

jrfonseca commented 8 years ago

FWIW, I reproed this locally.

The problem is that DYLD_LIBRARY_PATH mechanism is not very reliable on Mac OS X, particularly with Java apps.

I've started prototyping using DYLD_INTERPOSE in https://github.com/apitrace/apitrace/tree/dyld-interpose branch, which avoids this. But it's still work in progress.

spaceemotion commented 8 years ago

First off, thanks for still developing things! Much appreciated.

Sorry for not answering to this earlier. I did try out on other applications, but not other JOGL ones as my "prototyping-time" just ran out and I had to continue working on other things.

As focus shifted I eventually stopped working on this, but I could try to get a trace running within the next week - if that would help.

Cheers!