The code throws SIGSEGV after upgrading to VTK 9.2.6

I have upgraded VTK from version 9.1 to 9.2.6. The code compiles, but throws SIGSEGV signal. GDB debugging gives the following:

Thread 2 received signal SIGSEGV, Segmentation fault.
vtkPoints::InsertNextPoint (this=0x600003008120, x=48, y=104, z=0) at /usr/local/include/vtk-9.2/vtkPoints.h:302
302 return this->Data->InsertNextTuple(p);

Any help in resolving this is appreciated. Thx

Hi @efourkal

Could you provide a small case to reproduce the crash? Otherwise, could you provide more context like the type of dataset you are working on, the index/tuple size, or if you are writing data concurrently, etc.

Best,

Hello Francois,

The code I am running is a computer simulation of the cellular automaton model of cell growth in time and 2D space. I am using VTK to visualize the 2D cells at certain time point. I am pasting below the function that visualizes the cells:

void visualizeLesion(vector::iterator begin, vector::iterator end) {

initializeRendering();

addCells(begin, end);

//creating new color table
vtkSmartPointer<vtkLookupTable> colorLookupTable = vtkSmartPointer<vtkLookupTable>::New();
colorLookupTable->SetNumberOfColors(256);
colorLookupTable->SetHueRange( 0.667, 0.0);
colorLookupTable->Build();

// Combine into a polydata
vtkSmartPointer<vtkPolyData> polydata = vtkSmartPointer<vtkPolyData>::New();
polydata->SetPoints(points);
polydata->GetPointData()->SetScalars(scalar);

vtkSmartPointer<vtkSphereSource> SphereSource = vtkSmartPointer<vtkSphereSource>::New();//you can use sphere if you want

vtkSmartPointer<vtkGlyph3D> glyph3D = vtkSmartPointer<vtkGlyph3D>::New();
glyph3D->SetColorModeToColorByScalar();
glyph3D->SetSourceConnection(SphereSource->GetOutputPort());
glyph3D->ScalingOff();
glyph3D->SetInputData(polydata);
glyph3D->Update();

// Create a mapper and actor
vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
mapper->SetInputConnection(glyph3D->GetOutputPort());
mapper->SetLookupTable(colorLookupTable);

vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
actor->SetMapper(mapper);

// Add the actor to the scene
renderer->AddActor(actor);

// Render
renderWindow->Render();

vtkSmartPointer<vtkInteractorStyleTrackballCamera> style = vtkSmartPointer<vtkInteractorStyleTrackballCamera>::New(); //like paraview

renderWindowInteractor->SetInteractorStyle( style );

renderWindowInteractor->Start();

}

The same code has no issues running when using 9.1 version of VTK. This happened after I upgraded my laptop to Ventura osx. I am running gcc version 13. Thanks for your input.

Eugene

If I had to bet, I suspect that there is a memory issue elsewhere in the code that has been unmasked by upgrading the version. I suggest that you run a dynamic memory checker.