using vtkXMLWriterC.h segfaults for unstructured grid
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
I'm trying to write VTK files in XML format for unstructured grid using vtkXMLWriterC.h.
I read the TestXMLCInterface.c example, which displays one cell. Works fine, good.
I wrote my own C code following this example. It works fine for one cell (ie dim_x = dim_y = dim_z = 1). Good.
But when there is more than one cell (dim_x = 2), it fails with segfault :
GNU gdb 6.3-debian [snip] This GDB was configured as "i386-linux"...Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) run Starting program: /home/fred/tmp/test [Thread debugging using libthread_db enabled] [New Thread -1220281536 (LWP 4761)] vtk_points : 3×12 0 : 0 0 0 1 : 1 0 0 2 : 2 0 0 3 : 0 1 0 4 : 1 1 0 5 : 2 1 0 6 : 0 0 1 7 : 1 0 1 8 : 2 0 1 9 : 0 1 1 10 : 1 1 1 11 : 2 1 1
vtk_cells : 2×8 0 : 0 1 4 3 6 7 10 9 1 : 1 2 5 4 7 8 11 10
vtk_tab : 12 0 1 2 3 4 5 6 7 8 9 10 11 Writing foo.vtu file... Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1220281536 (LWP 4761)] 0xb7d61fdd in vtkDataCompressor::Compress () from /usr/local/lib/libvtkIO.so.5.0