Skip to content

Commit c377fe2

Browse files
committed
Closes #1215: document better why it is not a good idea to catch e.g. SIGSEGV and refer to faulthandler.
Patch by Martin Pool.
1 parent a072de1 commit c377fe2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Doc/library/signal.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ at a later point(for example at the next :term:`bytecode` instruction).
3636
This has consequences:
3737

3838
* It makes little sense to catch synchronous errors like :const:`SIGFPE` or
39-
:const:`SIGSEGV`.
39+
:const:`SIGSEGV` that are caused by an invalid operation in C code. Python
40+
will return from the signal handler to the C code, which is likely to raise
41+
the same signal again, causing Python to apparently hang. From Python 3.3
42+
onwards, you can use the :mod:`faulthandler` module to report on synchronous
43+
errors.
4044

4145
* A long-running calculation implemented purely in C (such as regular
4246
expression matching on a large body of text) may run uninterrupted for an

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,7 @@ Oleg Plakhotnyuk
974974
Remi Pointel
975975
Guilherme Polo
976976
Michael Pomraning
977+
Martin Pool
977978
Iustin Pop
978979
Claudiu Popa
979980
John Popplewell

0 commit comments

Comments
 (0)