[issue20601] tracing and tests that raise an exception in a SIGALRM handler

2014-02-14 Thread Xavier de Gaye
Xavier de Gaye added the comment: Hum hum, and now with this last patch PyErr_CheckSignals is called for each traced line even when no signal is pending, which is worse than the previous one as far as performance is concerned. -- ___ Python tracker

[issue20601] tracing and tests that raise an exception in a SIGALRM handler

2014-02-14 Thread Xavier de Gaye
Xavier de Gaye added the comment: With the previous patch, after the signal arrives and the first call to PyErr_CheckSignals, PyErr_CheckSignals is called for each bytecode processed in the eval loop of the tracing function (and the eval loop of functions called by the tracing function, and al

[issue20601] tracing and tests that raise an exception in a SIGALRM handler

2014-02-13 Thread Xavier de Gaye
Changes by Xavier de Gaye : Added file: http://bugs.python.org/file34070/signal_test.py ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue20601] tracing and tests that raise an exception in a SIGALRM handler

2014-02-13 Thread Xavier de Gaye
Xavier de Gaye added the comment: > A signal should not remove the trace function. And a signal should be traced. The attached patch postpones all signals except SIGINT while the trace function is being invoked, and thus the signal is traced after returning from this function. My previous test

[issue20601] tracing and tests that raise an exception in a SIGALRM handler

2014-02-12 Thread STINNER Victor
STINNER Victor added the comment: > Therefore, tests that raise an exception in an alarm handler should use the > support.no_tracing decorator as it is done in test_io.py at > check_reentrant_write(). I would prefer to fix the issue instead. A signal should not remove the trace function. ---

[issue20601] tracing and tests that raise an exception in a SIGALRM handler

2014-02-12 Thread Xavier de Gaye
Xavier de Gaye added the comment: The following code shows that the trace function is removed when an alarm raises an exception and prints: 'trace function: None' import sys, signal, time def trace(frame, event, arg): if frame.f_code.co_name == 'foo': while 1: time.slee

[issue20601] tracing and tests that raise an exception in a SIGALRM handler

2014-02-11 Thread Xavier de Gaye
New submission from Xavier de Gaye: After an alarm handler raises an exception while a tracing function is being invoked and when this exception is not caught by the tracing function, the call_trampoline() function in sysmodule.c returns NULL and its caller, trace_trampoline(), removes the tra