How to debug a Python segmentation fault?
tl;dr for python3 users.
Firstly, from the docs:
faulthandler is a builtin module since Python 3.3
Code usage:
import faulthandler
faulthandler.enable()
// bad code goes here
Shell usage:
$ python3 -q -X faulthandler
>>> /// bad cod goes here
I got to this question because of the Segmentation fault
, but not on exit, just in general, and I found that nothing else helped as effectively as faulthandler. It's part of Python 3.3, and you can install in 2.7 using pip
.