[vtkusers] python reader.GetFileName() seg faults

Chris Myers myers at tc.cornell.edu
Mon Jul 24 11:39:07 EDT 2000


I am running VTK3.1.2 (under RedHat Linux 6.2, although the same basic
problem appears under Windows 2000) and have found a problem with
the Python interface, in particular the behavior of the various
vtk*Reader objects (vtkUnstructuredGridReader, etc.).

If the input filename to the reader is not specified, a call to
GetFileName() results in a segmentation fault, e.g.,

>>> import VTK 
>>> reader = VTK.vtkUnstructuredGridReader() 
>>> reader.GetFileName() 
Segmentation fault

>>> import VTK 
>>> reader = VTK.vtkStructuredPointsReader()
>>> reader.GetFileName()
Segmentation fault

The GetFileName() method works properly if a filename has previously
been set.  This behavior does not appear to happen with the underlying
C++ library (i.e., a call to GetFileName() returns a NULL pointer).

This seems like a bug.  Hopefully it's not a big deal to fix.

I discovered this using the macros, vtkSetStringMacro and
vtkGetStringMacro, for a custom reader that I am building.  The 
buggy behavior occurs for my custom reader, but also for the 
built-in VTK readers, as described above.

Thanks,

Chris

==========================================================================
Chris Myers 
Cornell Theory Center
--------------------------------------------------------------------------
636 Rhodes Hall              email: myers at tc.cornell.edu
Cornell University           phone: (607) 255-5894 / fax: (607) 254-8888
Ithaca, NY 14853             http://www.tc.cornell.edu/~myers
--------------------------------------------------------------------------
"To thine own self be blue." - Polonious Funk
==========================================================================









More information about the vtkusers mailing list