Comment 63 for bug 1072206

Revision history for this message
Arthur Huillet (ahuillet) wrote :

We at NVIDIA have investigated the problem and found out that it is an application bug.
Our interpretation of the specification is that creating two GLX pixmaps pointing at the same drawable is not allowed, because it can lead to poorly defined behavior if the properties of both GLX drawables don't match. Our driver prevents this, but Compiz appears to try to do this.
Tracing the calls done by Compiz shows that in certain cases (subject to a potential race condition on the minimize animation, more reliably happening on unminimize), it will obtain an X pixmap through XCompositeNameWindowPixmap(), then call glXCreatePixmap() and use the created GLX pixmap normally, but never call glXDestroyPixmap() on it. Subsequently, it will call XCompositeNameWindowPixmap() again, while the window's pixmap hasn't changed. This isn't a bug by itself, but subsequently calling glXCreatePixmap() will fail because there already is a GLX pixmap pointing at the drawable (the one that wasn't deleted before).
The fix would be to ensure that the pre-existing GLX pixmap is destroyed before attempting to create a new one.

Here is a short trace showing the events I'm describing:

<email address hidden>(0x18f0790, 0x120029a, 0, 0x18fca20) = 0x12002c4
glXCreatePixmap(0x18f0790, 0x14c, 0x12002c4);
// glXCreatePixmap returns 0x12002c5
glBindTexture(GL_TEXTURE_2D, 127);
glXBindTexImageEXT(0x18f0790, 0x12002c5, 8414, (nil));
[...]
--->Draw calls are made.
--->glXDestroyPixmap for 0x12002c5 is never called.
[...]
<email address hidden>(0x18f0790, 0x120029a, 0, 0x18fca20) = 0x1200303
glXCreatePixmap(0x18f0790, 0x14c, 0x1200303);
// glXCreatePixmap returns 0x1200304
glGenTextures(1, 0x1fbf098);
// returns:
glBindTexture(GL_TEXTURE_2D, 129);
glXBindTexImageEXT(0x18f0790, 0x1200304, 8414, (nil));
---> 0x1200304 pixmap creation fails because another (0x12002c5) points at the same drawable
---> Compiz proceeds normally and makes draw calls, but the texture it thinks it's drawing from isn't there

--
Arthur Huillet
NVIDIA Linux graphics