Possible SOCK_DGRAM bug?

John Hayward-Warburton (linux@billabong.demon.co.uk)
Wed, 17 Feb 1999 06:55:57 +0000 (GMT)


Hi.

Is there a problem with the protocol surrounding 'connections' of
type SOCK_DGRAM and the behaviour of select()?

I'm talking with hardly any experience of low-level TCP debugging,
but believe you should see this: a problem, and my (probably faulty)
interpretation of it.

My nameserver is set to 192.168.7.1 (which is running when I'm
connected to my ISP, otherwise not). The resolver routines open a
SOCK_DGRAM type connection, then make eight attempts to query the
nameserver. If the nameserver is NOT running (when the connection to
the outside world is down), the SOCK_DGRAM connection normally
opens, accepts data, doesn't 'hang' on the select() that follows,
but should send ECONNREFUSED at the attempt to read from the socket.

Unfortunately, on the 7th of the 8 attempts, the select() hangs for
its full duration (20 seconds in this case), times out, and slows
everyone down.

It happens on all three machines here running 2.2.1 on programs
using both glibc and libc5. It does NOT happen on 2.0.34 using
glibc.

Is this normal? Here's the strace of the offending section... three
probes: ones that work either side of the one that times out.

Good luck with it, and thanks.

Yours,

John Hayward-Warburton
linux@billabong.demon.co.uk
http://i.am/computing

socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 5
connect(5, {sin_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.7.1")}, 16) = 0
send(5, "\v\"\1\0\0\1\0\0\0\0\0\0\3dra\3com\5demon\2co\2uk\0\0\1\0\1", 37, 0) = 37
select(6, [5], NULL, NULL, {10, 0}) = 1 (in [5], left {10, 0})
recvfrom(5, 0xbffff708, 1024, 0, 0xbfffe8a8, 0xbfffe81c) = -1 ECONNREFUSED (Connection refused)
close(5) = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 5
connect(5, {sin_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.7.1")}, 16) = 0
send(5, "\v\"\1\0\0\1\0\0\0\0\0\0\3dra\3com\5demon\2co\2uk\0\0\1\0\1", 37, 0) = 37
select(6, [5], NULL, NULL, {20, 0}) = 0 (Timeout)
close(5) = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 5
connect(5, {sin_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.7.1")}, 16) = 0
send(5, "\v\"\1\0\0\1\0\0\0\0\0\0\3dra\3com\5demon\2co\2uk\0\0\1\0\1", 37, 0) = 37
select(6, [5], NULL, NULL, {40, 0}) = 1 (in [5], left {40, 0})
recvfrom(5, 0xbffff708, 1024, 0, 0xbfffe8a8, 0xbfffe81c) = -1 ECONNREFUSED (Connection refused)
close(5) = 0
write(2, "ping: unknown host dra.com\n", 27) = 27
_exit(2) = ?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/