I have a python script, which I didn't write, that utilises the vtk module. It has worked on my old iMac and on my Linux machines. Trying it on my Macbook Pro with OS X Mavericks installed I get a seg fault during rendering. I have tracked down the error to a call to the vtkRender() method which causes the script to crash with seg fault 11. I literally have no idea how to go further and find out the exact cause of the bug (for instance, how do I step into a method call using pdb?), any ideas?
A minimal program crash is as follows:
Enthought Canopy Python 2.7.3 | 64-bit | (default, Aug 8 2013, 05:37:06) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import vtk >>> test = vtk.vtkRenderer() >>> test.Render() Segmentation fault: 11
Update: I installed Ubuntu on VirtualBox and get the same seg fault for the above example, however my python script utilising the vtk modules works just fine.
So this seems to be a problem using the VTK package provided with EPD and OS X Mavericks. Any idea how to fix this? I deleted all trace of VTK and tried installing from source but I'm having all manner of problems just getting VTK to import in this case.
Update:
By adding some extra boiler-plate to the VTK code in the script I can get it to work again. Very strange behaviour indeed. Works fine in Ubuntu with identical code and libraries, yet on Mac OS X it seg faults unless I add some .Initialize() method calls and others to the rendering object.