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 <[email protected]>
<http://bugs.python.org/issue23285>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com