[PyQt] my PyQt4 program crashes only on Mandriva 2009.1

Grant Tang tang_guang at hotmail.com
Thu Sep 3 23:42:52 BST 2009


My program need display 2D/3D image. It works fine on Linux, MacOS and 
Windows.
But it crash on Mandriva 2009.1 with the error message:
QGLContext::makeCurrent(): Cannot make invalid context current.

OS: Mandriva 2009.1, original version and version update to 9/3/2009.
Python: 2.6.1-6.1mdv2009.1
Qt: 4.5.2-1.3mdv2009.1
PyQt: 4.4.4-6mdv2009.1
PyOpenGL: 3.0.0-0.0.b8.1mdv2009.1

It crashes on the line: QtOpenGL.QGLWidget.__init__(self,fmt)
of the following class:
class EMImage2DWidget(EMEventRerouter,QtOpenGL.QGLWidget):
 def __init__(self, em_image_2d_module):
  fmt=QtOpenGL.QGLFormat()
  fmt.setDoubleBuffer(True)
  #fmt.setSampleBuffers(True)
  fmt.setDepth(1)
  EMEventRerouter.__init__(self,em_image_2d_module) # makes self.target
  QtOpenGL.QGLWidget.__init__(self,fmt)
  self.initimageflag = True

  self.setFocusPolicy(Qt.StrongFocus)
  self.setMouseTracking(True)
  #other functions ignored

I tried to use GDB to get the back trace when crash happens:
Quote:
#0 0x00007f0c42d35378 in ?? ()
#1 0x00007f0c32ea71d7 in ?? () from /usr/lib64/libQtOpenGL.so.4
#2 0x00007f0c32ed5ec2 in ?? () from /usr/lib64/libQtOpenGL.so.4
#3 0x00007f0c32ea250a in ?? () from /usr/lib64/libQtOpenGL.so.4
#4 0x00007f0c32ed631a in ?? () from /usr/lib64/libQtOpenGL.so.4
#5 0x00007f0c32ea5350 in QGLWidget::QGLWidget () from
/usr/lib64/libQtOpenGL.so.4
#6 0x00007f0c331296f7 in ?? () from
/usr/lib64/python2.6/site-packages/PyQt4/QtOpenGL.so
#7 0x00007f0c33129c2a in ?? () from
/usr/lib64/python2.6/site-packages/PyQt4/QtOpenGL.so
#8 0x00007f0c364fcd84 in ?? () from 
/usr/lib64/python2.6/site-packages/sip.so
#9 0x00007f0c42976c8c in ?? () from /usr/lib64/libpython2.6.so.1.0
#10 0x00007f0c42927268 in PyObject_Call () from 
/usr/lib64/libpython2.6.so.1.0
#11 0x00007f0c429b5a26 in PyEval_CallObjectWithKeywords () from
/usr/lib64/libpython2.6.so.1.0
#12 0x00007f0c4293ed3d in ?? () from /usr/lib64/libpython2.6.so.1.0
#13 0x00007f0c42927268 in PyObject_Call () from 
/usr/lib64/libpython2.6.so.1.0
#14 0x00007f0c429b884e in PyEval_EvalFrameEx () from
/usr/lib64/libpython2.6.so.1.0
#15 0x00007f0c429bd369 in PyEval_EvalCodeEx () from
/usr/lib64/libpython2.6.so.1.0
#16 0x00007f0c4294e73d in ?? () from /usr/lib64/libpython2.6.so.1.0
#17 0x00007f0c42927268 in PyObject_Call () from 
/usr/lib64/libpython2.6.so.1.0
#18 0x00007f0c42935c00 in ?? () from /usr/lib64/libpython2.6.so.1.0
#19 0x00007f0c42927268 in PyObject_Call () from 
/usr/lib64/libpython2.6.so.1.0
#20 0x00007f0c4297a4ce in ?? () from /usr/lib64/libpython2.6.so.1.0
#21 0x00007f0c42978e5e in ?? () from /usr/lib64/libpython2.6.so.1.0
#22 0x00007f0c42927268 in PyObject_Call () from 
/usr/lib64/libpython2.6.so.1.0
#23 0x00007f0c429b884e in PyEval_EvalFrameEx () from
/usr/lib64/libpython2.6.so.1.0
#24 0x00007f0c429bbd2a in PyEval_EvalFrameEx () from
/usr/lib64/libpython2.6.so.1.0
#25 0x00007f0c429bbd2a in PyEval_EvalFrameEx () from
/usr/lib64/libpython2.6.so.1.0
#26 0x00007f0c429bd369 in PyEval_EvalCodeEx () from
/usr/lib64/libpython2.6.so.1.0
#27 0x00007f0c4294e73d in ?? () from /usr/lib64/libpython2.6.so.1.0
#28 0x00007f0c42927268 in PyObject_Call () from 
/usr/lib64/libpython2.6.so.1.0
#29 0x00007f0c42935c00 in ?? () from /usr/lib64/libpython2.6.so.1.0
#30 0x00007f0c42927268 in PyObject_Call () from 
/usr/lib64/libpython2.6.so.1.0
#31 0x00007f0c429b884e in PyEval_EvalFrameEx () from
/usr/lib64/libpython2.6.so.1.0
#32 0x00007f0c429bd369 in PyEval_EvalCodeEx () from
/usr/lib64/libpython2.6.so.1.0
#33 0x00007f0c4294e842 in ?? () from /usr/lib64/libpython2.6.so.1.0
#34 0x00007f0c42927268 in PyObject_Call () from 
/usr/lib64/libpython2.6.so.1.0
#35 0x00007f0c42935c00 in ?? () from /usr/lib64/libpython2.6.so.1.0
#36 0x00007f0c42927268 in PyObject_Call () from 
/usr/lib64/libpython2.6.so.1.0
#37 0x00007f0c429b884e in PyEval_EvalFrameEx () from
/usr/lib64/libpython2.6.so.1.0
#38 0x00007f0c429bd369 in PyEval_EvalCodeEx () from
/usr/lib64/libpython2.6.so.1.0
#39 0x00007f0c4294e842 in ?? () from /usr/lib64/libpython2.6.so.1.0
#40 0x00007f0c42927268 in PyObject_Call () from 
/usr/lib64/libpython2.6.so.1.0
#41 0x00007f0c42935c00 in ?? () from /usr/lib64/libpython2.6.so.1.0
#42 0x00007f0c42927268 in PyObject_Call () from 
/usr/lib64/libpython2.6.so.1.0
#43 0x00007f0c4297a4ce in ?? () from /usr/lib64/libpython2.6.so.1.0
#44 0x00007f0c42978e5e in ?? () from /usr/lib64/libpython2.6.so.1.0
#45 0x00007f0c42927268 in PyObject_Call () from 
/usr/lib64/libpython2.6.so.1.0
#46 0x00007f0c429b884e in PyEval_EvalFrameEx () from
/usr/lib64/libpython2.6.so.1.0
#47 0x00007f0c429bd369 in PyEval_EvalCodeEx () from
/usr/lib64/libpython2.6.so.1.0
#48 0x00007f0c4294e842 in ?? () from /usr/lib64/libpython2.6.so.1.0
#49 0x00007f0c42927268 in PyObject_Call () from 
/usr/lib64/libpython2.6.so.1.0
#50 0x00007f0c4297950d in ?? () from /usr/lib64/libpython2.6.so.1.0
#51 0x00007f0c42978e13 in ?? () from /usr/lib64/libpython2.6.so.1.0
#52 0x00007f0c42927268 in PyObject_Call () from 
/usr/lib64/libpython2.6.so.1.0
#53 0x00007f0c429b884e in PyEval_EvalFrameEx () from
/usr/lib64/libpython2.6.so.1.0
#54 0x00007f0c429bbd2a in PyEval_EvalFrameEx () from
/usr/lib64/libpython2.6.so.1.0
#55 0x00007f0c429bbd2a in PyEval_EvalFrameEx () from
/usr/lib64/libpython2.6.so.1.0
#56 0x00007f0c429bd369 in PyEval_EvalCodeEx () from
/usr/lib64/libpython2.6.so.1.0
#57 0x00007f0c429bd472 in PyEval_EvalCode () from
/usr/lib64/libpython2.6.so.1.0
#58 0x00007f0c429d8061 in ?? () from /usr/lib64/libpython2.6.so.1.0
#59 0x00007f0c429d8136 in PyRun_FileExFlags () from
/usr/lib64/libpython2.6.so.1.0
#60 0x00007f0c429d96bd in PyRun_SimpleFileExFlags () from
/usr/lib64/libpython2.6.so.1.0
#61 0x00007f0c429e5ceb in Py_Main () from /usr/lib64/libpython2.6.so.1.0
#62 0x00007f0c42383446 in __libc_start_main () from /lib64/libc.so.6
#63 0x0000000000400639 in _start ()

I post it to Mandriva form but nobody answered. I am not sure it's a Qt 
prolem or PyQt issue. But apparently only Mandriva's copy has this problem. 
I hope somebody can see the problem from the info I provided.

Thanks in advance,
Guang 




More information about the PyQt mailing list