summaryrefslogtreecommitdiffstats
path: root/Doc/library/faulthandler.rst
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-07 10:43:00 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-07 10:43:00 (GMT)
commit7bba62fd68e3a2c410c37348cf679edea04c7718 (patch)
tree41614a5367bd7c7586df0eb3f53e3c7db7b3f362 /Doc/library/faulthandler.rst
parentc925617b5455867b7b393c6ca66f133aab450a6b (diff)
downloadcpython-7bba62fd68e3a2c410c37348cf679edea04c7718.zip
cpython-7bba62fd68e3a2c410c37348cf679edea04c7718.tar.gz
cpython-7bba62fd68e3a2c410c37348cf679edea04c7718.tar.bz2
faulthandler: dump all threads by default
* Set the default value of all_threads arguments to True * Py_FatalError() dumps all threads, instead of only the current thread Dump only the current thread is not reliable. In some cases, Python is unable to retrieve the state of the current thread and so is unable to dump the traceback. faulthandler keeps a reference to the interpreter and so is always able to dump the traceback of all threads.
Diffstat (limited to 'Doc/library/faulthandler.rst')
-rw-r--r--Doc/library/faulthandler.rst21
1 files changed, 11 insertions, 10 deletions
diff --git a/Doc/library/faulthandler.rst b/Doc/library/faulthandler.rst
index c0b6625..0c00f8f 100644
--- a/Doc/library/faulthandler.rst
+++ b/Doc/library/faulthandler.rst
@@ -36,21 +36,22 @@ when Python is blocked (e.g. deadlock).
Dump the traceback
------------------
-.. function:: dump_traceback(file=sys.stderr, all_threads=False)
+.. function:: dump_traceback(file=sys.stderr, all_threads=True)
- Dump the traceback of the current thread, or of all threads if *all_threads*
- is ``True``, into *file*.
+ Dump the traceback of all threads, or of the current thread if *all_threads*
+ is ``False``, into *file*.
Fault handler state
-------------------
-.. function:: enable(file=sys.stderr, all_threads=False)
+.. function:: enable(file=sys.stderr, all_threads=True)
Enable the fault handler: install handlers for :const:`SIGSEGV`,
:const:`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS` and :const:`SIGILL`
- signals to dump the Python traceback. It dumps the traceback of the current
- thread, or all threads if *all_threads* is ``True``, into *file*.
+ signals to dump the Python traceback. It dumps the traceback of the all
+ threads, or of the current thread if *all_threads* is ``False``, into
+ *file*.
.. function:: disable()
@@ -86,11 +87,11 @@ Dump the tracebacks after a timeout
Dump the traceback on a user signal
-----------------------------------
-.. function:: register(signum, file=sys.stderr, all_threads=False)
+.. function:: register(signum, file=sys.stderr, all_threads=True)
Register a user signal: install a handler for the *signum* signal to dump
- the traceback of the current thread, or of all threads if *all_threads* is
- ``True``, into *file*.
+ the traceback of all threads, or of the current thread if *all_threads* is
+ ``False``, into *file*.
Not available on Windows.
@@ -123,7 +124,7 @@ Example of a segmentation fault on Linux: ::
>>> ctypes.string_at(0)
Fatal Python error: Segmentation fault
- Traceback (most recent call first):
+ Current thread 0x00007fb899f39700:
File "/home/python/cpython/Lib/ctypes/__init__.py", line 486 in string_at
File "<stdin>", line 1 in <module>
Segmentation fault