# Paraview Segfault when running this script \[solved\]

**URL:** https://discourse.paraview.org/t/paraview-segfault-when-running-this-script-solved/9482
**Category:** ParaView Support
**Tags:** python
**Created:** [April 20, 2022, 6:34pm UTC](https://discourse.paraview.org/t/paraview-segfault-when-running-this-script-solved/9482 "2022-04-20T18:34:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Devin\_Richard\_Bayly](https://discourse.paraview.org/user_avatar/discourse.paraview.org/devin_richard_bayly/32/5533_2.png) [@Devin\_Richard\_Bayly](https://discourse.paraview.org/u/Devin_Richard_Bayly)
#### Post date: [April 20, 2022, 6:34pm UTC](https://discourse.paraview.org/t/paraview-segfault-when-running-this-script-solved/9482/1 "2022-04-20T18:34:31Z")

</div>

Hi there,

For some reason this script crashes my Paraview. I’m using version ParaView-5.9.0-RC4-MPI-Linux-Python3.8-64bit on ubuntu 20.04

```auto
import paraview.vtk as vtk
from paraview.simple import *

points = vtk.vtkPoints()
points.InsertPoint(0, 0, 0, 0)
points.InsertPoint(1, 1, 0, 0)
points.InsertPoint(2, 0, 1, 0)
points.InsertPoint(3, 0, 0, 1)
pdo = vtk.vtkPolyData()
pdo.SetPoints(points)
pdo.Allocate(4, 4)

triangle = vtk.vtkPolygon()
triangle.GetPointIds().SetNumberOfIds(3)

tris = [[0,1,2], [0,2,3], [0,3,1], [1,3,2]]
for t in range(0, 4):
    for p in range(0, 3):
        triangle.GetPointIds().SetId(p, tris[t][p])
    pdo.InsertNextCell(triangle.GetCellType(), triangle.GetPointIds())

tp = TrivialProducer()
tp.GetClientSideObject().SetOutput(pdo)
Show(tp)
Render()

```

This code seems to work fine with pvpython, so I’m not sure what’s up.

---

<div class="post-metadata">

### Author: ![Devin\_Richard\_Bayly](https://discourse.paraview.org/user_avatar/discourse.paraview.org/devin_richard_bayly/32/5533_2.png) [@Devin\_Richard\_Bayly](https://discourse.paraview.org/u/Devin_Richard_Bayly)
#### Post date: [April 20, 2022, 6:37pm UTC](https://discourse.paraview.org/t/paraview-segfault-when-running-this-script-solved/9482/2 "2022-04-20T18:37:42Z")

</div>

Actually, trying it a couple more times it seems to have worked without segfaulting. A full system restart might have been the solution here, I’ll re open this if the issue surfaces again.
