[issue23285] PEP 475 - EINTR handling

STINNER Victor report at bugs.python.org
Tue Mar 3 02:49:15 CET 2015


STINNER Victor added the comment:

Note: I found the bug while working on a patch for #22181.

My test is this shell script:

$ while true; do ./python -c 'import os, signal; signal.setitimer(signal.ITIMER_REAL, 0.001, 0.0001); signal.signal(signal.SIGALRM, lambda *args: print(".", end="")); print("urandom"); x=os.urandom(5000); print("ok"); signal.alarm(0)'; if [ $? -ne 142 -a $? -ne 0 ]; then break; fi done  

The test calls print() in a signal handler which can likely create a reentrant call, which is forbidden. But Python handles this case, it's fine.

After removing all debug prints and reverting the fix on fileio.c, the test doesn't crash with the assertion error anymore. Before, an assertion failed because fileio_write() returned Py_None with an exception set.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23285>
_______________________________________


More information about the Python-bugs-list mailing list