[vtkusers] wx python scripts segfault

David Doria daviddoria+vtk at gmail.com
Mon Mar 1 21:55:23 EST 2010


>
> I will have to build VTK CVS to be able to test this (I currently have
> 5.4.2 on all platforms).  Hopefully I can reproduce the crash, in
> which case I have a better chance of being able to diagnose it.  I'm
> currently swamped, so this is not going to happen very soon.
>
> Please continue with your own debugging in the meanwhile.  First thing
> you could try, is to modify the attribList to contain only
> wx.glcanvas.WX_GL_DOUBLEBUFFER bringing it more in linux with
> wxVTKRenderWindow.
>
> Good luck,
> Charl
>

I tried modifying attribList - there was no change. I believe the crash
happens in the Render function. I put a
print "before"
and
print "after"
in the function:

    def Render(self):
        """Actually renders the VTK scene on screen.
        """
        RenderAllowed = 1
       print "before"
        if not self.__RenderWhenDisabled:
            # the user doesn't want us to render when the toplevel frame
            # is disabled - first find the top level parent
            topParent = wx.GetTopLevelParent(self)
            if topParent:
                # if it exists, check whether it's enabled
                # if it's not enabeld, RenderAllowed will be false
                RenderAllowed = topParent.IsEnabled()

        if RenderAllowed:
            if self.__handle and self.__handle == self.GetHandle():
                self._Iren.GetRenderWindow().Render()

            elif self.GetHandle() and self.__has_painted:
                # this means the user has reparented us; let's adapt to the
                # new situation by doing the WindowRemap dance
                self._Iren.GetRenderWindow().SetNextWindowInfo(
                    str(self.GetHandle()))

                # make sure the DisplayId is also set correctly
                d = self.GetDisplayId()
                if d:
                    self._Iren.GetRenderWindow().SetDisplayId(d)

                # do the actual remap with the new parent information
                self._Iren.GetRenderWindow().WindowRemap()

                # store the new situation
                self.__handle = self.GetHandle()
                self._Iren.GetRenderWindow().Render()
print "after"

The output is:
[doriad at davedesktop wx]$ python wxVTKRenderWindowInteractor.py
before
after
before
Segmentation fault

I am not at all a python guru so I don't know how the buffers work/flush, so
maybe this is misleading because the buffer is not flushed - but if not, I
think it indicates that the crash happens in this function (the second time
it is called)?

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100301/ecb029a2/attachment.htm>


More information about the vtkusers mailing list