import faulthandler faulthandler.enable() def killme(): # Taken from http://nbviewer.ipython.org/github/ipython/ipython/blob/1.x/examples/notebooks/Part%201%20-%20Running%20Code.ipynb import sys from ctypes import CDLL # This will crash a Linux or Mac system; equivalent calls can be made on # Windows dll = 'dylib' if sys.platform == 'darwin' else 'so.6' libc = CDLL("libc.%s" % dll) libc.time(-1) # BOOM!! killme()