[vtkusers] Crash with subsequent creation of vtkRenderWindow in Python

Pearu Peterson vtk at cens.ioc.ee
Sat Apr 5 11:29:18 EST 2003


On Sat, 5 Apr 2003, Charl P. Botha wrote:

> On Sat, Apr 05, 2003 at 06:28:07PM +0300, Pearu Peterson wrote:
> > 
> > """
> > from vtk import vtkRenderWindow
> > win = vtkRenderWindow()
> > win.SetSize((400,400))
> > win.Render()
> > raw_input('Press any key to close window: ')
> > del win
> > raw_input('Press any key to create a new window: ')
> > win = vtkRenderWindow()
> > win.DebugOn()
> > win.SetSize((400,400))
> > win.Render()
> > raw_input('Press any key to exit: ')
> > """
> > 
> > crashes with the following output:
> 
> It doesn't crash here: Debian, NVidia binary drivers 1.0-4191, XFree86 4.2.1,
> VTK CVS, Python 2.2.1
> 
> I also tested it on my Debian laptop, XFree86 4.3.0, DRI CVS (i.e. also Mesa
> 5.0.1), VTK CVS, Python 2.2.1 without incident.

Could this be an X issue then? I am on

  XFree86 Version 3.3.6a (driver Mach64)


> > I have noticed that there is no problem if to create several
> > subsequent RenderWindows but whenever one is closed before opening
> > another RenderWindow, this crash occures. Any ideas?
> 
> The RenderWindow should disappear when all references (including Python
> bindings) to it are removed.  Things get more complicated when you use a
> vtkRenderWindow along with an external widget set, but that is not the case
> here.

Yes, I know. The above case is a result of a major reduction of a real app
having the same problem.

Here follows more diagnostics:

"""
from vtk import vtkRenderWindow
def win():
    w = vtkRenderWindow()
    w.SetSize((400,400))
    w.Render()
    return w
w = win()
w2 = win()
raw_input('Press any key to close window: ')
del w
raw_input('Press any key to close another window: ')
del w2
raw_input('Press any key to exit: ')
"""

crashes at statement `del w2` with segmentation fault. libwadpy gives the
following traceback:

"""
WAD: Segmentation fault.
#17  0x080797e9 in PyEval_EvalCode()
#16  0x080777ed in PyEval_EvalCodeEx()
#15  0x08075b80 in ?()
#14  0x080c2c1d in PyDict_DelItem()
#13  0x4096d789 in PyVTKObject_PyDelete__FP11PyVTKObject()
#12  0x4096f94e in vtkPythonDeleteObjectFromHash__FP7_object(obj=0x8514b40) in 'vtkPythonUtil.cxx', line 1314
#11  0x406dde20 in _._19vtkSmartPointerBase(this=0xbfffe470,__in_chrg=2) in 'vtkSmartPointerBase.cxx', line 44
#10  0x406de02d in UnRegister__19vtkSmartPointerBase(this=0xbfffe470) in 'vtkSmartPointerBase.cxx', line 85
#9   0x41fd66af in UnRegister__15vtkRenderWindowP13vtkObjectBase(this=0x8514968,o=0x0) in 'vtkRenderWindow.cxx', line 991
#8   0x40684aa0 in UnRegister__9vtkObjectP13vtkObjectBase(this=0x8514968,o=0x0) in 'vtkObject.cxx', line 245 
#7   0x42078462 in _._22vtkXOpenGLRenderWindow(this=0x8514968,__in_chrg=3) in 'vtkXOpenGLRenderWindow.cxx', line 353
#6   0x424fa5d3 in glXDestroyContext(dpy=0x8514be8,ctx=0x8518af8) in 'glxapi.c', line 208
#5   0x424fecd6 in Fake_glXDestroyContext(dpy=0x8514be8,ctx=0x8518af8) in 'fakeglx.c ', line 1462
#4   0x42505f34 in XMesaGarbageCollect() in 'xm_api.c', line 2530
#3   0x425d68b7 in XSync()
#2   0x425daba6 in _XReply()
#1   0x425d980c in ?()
#0   0x425f4cae in _X11TransWrite()

/home/users/pearu/src/Mesa-5.0.1/src/X/xm_api.c, line 2530

         /* NOT_NEEDED */
    #else
 =>      XSync(b->display, False);
    
             if (!window_exists( b->display, b->frontbuffer )) {

"""

Thanks for a quick response,
	Pearu




More information about the vtkusers mailing list