# Segmentation fault with a SIGSEGV signal

**URL:** https://discourse.vtk.org/t/segmentation-fault-with-a-sigsegv-signal/3277
**Category:** Support
**Created:** [May 11, 2020, 11:02pm UTC](https://discourse.vtk.org/t/segmentation-fault-with-a-sigsegv-signal/3277 "2020-05-11T23:02:08Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![davidlni](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/da6949/32.png) [@davidlni](https://discourse.vtk.org/u/davidlni)
#### Post date: [May 11, 2020, 11:02pm UTC](https://discourse.vtk.org/t/segmentation-fault-with-a-sigsegv-signal/3277/1 "2020-05-11T23:02:08Z")

</div>

Hi all,

I built VTK from source on my docker Ubuntu container. If I run any Python script which involves renderer, I get following segmentation fault error. In CCMake, I did turn on RenderingOpenGL2 and the corresponded .so library is found in the library directory. Can anyone provide a solution? My VTK version is 9.0.0.

Loguru caught a signal: SIGSEGV  
Stack trace:  
22 0x55e2647ce28e /root/workspace/build/VTK/bin/vtkpython(+0x128e) [0x55e2647ce28e]  
21 0x7f720b7d40b3 \_\_libc\_start\_main + 243  
20 0x55e2647ce4ef /root/workspace/build/VTK/bin/vtkpython(+0x14ef) [0x55e2647ce4ef]  
19 0x7f720b72b424 vtkPythonInterpreter::PyMain(int, char\*\*) + 944  
18 0x7f720b3362f3 Py\_Main + 67  
17 0x7f720b335df8 Py\_RunMain + 1960  
16 0x7f720b354bcb PyRun\_SimpleFileExFlags + 235  
15 0x7f720b353482 PyRun\_FileExFlags + 146  
14 0x7f720b35333c /lib/x86\_64-linux-gnu/libpython3.8.so.1.0(+0x18733c) [0x7f720b35333c]  
13 0x7f720b391fbb PyEval\_EvalCode + 27  
12 0x7f720b391c0e PyEval\_EvalCodeEx + 62  
11 0x7f720b39188b \_PyEval\_EvalCodeWithName + 2299  
10 0x7f720b24306b \_PyEval\_EvalFrameDefault + 15467  
9 0x7f720b23effd /lib/x86\_64-linux-gnu/libpython3.8.so.1.0(+0x72ffd) [0x7f720b23effd]  
8 0x7f720b24a0db /lib/x86\_64-linux-gnu/libpython3.8.so.1.0(+0x7e0db) [0x7f720b24a0db]  
7 0x7f720b247467 \_PyEval\_EvalFrameDefault + 32871  
6 0x7f720b23f083 /lib/x86\_64-linux-gnu/libpython3.8.so.1.0(+0x73083) [0x7f720b23f083]  
5 0x7f720b46d697 \_PyObject\_MakeTpCall + 167  
4 0x7f720b46d227 /lib/x86\_64-linux-gnu/libpython3.8.so.1.0(+0x2a1227) [0x7f720b46d227]  
3 0x7f7209f96886 /root/workspace/build/VTK/lib/python3.8/site-packages/vtkmodules/vtkRenderingUI.cpython-38-x86\_64-linux-gnu.so(+0x5886) [0x7f7209f96886]  
2 0x7f72062d4fba vtkXRenderWindowInteractor::Initialize() + 1366  
1 0x7f72060fe60f XSync + 31  
0 0x7f720b7f3210 /lib/x86\_64-linux-gnu/libc.so.6(+0x46210) [0x7f720b7f3210]  
( 0.338s) [main thread] :0 FATL| Signal: SIGSEGV  
Segmentation fault

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [May 11, 2020, 11:47pm UTC](https://discourse.vtk.org/t/segmentation-fault-with-a-sigsegv-signal/3277/2 "2020-05-11T23:47:58Z")

</div>

> [@davidlni](#):
>
> 3 0x7f7209f96886 /root/workspace/build/VTK/lib/python3.8/site-packages/vtkmodules/vtkRenderingUI.cpython-38-x86\_64-linux-gnu.so(+0x5886) [0x7f7209f96886]  
> 2 0x7f72062d4fba vtkXRenderWindowInteractor::Initialize() + 1366  
> 1 0x7f72060fe60f XSync + 31  
> 0 0x7f720b7f3210 /lib/x86\_64-linux-gnu/libc.so.6(+0x46210) [0x7f720b7f3210]  
> ( 0.338s) [main thread] :0 FATL| Signal: SIGSEGV  
> Segmentation fault

It looks like it’s choking on some X bits. Do you have X running inside your container?

---

<div class="post-metadata">

### Author: ![davidlni](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/da6949/32.png) [@davidlni](https://discourse.vtk.org/u/davidlni)
#### Post date: [May 12, 2020, 2:44pm UTC](https://discourse.vtk.org/t/segmentation-fault-with-a-sigsegv-signal/3277/3 "2020-05-12T14:44:41Z")

</div>

Bingo! Thanks Ben. I did have issue to launch X11 forwarding to my host machine which is resolved now and now I got following errors. Is it related to my X11 setting or how VTK is built?

libGL error: No matching fbConfigs or visuals found  
libGL error: failed to load driver: swrast  
X Error of failed request: GLXBadContext  
Major opcode of failed request: 149 (GLX)  
Minor opcode of failed request: 6 (X\_GLXIsDirect)  
Serial number of failed request: 64  
Current serial number in output stream: 63

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [May 12, 2020, 3:27pm UTC](https://discourse.vtk.org/t/segmentation-fault-with-a-sigsegv-signal/3277/4 "2020-05-12T15:27:01Z")

</div>

It seems like DRI drivers are not installed. Do you actually need X here? If not, I recommend importing the modules you need directly with `from vtkmodules import vtkModuleName` rather than `import vtk` (which imports all of VTK and ends up needing X).

---

<div class="post-metadata">

### Author: ![davidlni](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/da6949/32.png) [@davidlni](https://discourse.vtk.org/u/davidlni)
#### Post date: [May 12, 2020, 4:01pm UTC](https://discourse.vtk.org/t/segmentation-fault-with-a-sigsegv-signal/3277/5 "2020-05-12T16:01:46Z")

</div>

I am trying to launch the vtk-server.py (see [https://vtk.org/Wiki/VTK/Examples/Python/Web/RemoteRenderer](https://vtk.org/Wiki/VTK/Examples/Python/Web/RemoteRenderer)). I can comment out the code in the condition block (if not \_WebCone.view:) but not sure if I still can get the view on the browser without view. I am a newbie to VTK and would like to understand how all these work.

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [May 12, 2020, 4:38pm UTC](https://discourse.vtk.org/t/segmentation-fault-with-a-sigsegv-signal/3277/6 "2020-05-12T16:38:00Z")

</div>

This example actually rely on remote rendering using VTK on the server side. If you don’t have a GPU on the server and you just want your docker to work anywhere, you will need to build VTK against OSMesa for rendering. But be aware that such rendering will be much slower than using a GPU.

For ParaViewWeb we have both an OSMesa version that can work anywhere such as a MacOS. And we have an EGL version which use an NVIDIA GPU. But, for EGL, you must have an NVIDIA graphics card with the proper set of driver installed.

Also in either case, you can use a prebuilt version of ParaView (EGL or OSMesa) to run VTK code by just downloading the proper linux binary [here](https://www.paraview.org/download).
