# pvpython crashes on ctrl-c

**URL:** https://discourse.paraview.org/t/pvpython-crashes-on-ctrl-c/12594
**Category:** ParaView Support
**Tags:** python
**Created:** [July 27, 2023, 7:10pm UTC](https://discourse.paraview.org/t/pvpython-crashes-on-ctrl-c/12594 "2023-07-27T19:10:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tjggriffin](https://discourse.paraview.org/user_avatar/discourse.paraview.org/tjggriffin/32/11986_2.png) [@tjggriffin](https://discourse.paraview.org/u/tjggriffin)
#### Post date: [July 27, 2023, 7:10pm UTC](https://discourse.paraview.org/t/pvpython-crashes-on-ctrl-c/12594/1 "2023-07-27T19:10:43Z")

</div>

If I type a ctrl-c at the pvpython interpreter prompt, it crashes. It does not do this with other versions of python on our system. I habitually use ctrl-c to abandon something I’m entering at the prompt. I’ve started backspacing instead in pvpython, but not infrequently, muscle memory takes over and I loose what I’ve entered. becaues it crashes, the history of not complete. Below are some examples. Note python3.9 uses the same version as pvpython.

[Edtied for formatting]

> :CLEAN:[griffin@joshua:~]  
> 8874 \> python3.6  
> Python 3.6.8 (default, Jun 22 2023, 05:10:43)  
> [GCC 8.5.0 20210514 (Red Hat 8.5.0-18)] on linux  
> Type “help”, “copyright”, “credits” or “license” for more information.  
> \>\>\> I will type ctrl-c at the end of this line  
> KeyboardInterrupt  
> \>\>\>
> 
> :CLEAN:[griffin@joshua:~]  
> 8875 \> python3.9  
> Python 3.9.16 (main, Jul 3 2023, 20:07:32)  
> [GCC 8.5.0 20210514 (Red Hat 8.5.0-18)] on linux  
> Type “help”, “copyright”, “credits” or “license” for more information.  
> \>\>\> I will type ctrl-c at the end of this line  
> KeyboardInterrupt  
> \>\>\>
> 
> :CLEAN:[griffin@joshua:~]  
> 8876 \> pvpython  
> Python 3.9.16 (main, Jul 3 2023, 20:07:32)  
> [GCC 8.5.0 20210514 (Red Hat 8.5.0-18)] on linux  
> Type “help”, “copyright”, “credits” or “license” for more information.  
> \>\>\> I will type ctrl-c at the end of this line  
> Loguru caught a signal: SIGINT  
> Stack trace:  
> 17 0x401ede pvpython() [0x401ede]  
> 16 0x7f0ab3d9bd85 \_\_libc\_start\_main + 229  
> 15 0x402496 pvpython() [0x402496]  
> 14 0x7f0ab14e5951 vtkPythonInterpreter::PyMain(int, char\*\*) + 737  
> 13 0x7f0aafc6e645 /lib64/libpython3.9.so.1.0(+0x11e645) [0x7f0aafc6e645]  
> 12 0x7f0aafc6e463 /lib64/libpython3.9.so.1.0(+0x11e463) [0x7f0aafc6e463]  
> 11 0x7f0aafc6e3c2 PyRun\_InteractiveLoopFlags + 238  
> 10 0x7f0aafc6e14c /lib64/libpython3.9.so.1.0(+0x11e14c) [0x7f0aafc6e14c]  
> 9 0x7f0aafdce444 /lib64/libpython3.9.so.1.0(+0x27e444) [0x7f0aafdce444]  
> 8 0x7f0aafdce29f /lib64/libpython3.9.so.1.0(+0x27e29f) [0x7f0aafdce29f]  
> 7 0x7f0aafd34b0a /lib64/libpython3.9.so.1.0(+0x1e4b0a) [0x7f0aafd34b0a]  
> 6 0x7f0aafd1127f /lib64/libpython3.9.so.1.0(+0x1c127f) [0x7f0aafd1127f]  
> 5 0x7f0aafc8e681 /lib64/libpython3.9.so.1.0(+0x13e681) [0x7f0aafc8e681]  
> 4 0x7f0aafbc1437 /lib64/libpython3.9.so.1.0(+0x71437) [0x7f0aafbc1437]  
> 3 0x7f0aafc2682b PyOS\_Readline + 262  
> 2 0x7f0a79037587 /usr/lib64/python3.9/lib-dynload/readline.cpython-39-x86\_64-linux-gnu.so(+0x3587) [0x7f0a79037587]  
> 1 0x7f0ab3e8767f \_\_select + 95  
> 0 0x7f0ab3dafb50 /lib64/libc.so.6(+0x4eb50) [0x7f0ab3dafb50]  
> ( 5.797s) [paraview] :0 FATL| Signal: SIGINT

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [July 29, 2023, 10:58pm UTC](https://discourse.paraview.org/t/pvpython-crashes-on-ctrl-c/12594/2 "2023-07-29T22:58:41Z")

</div>

Well, that’s not a crash per sé. It is `SIGINT` doing what it’s supposed to. What we’re not doing is catching it and acting on it to do what REPL users expect. Somewhere we should be passing `initsignals=true` as a parameter to set up the default signal handlers. I’m not 100% sure where we might have dropped that.

Cc: @mwestphal @cory.quammen
