Whenever I try to load or unload textures from a different thread than the main one, I get a segmentation fault in an PyOpenGL call, even if PyOpenGL calls are properly protected by locking. Loading and unloading textures from a different thread is necessary for my project, a high-performance image viewer.
I'm using PyOpenGL 3.0.1~b2-1 with PyGame 1.8.1release-1.1+b1 from Debian Sid with an nVidia graphics card with the official driver (190.53) on GNU/Linux 2.6.31. I've also verified the problem with PyOpenGL and PyGame in Ubuntu GNU/Linux 8.04 Hardy with the official stable packages using an ATi embedded graphics card with the free software ati driver.
I've crafted a program to demonstrate it, which I'm attaching to this bug in tar+gzip format. Upon uncompressing the file you'll get a directory; inside it you'll find a Python program and a PNG image it'll load. First it'll load and move it around for 4 seconds in the main thread, which you'll see working fine. Then it'll do exactly the same, only the image is loaded in a second thread and shared with the first one. Before the first thread resumes control, however, it'll crash, right in glGenTextures.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Demonstration program (crashes)