On 12/18/2010 8:50 AM, James Y Knight wrote: > I think instead of calling abort() to kill the process, you should: > - install the signal handler with SA_NODEFER|SA_RESETHAND (or if > sigaction is not present, explicitly reset the action to SIG_DFL and > unblock first thing upon entering the handler), and then, > - at the end of the handler, kill(getpid(), orig_signal) in order to > abort the process.
I concur with this being the correct way to right such a handler. > This has two advantages: 1) the process's exit code will actually > show the correct signal, It's more than an advantage: it's the only correct way to handle a termination signal. > 2) it might let the OS fault handlers work properly > as well -- I'm not sure. If it does, you may want to experiment with > whether having or omitting SA_NODEFER gives a better backtrace (from the > OS mechanism) in that case. Even if that doesn't work, things like the grsecurity patches to linux use these signals to detect exploits and log them and do throttling. Calling abort() effectively converts all of these faults into SIGABRT terminations that are considered (more?) innocent terminations. -- Scott Dial sc...@scottdial.com scod...@cs.indiana.edu -- Scott Dial sc...@scottdial.com scod...@cs.indiana.edu _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com