kern/62524: SIGALRM is not delivered when res_send() hangs waiting
in kevent()
Jukka A. Ukkonen
jau at iki.fi
Sun Feb 8 03:30:21 PST 2004
>Number: 62524
>Category: kern
>Synopsis: SIGALRM is not delivered when res_send() hangs waiting in kevent()
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Feb 08 03:30:20 PST 2004
>Closed-Date:
>Last-Modified:
>Originator: Jukka A. Ukkonen
>Release: 4.9-STABLE
>Organization:
>Environment:
FreeBSD mjolnir 4.9-STABLE FreeBSD 4.9-STABLE #0: Sun Jan 25 10:05:58 EET 2004 jau at mjolnir.XXXXXXXXXXX:/usr/src/sys/compile/Mjolnir i386
>Description:
When an interval timer should trigger a SIGALRM delivery to
a process which tries to resolve an address to an FQDN and
there is no name service available for the corresponding
in-addr.arpa. domain the signal is not delivered.
Instead the process simply hangs waiting in ...
#0 0x280b3c00 in kevent () from /usr/lib/libc.so.4
#1 0x280c63f5 in res_send () from /usr/lib/libc.so.4
#2 0x280c9799 in res_query () from /usr/lib/libc.so.4
#3 0x280d5ccf in _gethostbydnsaddr () from /usr/lib/libc.so.4
#4 0x280d45f0 in gethostbyaddr () from /usr/lib/libc.so.4
The process continues only when the resolver timeout expires.
This is a disaster for any program which uses setitimer() and
SIGALRM to drive periodic tasks at regular intervals.
It looks like kevent() is not properly interrupted by the signal.
>How-To-Repeat:
Call setitimer() to set the timer to trigger SIGARLM at say
5 second intervals. Actually anything relatively short should be OK
as long as it is shorter than your default resolver timeout.
Now call gethostbyaddr() with an address for which the reverse DNS
server is not available.
Before testing make sure the registered reverse DNS server is
unavailable...
# dig -x 63.85.29.224
; <<>> DiG 9.2.1 <<>> -x 63.85.29.224
;; global options: printcmd
;; connection timed out; no servers could be reached
Now launch your SIGALRM delivery test.
You will end up waiting in kevent() until the resolver timeout
expires instead of receiving the expected SIGALRM.
>Fix:
None known yet.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list