[ pyopengl-Bugs-2795863 ] gluNewQuadric fails with seg violation on recent Linux x86

"SourceForge.net" <[email protected]> Thu, 02 Jul 2009 23:56:42 +0000
Newsgroups gmane.comp.python.opengl.devel
Message-ID <[email protected]>
Bugs item #2795863, was opened at 2009-05-23 10:49
Message generated for change (Comment added) made by gic888
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105988&aid=2795863&group_id=5988

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: GLU
Group: v3.0.0
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Graham Cummins (gic888)
Assigned to: Nobody/Anonymous (nobody)
Summary: gluNewQuadric fails with seg violation on recent Linux x86

Initial Comment:
Any call to gluNewQuadric now seems to cause a segmentation violation immediately on recent versions of 32 bit x86 Linux. I have tested this on Ubuntu Jaunty, and Arch Linux with pacman updates more recent than ~4/1/09. Identical code runs normally on Ubuntu 8.04, Arch versions from 2008, and any version of Mac OS X. I thus assume this is a compatibility issue with recent changes in xorg or OpenGL. 

My app uses PyOpenGL 3.0.0 with the glcanvas context provided by wxWidgets 2.8.9.2. Based on my testing, however, I don't think wx is involved in the crash. I can duplicate the segv with 100% reliability in highly reduced scripts that call gluNewQuadric. I can also run the full program simply by commenting out the call to gluNewQuadric, and subsequently drawing points and lines instead of spheres and cylinders. 

----------------------------------------------------------------------

>Comment By: Graham Cummins (gic888)
Date: 2009-07-02 17:56

Message:
Workaround found:

This failure does not occur if there is a currently active GL context with
a defined size. My app uses a class that creates a Quadric on class
initialization, which may occur before creating the GLCanvas the class will
eventually draw in. My test scripts don't use a drawing context at all -
just import GLU and call gluNewQuadric. If I postpone creation of the
Quadric until after the GLCanvas is created, sized, and SetCurrent, then
there is no problem. I am testing with the wxPython GLCanvas context. I
guess the same behavior would apply to OpenGLContext, but I haven't tested
that. 

I still consider this a minor bug, or at least a documentation failure.
Creating a Quadric object (without using it to draw anything) shouldn't
really require an active drawing context. It doesn't on Windows, Mac, and
earlier versions of X11. If it is a new design decision to prevent this on
X11 it should A) be documented somewhere, and B) fail with a Python
exception, rather than a seg fault if possible. However, now that I know
about this, it is a pretty easy workaround to simply create the Quadric
only when it is needed to draw something immediately, so the segv doesn't
pose any serious problems for me anymore. 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105988&aid=2795863&group_id=5988

------------------------------------------------------------------------------
_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net