| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
when the function is called twice, so faulthandler.unregister() restores
correctly the original signal handler.
|
|
|
|
| |
module.
|
|
|
|
| |
Restore the errno before calling the previous signal handler, and not after.
|
|
|
|
|
| |
Don't exit the tstate is NULL to restore the errno and chain the signal handler
if needed.
|
| |
|
|
|
|
| |
Clang 3.0 removes "y = *x;" instruction if the optimisation level is 3.
|
| |
|
| |
|
|
|
|
| |
Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
|
| |
|
|
|
|
| |
memory watchdog for timely stats collection.
|
| |
|
|
|
|
| |
instead of void*
|
|
|
|
| |
Call the previous signal handler if chain is True.
|
| |
|
|
|
|
| |
Warnings found by the the Clang Static Analyzer.
|
| |
|
|
|
|
| |
Patch written by Éric Araujo.
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
| |
It has an undefined behaviour with threads, only use pthread_sigmask() if
it is available (and not broken).
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
The comment was already correct.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
Fix a crash: don't read from NULL.
|
| |
|
| |
|
|
|
|
| |
Cleanup also the code
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
* 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
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Stop if the stack overflow doesn't occur after allocating 100 MB on the stack.
|
|
|
|
|
| |
* dump_traceback_later() => dump_tracebacks_later()
* cancel_dump_traceback_later() => cancel_dump_tracebacks_later()
|
|
|