# Segfault when computing gradient of a vector on polyhedral cells

**URL:** https://discourse.paraview.org/t/segfault-when-computing-gradient-of-a-vector-on-polyhedral-cells/10282
**Category:** ParaView Support
**Created:** [September 9, 2022, 9:48am UTC](https://discourse.paraview.org/t/segfault-when-computing-gradient-of-a-vector-on-polyhedral-cells/10282 "2022-09-09T09:48:54Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Lukasz](https://discourse.paraview.org/user_avatar/discourse.paraview.org/lukasz/32/5392_2.png) [@Lukasz](https://discourse.paraview.org/u/Lukasz)
#### Post date: [September 9, 2022, 9:48am UTC](https://discourse.paraview.org/t/segfault-when-computing-gradient-of-a-vector-on-polyhedral-cells/10282/1 "2022-09-09T09:48:54Z")

</div>

I am working on a grid that contains also polyhedral cells and my Paraview (5.10) crashes whenever I compute gradient of the velocity vector. I reduced my mesh to just 4 poly cells and can always reproduce the error. The cellst themselves look okay in terms of VTK format and I can compute gradients of a scalar and also gradient of a vector provided that I use up to 3 cells. With 4 connected polys I get the above mentioned segfault. I am wondering whether it is my mesh format problem or whether Paraview has a bug.

```auto
> Loguru caught a signal: SIGSEGV
> Stack trace:
> 13 0x7fa56673688d clone + 109
> 12 0x7fa55b130e65 /usr/lib64/libpthread.so.0(+0x7e65) [0x7fa55b130e65]
> 11 0x7fa55aee8196 /home/caldron-b/g478040/linux/Software/Paraview/v5.10.1/ParaView-5.10.1-MPI-Linux-Python3.9-x86_64/bin/../lib/libtbb.so.2(+0x1d196) [0x7fa55aee8196]
> 10 0x7fa55aee8206 /home/caldron-b/g478040/linux/Software/Paraview/v5.10.1/ParaView-5.10.1-MPI-Linux-Python3.9-x86_64/bin/../lib/libtbb.so.2(+0x1d206) [0x7fa55aee8206]
> 9 0x7fa55aeec56f /home/caldron-b/g478040/linux/Software/Paraview/v5.10.1/ParaView-5.10.1-MPI-Linux-Python3.9-x86_64/bin/../lib/libtbb.so.2(+0x2156f) [0x7fa55aeec56f]
> 8 0x7fa55aeee760 /home/caldron-b/g478040/linux/Software/Paraview/v5.10.1/ParaView-5.10.1-MPI-Linux-Python3.9-x86_64/bin/../lib/libtbb.so.2(+0x23760) [0x7fa55aeee760]
> 7 0x7fa55aef45ea /home/caldron-b/g478040/linux/Software/Paraview/v5.10.1/ParaView-5.10.1-MPI-Linux-Python3.9-x86_64/bin/../lib/libtbb.so.2(+0x295ea) [0x7fa55aef45ea]
> 6 0x7fa55f092fba /home/caldron-b/g478040/linux/Software/Paraview/v5.10.1/ParaView-5.10.1-MPI-Linux-Python3.9-x86_64/bin/../lib/libvtkFiltersGeneral-pv5.10.so.1(+0x24bfba) [0x7fa55f092fba]
> 5 0x7fa55f09286a /home/caldron-b/g478040/linux/Software/Paraview/v5.10.1/ParaView-5.10.1-MPI-Linux-Python3.9-x86_64/bin/../lib/libvtkFiltersGeneral-pv5.10.so.1(+0x24b86a) [0x7fa55f09286a]
> 4 0x7fa55dabe921 vtkPolyhedron::Derivatives(int, double const*, double const*, int, double*) + 641
> 3 0x7fa55da29c0c vtkMeanValueCoordinatesInterpolator::ComputeInterpolationWeights(double const*, vtkPoints*, vtkCellArray*, double*) + 236
> 2 0x7fa55da2783d vtkMeanValueCoordinatesInterpolator::ComputeInterpolationWeightsForPolygonMesh(double const*, vtkPoints*, vtkMVCPolyIterator&, double*) + 109
> 1 0x7fa55da20ffd /home/caldron-b/g478040/linux/Software/Paraview/v5.10.1/ParaView-5.10.1-MPI-Linux-Python3.9-x86_64/bin/../lib/libvtkCommonDataModel-pv5.10.so.1(+0x286ffd) [0x7fa55da20ffd]
> 0 0x7fa56666e3b0 /usr/lib64/libc.so.6(+0x363b0) [0x7fa56666e3b0]
> ( 64.034s) [813F4700] :0 FATL| Signal: SIGSEGV

```

[poly.tar.zst](https://discourse.paraview.org/uploads/short-url/bDsHwPH5WzMlyG4m93ygx8TIwwU.zst) (6.9 KB)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [September 9, 2022, 10:45am UTC](https://discourse.paraview.org/t/segfault-when-computing-gradient-of-a-vector-on-polyhedral-cells/10282/2 "2022-09-09T10:45:23Z")

</div>

I reproduce, looks like a memory issue, you may want to open an issue.

---

<div class="post-metadata">

### Author: ![Lukasz](https://discourse.paraview.org/user_avatar/discourse.paraview.org/lukasz/32/5392_2.png) [@Lukasz](https://discourse.paraview.org/u/Lukasz)
#### Post date: [September 9, 2022, 12:30pm UTC](https://discourse.paraview.org/t/segfault-when-computing-gradient-of-a-vector-on-polyhedral-cells/10282/3 "2022-09-09T12:30:26Z")

</div>

I shamefully admit that I do not know how to open an issue. Either someone else opens an issue or shows me how to do it.

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [September 9, 2022, 12:38pm UTC](https://discourse.paraview.org/t/segfault-when-computing-gradient-of-a-vector-on-polyhedral-cells/10282/4 "2022-09-09T12:38:53Z")

</div>

Issues are maintained using ParaView’s GitLab repo here: [https://gitlab.kitware.com/paraview/paraview/-/issues](https://gitlab.kitware.com/paraview/paraview/-/issues). On that page in the upper right is a `New issue` button that you can use to submit a new issue.

---

<div class="post-metadata">

### Author: ![Lukasz](https://discourse.paraview.org/user_avatar/discourse.paraview.org/lukasz/32/5392_2.png) [@Lukasz](https://discourse.paraview.org/u/Lukasz)
#### Post date: [September 12, 2022, 1:20pm UTC](https://discourse.paraview.org/t/segfault-when-computing-gradient-of-a-vector-on-polyhedral-cells/10282/5 "2022-09-12T13:20:28Z")

</div>

done  
[https://gitlab.kitware.com/paraview/paraview/-/issues/21549](https://gitlab.kitware.com/paraview/paraview/-/issues/21549)
