summaryrefslogtreecommitdiffstats
path: root/Modules/faulthandler.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* 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.
* Issue #14154: Reimplement the bigmem test memory watchdog as a subprocess.Charles-François Natali2012-03-241-184/+0
|
* Issue #13874: read_null() of faulthandler uses volatile to avoid optimisationVictor Stinner2012-01-291-1/+4
| | | | Clang 3.0 removes "y = *x;" instruction if the optimisation level is 3.
* Fix _PyFaulthandler_Fini() so it can be called before _PyFaulthandler_Init()Victor Stinner2012-01-101-2/+2
|
* Rename _Py_identifier to _Py_IDENTIFIER.Martin v. Löwis2011-10-141-3/+3
|
* Add API for static strings, primarily good for identifiers.Martin v. Löwis2011-10-091-3/+6
| | | | Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
* Fix compilation error under WindowsAntoine Pitrou2011-10-041-1/+2
|
* Use the faulthandler module's infrastructure to write a GIL-lessAntoine Pitrou2011-10-041-0/+183
| | | | memory watchdog for timely stats collection.
* Use the new Py_ARRAY_LENGTH macroVictor Stinner2011-09-281-1/+1
|
* Issue #12929: faulthandler now uses char* for arithmetic on pointersVictor Stinner2011-09-071-1/+1
| | | | instead of void*
* Issue #12550: Add chain optional argument to faulthandler.register()Victor Stinner2011-07-131-32/+60
| | | | Call the previous signal handler if chain is True.
* faulthandler: add missing include, pthread.h, for FreeBSD 6Victor Stinner2011-06-291-0/+4
|
* Remove useless assignmentsVictor Stinner2011-05-261-5/+4
| | | | Warnings found by the the Clang Static Analyzer.
* Close #12153: faulthandler, mark stack_overflow() as staticVictor Stinner2011-05-231-1/+1
|
* Issue #12058: Minor edits to comments in faulthandlerVictor Stinner2011-05-111-18/+18
| | | | Patch written by Éric Araujo.
* faulthandler: improve_sigabrt() on Visual StudioVictor Stinner2011-05-091-7/+5
| | | | | Use _set_abort_behavior() + abort() instead of raise(SIGABRT) which may write an error message and/or open a popup asking to report the fault.
* faulthandler: make quiet a gcc 4.6 warning (z was unused)Victor Stinner2011-05-091-2/+5
|
* faulthandler: dump all threads by defaultVictor Stinner2011-05-071-6/+6
| | | | | | | | | | * 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.
* faulthandler: save/restore errno in the two signal handlersVictor Stinner2011-05-071-0/+4
|
* faulthandler: don't use sigprocmask()Victor Stinner2011-04-191-5/+1
| | | | | It has an undefined behaviour with threads, only use pthread_sigmask() if it is available (and not broken).
* Improve faulthandler.enable(all_threads=True)Victor Stinner2011-04-081-22/+32
| | | | | | | faulthandler.enable(all_threads=True) dumps the tracebacks even if it is not possible to get the state of the current thread Create also the get_thread_state() subfunction to factorize the code.
* faulthandler: dump_tracebacks_later() displays also the timeoutVictor Stinner2011-04-081-3/+49
|
* faulthandler: fix variable name, timeout_ms => timeout_usVictor Stinner2011-04-081-6/+6
| | | | The comment was already correct.
* faulthandler: one more time, fix usage of locks in the watchdog threadVictor Stinner2011-04-081-29/+28
| | | | | | | | | | | * Write a new test to ensure that dump_tracebacks_later() still works if it was already called and then cancelled before * Don't use a variable to check the status of the thread, only rely on locks * The thread only releases cancel_event if it was able to acquire it (if the timer was interrupted) * The main thread always hold this lock. It is only released when faulthandler_thread() is interrupted until this thread exits, or at Python exit.
* faulthandler: fix unregister() if it is called before register()Victor Stinner2011-04-081-0/+3
| | | | Fix a crash: don't read from NULL.
* faulthandler: fix compilating without threadsVictor Stinner2011-04-071-0/+8
|
* faulthandler: we don't use (or need) SA_SIGINFO flag of sigaction()Victor Stinner2011-04-071-7/+2
|
* faulthandler: check PyThreadState_Get() result in dump_tracebacks_later()Victor Stinner2011-04-071-12/+21
| | | | Cleanup also the code
* Issue #11753: faulthandler thread uses pthread_sigmask()Victor Stinner2011-04-041-0/+11
| | | | | | | | | | | | The thread must not receive any signal. If the thread receives a signal, sem_timedwait() is interrupted and returns EINTR, but in this case, PyThread_acquire_lock_timed() retries sem_timedwait() and the main thread is not aware of the signal. The problem is that some tests expect that the main thread receives the signal, not faulthandler handler, which should be invisible. On Linux, the signal looks to be received by the main thread, whereas on FreeBSD, it can be any thread.
* Issue #11393: signal of user signal displays tracebacks even if tstate==NULLVictor Stinner2011-04-011-21/+37
| | | | | | | * faulthandler_user() displays the tracebacks of all threads even if it is unable to get the state of the current thread * test_faulthandler: only release the GIL in test_gil_released() check * create check_signum() subfunction
* Issue #11393: Fix faulthandler.disable() and add a testVictor Stinner2011-04-011-4/+4
|
* Issue #11393: The fault handler handles also SIGABRTVictor Stinner2011-04-011-8/+25
|
* Issue #11393: fault handler uses raise(signum) for SIGILL on WindowsVictor Stinner2011-04-011-15/+12
|
* Issue #11393: fix usage of locks in faulthandlerVictor Stinner2011-04-011-3/+4
| | | | | | | | * faulthandler_cancel_dump_tracebacks_later() is responsible to set running to zero (so we don't need the volatile keyword anymore) * release locks if PyThread_start_new_thread() fails assert(thread.running == 0) was wrong in a corner case
* Issue #11393: New try to fix faulthandler_thread()Victor Stinner2011-04-011-6/+6
| | | | | | | Always release the cancel join. Fix also another corner case: _PyFaulthandler_Fini() called after setting running variable to zero, but before releasing the join lock.
* Issue #11393: Fix faulthandler_thread(): release cancel lock before join lockVictor Stinner2011-04-011-1/+1
| | | | | | | | | | If the thread releases the join lock before the cancel lock, the thread may sometimes still be alive at cancel_dump_tracebacks_later() exit. So the cancel lock may be destroyed while the thread is still alive, whereas the thread will try to release the cancel lock, which just crash. Another minor fix: the thread doesn't release the cancel lock if it didn't acquire it.
* Issue #11393: limit stack overflow test to 100 MBVictor Stinner2011-03-311-5/+32
| | | | Stop if the stack overflow doesn't occur after allocating 100 MB on the stack.
* Issue #11393: Fix the documentation (cancel_dump_traceback_later)Victor Stinner2011-03-311-6/+6
| | | | | * dump_traceback_later() => dump_tracebacks_later() * cancel_dump_traceback_later() => cancel_dump_tracebacks_later()
* Issue #11393: Add the new faulthandler moduleVictor Stinner2011-03-301-0/+971