Ralf Schmitt added the comment: If you replace your call segfault.segfault() with os.kill(os.getpid(), signal.SIGSEGV) everything works as expected. The problem is that the signal is just caught in the c handler (and a flag is set) and then the program continues with the offending *c = 'a'; statement, which again ends with a SIGSEGV and the handler being called. The documentation explicitly states "Because the C signal handler always returns, it makes little sense to catch synchronous errors like SIGFPE or SIGSEGV." I think raising that InvalidArgument exception is most probably the right thing to do (or at least printing a warning). Those that really want to handle SIGSEGV should do it from C anyway.
---------- nosy: +schmir __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1215> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com