From owner-freebsd-bugs@FreeBSD.ORG Sun Feb 8 03:30:21 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 20F5C16A4CF for ; Sun, 8 Feb 2004 03:30:21 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 05AF243D3F for ; Sun, 8 Feb 2004 03:30:21 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i18BUKbv052847 for ; Sun, 8 Feb 2004 03:30:20 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i18BUKx3052846; Sun, 8 Feb 2004 03:30:20 -0800 (PST) (envelope-from gnats) Resent-Date: Sun, 8 Feb 2004 03:30:20 -0800 (PST) Resent-Message-Id: <200402081130.i18BUKx3052846@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Jukka A. Ukkonen" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5628616A4CE for ; Sun, 8 Feb 2004 03:21:59 -0800 (PST) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 52F4B43D1F for ; Sun, 8 Feb 2004 03:21:59 -0800 (PST) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.10/8.12.10) with ESMTP id i18BLw72037904 for ; Sun, 8 Feb 2004 03:21:58 -0800 (PST) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.10/8.12.10/Submit) id i18BLwEl037903; Sun, 8 Feb 2004 03:21:58 -0800 (PST) (envelope-from nobody) Message-Id: <200402081121.i18BLwEl037903@www.freebsd.org> Date: Sun, 8 Feb 2004 03:21:58 -0800 (PST) From: "Jukka A. Ukkonen" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.0 Subject: kern/62524: SIGALRM is not delivered when res_send() hangs waiting in kevent() X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Feb 2004 11:30:21 -0000 >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@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: