How to commit suicide with a SIGSEGV?

Fredrik Lundh fredrik at pythonware.com
Fri Jan 21 10:11:41 EST 2000


Ralf Hildebrandt <hildeb at www.stahl.bau.tu-bs.de> wrote:
> I need the python interpreter to "commit suicide" with a special signal. 
> How do I get the pid of the interpreter to be able to use s.th. like
> 
> os.kill(mypid, signal.SIGSEGV)

>>> import os, signal
>>> os.kill(os.getpid(), signal.SIGSEGV)
Segmentation fault (core dumped)

</F>





More information about the Python-list mailing list