# The code throws SIGSEGV after upgrading to VTK 9.2.6

**URL:** <https://discourse.vtk.org/t/the-code-throws-sigsegv-after-upgrading-to-vtk-9-2-6/11955>\
**Category:** Development\
**Created:** [July 17, 2023, 3:43pm UTC](https://discourse.vtk.org/t/the-code-throws-sigsegv-after-upgrading-to-vtk-9-2-6/11955 "2023-07-17T15:43:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![efourkal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/efourkal/32/7461_2.png) [@efourkal](https://discourse.vtk.org/u/efourkal)\
**Post date:** [July 17, 2023, 3:43pm UTC](https://discourse.vtk.org/t/the-code-throws-sigsegv-after-upgrading-to-vtk-9-2-6/11955/1 "2023-07-17T15:43:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Francois\_Mazen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/francois_mazen/32/3290_2.png) [@Francois\_Mazen](https://discourse.vtk.org/u/Francois_Mazen)\
**Post date:** [July 18, 2023, 6:42am UTC](https://discourse.vtk.org/t/the-code-throws-sigsegv-after-upgrading-to-vtk-9-2-6/11955/2 "2023-07-18T06:42:33Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![efourkal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/efourkal/32/7461_2.png) [@efourkal](https://discourse.vtk.org/u/efourkal)\
**Post date:** [July 18, 2023, 12:21pm UTC](https://discourse.vtk.org/t/the-code-throws-sigsegv-after-upgrading-to-vtk-9-2-6/11955/3 "2023-07-18T12:21:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![will.schroeder](https://discourse.vtk.org/user_avatar/discourse.vtk.org/will.schroeder/32/233_2.png) [@will.schroeder](https://discourse.vtk.org/u/will.schroeder)\
**Post date:** [July 18, 2023, 12:46pm UTC](https://discourse.vtk.org/t/the-code-throws-sigsegv-after-upgrading-to-vtk-9-2-6/11955/4 "2023-07-18T12:46:28Z")

</div>

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.
