summaryrefslogtreecommitdiffstats
path: root/Modules/faulthandler.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-30557: faulthandler now correctly filters and displays exception codes ↵Steve Dower2017-06-051-4/+4
| | | | | | | | | | on Windows (#1924) * bpo-30557: faulthandler now correctly filters and displays exception codes on Windows * Adds test for non-fatal exceptions. * Adds bpo number to comment.
* bpo-30125: Fix faulthandler.disable() on Windows (#1240)Victor Stinner2017-04-211-24/+19
| | | | | | | | | | | | * bpo-30125: Cleanup faulthandler.c * Use size_t type for iterators * Add { ... } * bpo-30125: Fix faulthandler.disable() on Windows On Windows, faulthandler.disable() now removes the exception handler installed by faulthandler.enable().
* faulthandler: Restore the old sigaltstack during teardown (#777)Christophe Zeitouny2017-03-231-1/+16
|
* bpo-6532: Make the thread id an unsigned integer. (#781)Serhiy Storchaka2017-03-231-1/+1
| | | | | | | | | | | * bpo-6532: Make the thread id an unsigned integer. From C API side the type of results of PyThread_start_new_thread() and PyThread_get_thread_ident(), the id parameter of PyThreadState_SetAsyncExc(), and the thread_id field of PyThreadState changed from "long" to "unsigned long". * Restore a check in thread_get_ident().
* Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-4/+2
| | | | possible. Patch is writen with Coccinelle.
* Issue #28152: Fix -Wunreachable-code warnings on ClangVictor Stinner2016-12-051-0/+9
| | | | Don't declare dead code when the code is declared with Clang.
* Issue #23524: Finish removing _PyVerify_fd from sourcesSteve Dower2016-09-081-1/+1
|
* replace Py_(u)intptr_t with the c99 standard typesBenjamin Peterson2016-09-061-5/+5
|
* Avoid calling functions with an empty string as format stringVictor Stinner2016-09-061-3/+3
| | | | Directly pass NULL rather than an empty string.
* - make some internal symbols staticdoko@ubuntu.com2016-05-171-1/+1
|
* Issue #26778: Fixed "a/an/and" typos in code comment, documentation and errorSerhiy Storchaka2016-04-171-1/+1
|\ | | | | | | messages.
| * Issue #26778: Fixed "a/an/and" typos in code comment and documentation.Serhiy Storchaka2016-04-171-1/+1
| |
* | Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-061-3/+3
|\ \ | |/
| * Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-061-3/+3
| |
* | Issue #23848: Fix usage of _Py_DumpDecimal()Victor Stinner2016-03-231-1/+1
| |
* | Issue #23848: Try to fix test_faulthandler on ARMVictor Stinner2016-03-231-32/+16
| | | | | | | | Restore the previous code for stack_overflow().
* | faulthandler: only log fatal exceptionsVictor Stinner2016-03-231-3/+10
| | | | | | | | | | | | | | | | Issue #23848, #26622: * faulthandler now only logs fatal Windows exceptions. * write error code as decimal, not as hexadecimal * replace "Windows exception" with "Windows fatal exception"
* | faulthandler: add Windows exception handlerVictor Stinner2016-03-231-64/+189
| | | | | | | | | | | | Issue #23848: On Windows, faulthandler.enable() now also installs an exception handler to dump the traceback of all Python threads on any Windows exception, not only on UNIX signals (SIGSEGV, SIGFPE, SIGABRT).
* | faulthandler now works in non-Python threadsVictor Stinner2016-03-161-11/+57
|/ | | | | | | | | | | Issue #26563: * Add _PyGILState_GetInterpreterStateUnsafe() function: the single PyInterpreterState used by this process' GILState implementation. * Enhance _Py_DumpTracebackThreads() to retrieve the interpreter state from autoInterpreterState in last resort. The function now accepts NULL for interp and current_tstate parameters. * test_faulthandler: fix a ResourceWarning when test is interrupted by CTRL+c
* faulthandler: Test Py_FatalError() with GIL releasedVictor Stinner2016-03-151-2/+10
| | | | Issue #26558.
* Add _PyThreadState_UncheckedGet()Victor Stinner2016-01-201-1/+1
| | | | | | | | | | | | | | | | | | | Issue #26154: Add a new private _PyThreadState_UncheckedGet() function which gets the current thread state, but don't call Py_FatalError() if it is NULL. Python 3.5.1 removed the _PyThreadState_Current symbol from the Python C API to no more expose complex and private atomic types. Atomic types depends on the compiler or can even depend on compiler options. The new function _PyThreadState_UncheckedGet() allows to get the variable value without having to care of the exact implementation of atomic types. Changes: * Replace direct usage of the _PyThreadState_Current variable with a call to _PyThreadState_UncheckedGet(). * In pystate.c, replace direct usage of the _PyThreadState_Current variable with the PyThreadState_GET() macro for readability. * Document also PyThreadState_Get() in pystate.h
* Issue #20440: Massive replacing unsafe attribute setting code with specialSerhiy Storchaka2015-12-241-6/+3
| | | | macro Py_SETREF.
* Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(),Serhiy Storchaka2015-05-301-2/+2
|\ | | | | | | | | PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains() to check for and handle errors correctly.
| * Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(),Serhiy Storchaka2015-05-301-2/+2
| | | | | | | | | | PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains() to check for and handle errors correctly.
* | Issue #23836: Fix the faulthandler module to handle reentrant callsVictor Stinner2015-04-011-40/+45
| | | | | | | | | | | | | | | | | | | | to its signal handlers. Use also _Py_write_noraise() instead of write() to retry write() if it is interrupted by a signal (fail with EINTR). faulthandler.dump_traceback() also calls PyErr_CheckSignals() to call the Python signal handler if a signal was received.
* | Merge 3.4 (faulthandler ICC)Victor Stinner2015-03-231-1/+8
|\ \ | |/
| * Issue #23654: Fix faulthandler._stack_overflow() for the Intel C Compiler (ICC)Victor Stinner2015-03-231-1/+8
| | | | | | | | | | | | | | Issue #23654: Turn off ICC's tail call optimization for the stack_overflow generator. ICC turns the recursive tail call into a loop. Patch written by Matt Frank.
* | Issue #23566: enable(), register(), dump_traceback() and dump_traceback_later()Victor Stinner2015-03-121-21/+35
| | | | | | | | functions of faulthandler now accept file descriptors. Patch by Wei Wu.
* | Fixed few compiler warnings.Serhiy Storchaka2015-02-161-1/+1
| |
* | Merge 3.4 (faulthandler)Victor Stinner2015-02-111-4/+5
|\ \ | |/
| * Issue #23433: Fix faulthandler._stack_overflow()Victor Stinner2015-02-111-4/+5
| | | | | | | | | | Fix undefined behaviour: don't compare pointers. Use Py_uintptr_t type instead of void*. It fixes test_faulthandler on Fedora 22 which now uses GCC 5.
* | (Merge 3.4) faulthandler: test_gil_released() now uses _sigsegv() instead ofVictor Stinner2014-09-301-15/+23
|\ \ | |/ | | | | | | | | | | _read_null(), because _read_null() cannot be used on AIX. On AIX, reading from NULL is allowed: the first page of memory is a mapped read-only on AIX. _read_null() and _sigabrt() don't accept parameters.
| * faulthandler: test_gil_released() now uses _sigsegv() instead of _read_null(),Victor Stinner2014-09-301-15/+23
| | | | | | | | | | because _read_null() cannot be used on AIX. On AIX, reading from NULL is allowed: the first page of memory is a mapped read-only on AIX.
| * faulthandler: _sigsegv() and _sigabrt() don't accept parametersVictor Stinner2014-09-301-2/+2
| |
* | faulthandler: suppress crash reporter directly in test functions written toVictor Stinner2014-09-301-6/+41
| | | | | | | | crash.
* | Issue #22018: Add _testcapi.raise_signal()Victor Stinner2014-07-211-26/+0
|/ | | | | | | | - Use _testcapi.raise_signal() in test_signal - close also os.pipe() file descriptors in some test_signal tests where they were not closed properly - Remove faulthandler._sigill() and faulthandler._sigbus(): reuse _testcapi.raise_signal() in test_faulthandler
* Issue #21497: faulthandler functions now raise a better error if sys.stderr isVictor Stinner2014-05-141-0/+4
| | | | | None: RuntimeError("sys.stderr is None") instead of AttributeError("'NoneType' object has no attribute 'fileno'").
* Merge: #19970: Fix some comment typos.R David Murray2013-12-141-1/+1
|\
| * #19970: Fix some comment typos.R David Murray2013-12-141-1/+1
| | | | | | | | Report and patch by Vajrasky Kok.
* | Issue #19512, #19515: remove shared identifiers, move identifiers where theyVictor Stinner2013-11-071-4/+6
| | | | | | | | | | | | | | are used. Move also _Py_IDENTIFIER() defintions to the top in modified files to remove identifiers duplicated in the same file.
* | Issue #19512: add some common identifiers to only create common strings once,Victor Stinner2013-11-061-1/+1
| | | | | | | | | | | | | | instead of creating temporary Unicode string objects Add also more identifiers in pythonrun.c to avoid temporary Unicode string objets for the interactive interpreter.
* | Close #18957: The PYTHONFAULTHANDLER environment variable now only enables theVictor Stinner2013-09-081-1/+4
| | | | | | | | | | faulthandler module if the variable is non-empty. Same behaviour than other variables like PYTHONDONTWRITEBYTECODE.
* | Issue #18203: Add _PyMem_RawStrdup() and _PyMem_Strdup()Victor Stinner2013-07-071-5/+6
| | | | | | | | | | Replace strdup() with _PyMem_RawStrdup() or _PyMem_Strdup(), depending if the GIL is held or not.
* | (Merge 3.3) Issue #18343: faulthandler.register() now keeps the previous signalVictor Stinner2013-07-011-1/+2
|\ \ | |/ | | | | | | handler when the function is called twice, so faulthandler.unregister() restores correctly the original signal handler.
| * Issue #18343: faulthandler.register() now keeps the previous signal handlerVictor Stinner2013-07-011-1/+2
| | | | | | | | | | when the function is called twice, so faulthandler.unregister() restores correctly the original signal handler.
* | Issue #9566: Explicit downcast to fix compiler warnings on Win64Victor Stinner2012-10-301-2/+4
| |
* | #16135: Removal of OS/2 support (Modules/*)Jesus Cea2012-10-051-3/+0
|/
* Closes #15969: rename new API to have consistent names in the faulthandler ↵Georg Brandl2012-09-221-14/+14
| | | | module.
* faulthandler: fix the handler of user signalsVictor Stinner2012-08-091-1/+6
| | | | Restore the errno before calling the previous signal handler, and not after.
* Fix the user signal handler of faulthandlerVictor Stinner2012-08-011-3/+2
| | | | | Don't exit the tstate is NULL to restore the errno and chain the signal handler if needed.