[issue1755388] Problem with socket.gethostbyaddr() and KeyboardInterrupt

STINNER Victor report at bugs.python.org
Tue Sep 9 14:02:55 CEST 2008


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

Using gdb, I dig the problem:
 * when CTRL+c is pressed, signal_handler (sig_num=2) 
at ./Modules/signalmodule.c:175 is called
 * signal_handler() stores the signal has a "pending call"
 * Linux kernel interrupts its name resolution (it looks like it's the 
read() syscall?) and return the error ETIMEDOUT (110)
 * back to socket_gethostbyaddr(): result=110, h=NULL
 * gethost_common() set an error using set_herror(1)
 * socket_gethostbyaddr() return NULL

Later, Py_MakePendingCalls() will call signal_default_int_handler() 
which raises the KeyboardInterrupt.

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


More information about the Python-bugs-list mailing list