[vtk-developers] segfault when DeepCopy()ing PolyData with Links built

Charl P. Botha c.p.botha at its.tudelft.nl
Mon Apr 14 09:50:36 EDT 2003


Dear developers,

When I DeepCopy() a vtkPolyData() that has its Links built (i.e. after a
BuildLinks() call) the application segfaults.  This is with VTK CVS on
Debian Linux 3.0.

To reproduce the segfault, apply the attached patch (it adds one line)
to VTK/Hybrid/Testing/Tcl/TestPCA.tcl and run the script.  The backtrace
looks like this:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 26468)]
0x417171cd in vtkCellLinks::BuildLinks (this=0x8112780, data=0x81a1718)
    at /home/cpbotha/DoNotBackup/build/VTK/Common/vtkCellLinks.h:159
159       this->Array[ptId].cells[pos] = cellId;
(gdb) bt
#0  0x417171cd in vtkCellLinks::BuildLinks (this=0x8112780,
data=0x81a1718)
    at /home/cpbotha/DoNotBackup/build/VTK/Common/vtkCellLinks.h:159
#1  0x417c7045 in vtkPolyData::DeepCopy (this=0x81a1718,
dataObject=0x80f5378)
    at /home/cpbotha/DoNotBackup/build/VTK/Common/vtkPolyData.cxx:1015
#2  0x40085d76 in vtkPolyDataCppCommand (op=0x81a1718, interp=0x8054370,
    argc=3, argv=0xbffff09c)

Could someone with somewhat more experience with this bit of code have a
look?

Thanks,
Charl

-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/
-------------- next part --------------
--- TestPCA.tcl	Mon Apr 14 15:44:56 2003
+++ TestPCA-segfault.tcl	Mon Apr 14 15:44:32 2003
@@ -102,6 +102,10 @@
     params SetNumberOfComponents 1
     params SetNumberOfTuples 1
     params SetTuple1 0 0.0
+    
+# this should make things segfault at DeepCopy
+[sphere GetOutput] BuildLinks 0
+
 vtkPolyData shapea
   shapea DeepCopy [sphere GetOutput]
 pca GetParameterisedShape params shapea


More information about the vtk-developers mailing list