Martin Pool <m...@sourcefrog.net> added the comment: On 31 August 2011 07:56, STINNER Victor <rep...@bugs.python.org> wrote: > > STINNER Victor <victor.stin...@haypocalc.com> added the comment: > >> def handler(signal, stackframe): >> print "OUCH" >> stdout.flush() >> _exit(1) > > What do you want to do on a SIGSEGV? On a real fault, you cannot rely on > Python internal state, you cannot use any Python object. To handle a real > SIGSEGV fault, you have to implement a signal handler using only *signal > safe* functions.... in C.
Well, strictly speaking, it is very hard or impossible to write C code that's guaranteed to be safe after an unexpected segv too; who knows what might have caused it. The odds are probably better that it will work in in C than in Python. At any rate I think it's agreed that the original code is not supported and it's just the docs that need to change. So what do you think of <http://bugs.python.org/file22989/20110822-1525-signal-doc.diff> ? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue1215> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com