[Python-Dev] Trap SIGSEGV and SIGFPE

Victor Stinner victor.stinner at haypocalc.com
Thu Dec 11 15:19:07 CET 2008


Le Thursday 11 December 2008 13:57:03 skip at pobox.com, vous avez écrit :
>     Simon> Some indictation of what Python was executing when the segfault
>     Simon> occurred would help narrow now the possibilities rapidly.
>
> The Python distribution comes with a Misc/gdbinit file

Hum, do you really run *all* programs in gdb? Most of the time, you don't 
expect a crash (because you trust your softwares). You will have to try to 
reproduce the crash, but sometimes it's very hard (eg. Heisenbugs!).

My new proposition is to display the backtrace instead of just the 
message "segmentation fault". It's not a problem if displaying the backtrace 
produces new fault because it's already better than just the 
message "segmentation fault". Even with my SIGSEVG handler, you can still use 
gdb because gdb catchs the signal before the program.

-- 
Victor Stinner aka haypo
http://www.haypocalc.com/blog/


More information about the Python-Dev mailing list