Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4df22034
Commit
4df22034
authored
Mar 25, 2014
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #12209: Minor edits to faulthandler doc. Patch written by Éric Araujo.
parent
a1b5f026
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
Doc/library/faulthandler.rst
Doc/library/faulthandler.rst
+17
-11
No files found.
Doc/library/faulthandler.rst
View file @
4df22034
...
...
@@ -11,7 +11,7 @@ after a timeout, or on a user signal. Call :func:`faulthandler.enable` to
install fault handlers for the :const:`SIGSEGV`, :const:`SIGFPE`,
:const:`SIGABRT`, :const:`SIGBUS`, and :const:`SIGILL` signals. You can also
enable them at startup by setting the :envvar:`PYTHONFAULTHANDLER` environment
variable or by using :option:`-X` ``faulthandler`` command line option.
variable or by using
the
:option:`-X` ``faulthandler`` command line option.
The fault handler is compatible with system fault handlers like Apport or the
Windows fault handler. The module uses an alternative stack for signal handlers
...
...
@@ -39,8 +39,8 @@ The module is implemented in C, so tracebacks can be dumped on a crash or when
Python is deadlocked.
Dump the traceback
------------------
Dump
ing
the traceback
------------------
---
.. function:: dump_traceback(file=sys.stderr, all_threads=True)
...
...
@@ -69,8 +69,8 @@ Fault handler state
Check if the fault handler is enabled.
Dump the tracebacks after a timeout
-----------------------------------
Dump
ing
the tracebacks after a timeout
-----------------------------------
---
.. function:: dump_traceback_later(timeout, repeat=False, file=sys.stderr, exit=False)
...
...
@@ -90,8 +90,8 @@ Dump the tracebacks after a timeout
Cancel the last call to :func:`dump_traceback_later`.
Dump the traceback on a user signal
-----------------------------------
Dump
ing
the traceback on a user signal
-----------------------------------
---
.. function:: register(signum, file=sys.stderr, all_threads=True, chain=False)
...
...
@@ -110,8 +110,8 @@ Dump the traceback on a user signal
Not available on Windows.
File descriptor issue
---------------------
Issue with file descriptors
---------------------
------
:func:`enable`, :func:`dump_traceback_later` and :func:`register` keep the
file descriptor of their *file* argument. If the file is closed and its file
...
...
@@ -123,9 +123,15 @@ these functions again each time that the file is replaced.
Example
-------
Example of a segmentation fault on Linux: ::
.. highlight:: sh
Example of a segmentation fault on Linux with and without enabling the fault
handler::
$ python3 -c "import ctypes; ctypes.string_at(0)"
Segmentation fault
$ python -q -X faulthandler
$ python
3
-q -X faulthandler
>>> import ctypes
>>> ctypes.string_at(0)
Fatal Python error: Segmentation fault
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment