# Segmentation fault with vtkGeometryFilter on 4 threads

**URL:** <https://discourse.vtk.org/t/segmentation-fault-with-vtkgeometryfilter-on-4-threads/5735>\
**Category:** Development\
**Created:** [May 7, 2021, 12:28pm UTC](https://discourse.vtk.org/t/segmentation-fault-with-vtkgeometryfilter-on-4-threads/5735 "2021-05-07T12:28:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohd-afeef-badri](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@mohd-afeef-badri](https://discourse.vtk.org/u/mohd-afeef-badri)\
**Post date:** [May 7, 2021, 12:28pm UTC](https://discourse.vtk.org/t/segmentation-fault-with-vtkgeometryfilter-on-4-threads/5735/1 "2021-05-07T12:28:40Z")

</div>

Dear Experts,

I have a `vtu` file containing a mesh composed of hexahedrons and polyhedrons. When I try to use `vtkGeometryFilter()` on this data it results in segmentation fault. I have included a MWE via python that can be downloaded form ([http://dl.free.fr/jstNegHHL](http://dl.free.fr/jstNegHHL)).

I know that the `vtkGeometryFilter()` has been threaded, so when I set number of threads to 1, 2, or 3 using `OMP_NUM_THREADS` I do not face any problem, but when the number of threads is set to more than 4, I get segmentation fault. This behavior can be replicated on CentOS7 and Fedora 30 machines using the recent VTK release that ships with ParaView 5.9.

Have I stumbled upon a potential bug ?

PS: I was not able to attach a file as I am a new user to this forum (“Sorry, new users can not upload attachments.”), hence the vtu and python were uploaded to [http://dl.free.fr/jstNegHHL](http://dl.free.fr/jstNegHHL)

---

<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:** [May 7, 2021, 12:35pm UTC](https://discourse.vtk.org/t/segmentation-fault-with-vtkgeometryfilter-on-4-threads/5735/2 "2021-05-07T12:35:38Z")

</div>

Yes, I believe that this is the bug you encountered, which Timothée has identified and is fixing now:  
[https://gitlab.kitware.com/vtk/vtk/-/merge\_requests/7948#note\_952312](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7948#note_952312)

---

<div class="post-metadata">

**Author:** ![mohd-afeef-badri](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@mohd-afeef-badri](https://discourse.vtk.org/u/mohd-afeef-badri)\
**Post date:** [May 7, 2021, 12:51pm UTC](https://discourse.vtk.org/t/segmentation-fault-with-vtkgeometryfilter-on-4-threads/5735/3 "2021-05-07T12:51:34Z")

</div>

Wow this must be the quickest response that I have got on any development forum!!! Thank you for this quick response. I will wait for the fix. 🙂

---

<div class="post-metadata">

**Author:** ![mohd-afeef-badri](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@mohd-afeef-badri](https://discourse.vtk.org/u/mohd-afeef-badri)\
**Post date:** [May 20, 2021, 1:29pm UTC](https://discourse.vtk.org/t/segmentation-fault-with-vtkgeometryfilter-on-4-threads/5735/4 "2021-05-20T13:29:27Z")

</div>

Hello,

I have tested the fix proposed by Timothée Couble ([https://gitlab.kitware.com/vtk/vtk/-/commit/2cafded94c65102d103c43e60ddfc0d5ea361fb9](https://gitlab.kitware.com/vtk/vtk/-/commit/2cafded94c65102d103c43e60ddfc0d5ea361fb9)), I confirm that it solves the issues that I was facing.

Thank you Will Schroeder for pointing me towards the fix.

---

<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:** [May 20, 2021, 1:48pm UTC](https://discourse.vtk.org/t/segmentation-fault-with-vtkgeometryfilter-on-4-threads/5735/5 "2021-05-20T13:48:08Z")

</div>

Excellent thanks for letting us know
