[Paraview-developers] SEGFAULT when applying a slice on a dataset with 2.2e9 cells

Christophe Bourcier christophe.bourcier.pv at gmail.com
Mon Mar 21 10:23:42 EDT 2016


Hi,

I have an ImageData with 2.2e9 cells that loads well in Paraview
compiled with VTK_USE_64BIT_IDS=ON.

But when I apply a slice on it, I get a segmentation fault.

I have modified VTK/Filters/Core/vtkSynchronizedTemplatesCutter3D.cxx
to use vtkIdType instead of int where needed. See the patch in
attachment.

Now, I can make the slice on my dataset.

You can download my sample file here (2,1Gb): http://bourcier.eu/VOL0_fft.vti

I wonder if other filters will need some patch too with this number of cells.

Christophe
-------------- next part --------------
--- ParaView-v5.0.0-source.orig/VTK/Filters/Core/vtkSynchronizedTemplatesCutter3D.cxx	2016-01-08 21:22:21.000000000 +0100
+++ ParaView-v5.0.0-source/VTK/Filters/Core/vtkSynchronizedTemplatesCutter3D.cxx	2016-03-21 13:59:36.476965953 +0100
@@ -132,14 +132,14 @@
   int numContours = self->GetNumberOfContours();
   T *inPtrX, *inPtrY, *inPtrZ;
   T *s0, *s1, *s2, *s3;
-  int xMin, xMax, yMin, yMax, zMin, zMax;
-  int xInc, yInc, zInc;
+  vtkIdType xMin, xMax, yMin, yMax, zMin, zMax;
+  vtkIdType xInc, yInc, zInc;
   int xIncFunc, yIncFunc, zIncFunc, scalarZIncFunc;
   double *origin = data->GetOrigin();
   double *spacing = data->GetSpacing();
   int *isect1Ptr, *isect2Ptr;
   double y, z, t;
-  int i, j, k;
+  vtkIdType i, j, k;
   int zstep, yisectstep;
   int offsets[12];
   int *tablePtr;
@@ -149,7 +149,7 @@
   vtkIdType ptIds[3];
   double value;
   // We need to know the edgePointId's for interpolating attributes.
-  int edgePtId, inCellId, outCellId;
+  vtkIdType edgePtId, inCellId, outCellId;
   vtkPointData *inPD = data->GetPointData();
   vtkCellData *inCD = data->GetCellData();
   vtkPointData *outPD = output->GetPointData();
@@ -309,15 +309,15 @@
       for (j = yMin; j <= yMax; j++)
         {
         // Should not impact performance here/
-        edgePtId = (xMin-inExt[0])*xInc + (j-inExt[2])*yInc + (k-inExt[4])*zInc;
+        edgePtId = (xMin-(vtkIdType)inExt[0])*xInc + (j-(vtkIdType)inExt[2])*yInc + (k-(vtkIdType)inExt[4])*zInc;
 
         // Increments are different for cells.  Since the cells are not
         // contoured until the second row of templates, subtract 1 from
         // i,j,and k.  Note: first cube is formed when i=0, j=1, and k=1.
         inCellId =
-          (xMin-inExt[0]) + (inExt[1]-inExt[0])*
-          ( (j-inExt[2]-1) + (k-inExt[4]-1)*(inExt[3]-inExt[2]) );
-
+          (xMin-(vtkIdType)inExt[0]) + ((vtkIdType)inExt[1]-(vtkIdType)inExt[0])*
+          ( (j-(vtkIdType)inExt[2]-1) + (k-(vtkIdType)inExt[4]-1)*((vtkIdType)inExt[3]-(vtkIdType)inExt[2]) );
+          
         y = origin[1] + j*spacing[1];
         xz[1] = y;
 


More information about the Paraview-developers mailing list