[Python-checkins] cpython (3.3): Closes #1215: document better why it is not a good idea to catch e.g. SIGSEGV

georg.brandl python-checkins at python.org
Sun Oct 6 21:22:43 CEST 2013


http://hg.python.org/cpython/rev/b4444d16e333
changeset:   86136:b4444d16e333
branch:      3.3
parent:      86134:8410d2441e0f
user:        Georg Brandl <georg at python.org>
date:        Sun Oct 06 21:22:42 2013 +0200
summary:
  Closes #1215: document better why it is not a good idea to catch e.g. SIGSEGV and refer to faulthandler.

Patch by Martin Pool.

files:
  Doc/library/signal.rst |  6 +++++-
  Misc/ACKS              |  1 +
  2 files changed, 6 insertions(+), 1 deletions(-)


diff --git a/Doc/library/signal.rst b/Doc/library/signal.rst
--- a/Doc/library/signal.rst
+++ b/Doc/library/signal.rst
@@ -36,7 +36,11 @@
 This has consequences:
 
 * It makes little sense to catch synchronous errors like :const:`SIGFPE` or
-  :const:`SIGSEGV`.
+  :const:`SIGSEGV` that are caused by an invalid operation in C code.  Python
+  will return from the signal handler to the C code, which is likely to raise
+  the same signal again, causing Python to apparently hang.  From Python 3.3
+  onwards, you can use the :mod:`faulthandler` module to report on synchronous
+  errors.
 
 * A long-running calculation implemented purely in C (such as regular
   expression matching on a large body of text) may run uninterrupted for an
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -974,6 +974,7 @@
 Remi Pointel
 Guilherme Polo
 Michael Pomraning
+Martin Pool
 Iustin Pop
 Claudiu Popa
 John Popplewell

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list