[Python-Dev] Trap SIGSEGV and SIGFPE

Alexander Belopolsky alexander.belopolsky at gmail.com
Thu Dec 11 02:22:23 CET 2008


On Wed, Dec 10, 2008 at 8:01 PM, Adam Olsen <rhamph at gmail.com> wrote:
..
> It is impossible to do in general, and I am -1 on any misguided
> attempts to do so.
>

I agree, recovering from segfaults caused by buggy third party C
modules is a losing proposition, but for a limited number of
conditions that can be triggered from python code running on a
non-buggy interpreter (hopefully ctypes included, but that would be
hard), converting signals into exceptions may be possible.
..
> Printing a stack trace and then aborting would be possible and useful though.
>
Even a simple dialog: Python have encountered a segfault, would you
like to dump core? y/n in the interactive session will be quite
useful.


More information about the Python-Dev mailing list