Re: [Python-Dev] Real segmentation fault handler

2008-10-03 Thread Gregory P. Smith
On Thu, Oct 2, 2008 at 10:54 AM, Thomas Heller <[EMAIL PROTECTED]> wrote: > Victor Stinner schrieb: >> Hi, >> >> I would like to be able to catch SIGSEGV in my Python code! So I started to >> hack Python trunk to support this feature. The idea is to use a signal >> handler which call longjmp(), and

Re: [Python-Dev] Real segmentation fault handler

2008-10-02 Thread Thomas Heller
Victor Stinner schrieb: > Hi, > > I would like to be able to catch SIGSEGV in my Python code! So I started to > hack Python trunk to support this feature. The idea is to use a signal > handler which call longjmp(), and add setjmp() at Py_EvalFrameEx() enter. On windows, ctypes catches fatal err

Re: [Python-Dev] Real segmentation fault handler

2008-09-29 Thread Ralf W. Grosse-Kunstleve
FWIW: I didn't have much luck translating segfaults into exceptions. It (seemed) to work on some platforms, but not others; this was in the context of C++. In my experience, it is more useful to generate Python and C stack traces and bail out. I also do this for floating-point exceptions. The han