[XML-SIG] 20 second socket.addrinfo() delay in SimpleXMLRPCServer

"Martin v. Löwis" martin@v.loewis.de
Fri, 03 Jan 2003 16:01:45 +0100


Mark Bucciarelli wrote:
> 3035: handle_request: request received (Version = 2)
> 3035:   GETHOSTBYNAMEv6 (localhost)
> 3035: Haven't found "6c6f:6361:6c68:6f73:7400:0:fa98:153e" in hosts cache!

Can you (or anybody else) explain these messages? It is not surprising 
that it tries an IPv6 lookup for localhost - this is, after all, the 
entire point of using getaddrinfo instead of plain gethostbyname.

I'm surprised that it infers "6c6f:6361:6c68:6f73:7400:0:fa98:153e", 
though? Have you configured IPv6 interfaces for your system? Doing

 >>> s="6c6f63616c686f7374000000fa98153e"
 >>> s.decode("hex")
'localhost\x00\x00\x00\xfa\x98\x15>'

reveals that something is seriously broken in namelookup: It somehow 
tries to interpret the byte string "localhost" (plus whatever data it 
then has in memory) as an IPv6 packed binary address?????

That looks like a bug in the system's C library to me. It could be a bug 
in Python, also, but given that nscd correctly traces the request made 
to it, and given that nobody else has reported problems, I'd infer an 
nscd bug, or a bug in the nscd client code in the C library.

I would use glibcbug to report those nscd trace messages. Perhaps this 
is just a bug in the trace code, which would be harmless.

Regards,
Martin