[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gl, image.save crash... was (Re: [pygame] Automated Builds)



Current (lack of) progress report. All I can determine for sure is that setting the screen mode to OPENGL causes pygame.image.save to segfault. It doesn't matter what file extension the output file has. I have been unable to pin down the exact point where this happens since commenting out code moves the location of the segfault. Replacing the opengltosdl call with a simple SDL_CreateRGBSurface call also segfaults. Two locations where sefaults happen are when opengltosdl returns and the PyObject_CallObject call to save_extended in imageext. I will play around with it some more later. I will also try gdb again. Maybe the problem is in set_mode itself. I will have a look at it as well.

Lenard


Lenard Lindstrom wrote:
I tried getting a stack trace with gdb for a previous bug. I had no luck. I think the Python interpreter itself would have to be compiled with MinGW in debug mode for that to work. The only way I found was the slow and tedious approach of adding debug print statements. I have traced the problem to opengltosdl, but no further. Apparently the parachute isn't tripped until the function returns. Possibly this means a stack overwrite. I don't know.

Lenard


René Dudfield wrote:
hi,

the gl pygame.image.save(screen) was partially fixed by me the other weekend...

It used to import pyopengl to access its glReadPixels function in
pygame < 1.8.1... however pyopengl 3.x changed the API which broken
the pygame function.

So instead of importing pyopengl for glReadPixels, I used the SDL
function to dynamically load the glReadPixels function... however I've
only tested it on linux, and mac osx.  I still haven't set up a
windows environment for compilation yet.

If someone could give me a stack trace with gdb, I might be able to
fix it - otherwise I'll eventually get around to fixing it once I get
mingw set up on my windows machine.


ps. future feature wish for build bot: giving stack traces on segfaults too?