Share

PyOpenGL

Tracker: Bugs

5 gluNewQuadric fails with seg violation on recent Linux x86 - ID: 2795863
Last Update: Comment added ( mcfletch )

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.


Graham Cummins ( gic888 ) - 2009-05-23 16:49

5

Open

None

Nobody/Anonymous

GLU

v3.0.0

Public


Comments ( 4 )




Date: 2009-07-18 22:08
Sender: mcfletchProject Admin

I've added an optional flag CHECK_CONTEXT, which will do explicit checks
for context before running any function.


Date: 2009-07-18 21:39
Sender: mcfletchProject Admin

Ah, sorry, missed the comment. Recent X11 mesas are *very* picky about GL
calls before context initialization, probably 3/4 of the OpenGL API will
cause seg-faults if called before context init. Guess I need to be helping
people with this somehow...


Date: 2009-07-18 21:37
Sender: mcfletchProject Admin

Don't see the bug on 64-bit Ubuntu Jaunty with bzr head
(Demo/NeHe/lesson18.py works), will have to get a 32-bit version to test
with.


Date: 2009-07-02 23:56
Sender: gic888

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.


Log in to comment.




Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.