From owner-freebsd-current@FreeBSD.ORG Wed Nov 28 15:17:04 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5FCD16A417 for ; Wed, 28 Nov 2007 15:17:03 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from bunrab.catwhisker.org (adsl-63-193-123-122.dsl.snfc21.pacbell.net [63.193.123.122]) by mx1.freebsd.org (Postfix) with ESMTP id 9FF8413C4CE for ; Wed, 28 Nov 2007 15:17:03 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from bunrab.catwhisker.org (localhost [127.0.0.1]) by bunrab.catwhisker.org (8.13.3/8.13.3) with ESMTP id lASFH3cI071266 for ; Wed, 28 Nov 2007 07:17:03 -0800 (PST) (envelope-from david@bunrab.catwhisker.org) Received: (from david@localhost) by bunrab.catwhisker.org (8.13.3/8.13.1/Submit) id lASFH3HI071265 for current@freebsd.org; Wed, 28 Nov 2007 07:17:03 -0800 (PST) (envelope-from david) Date: Wed, 28 Nov 2007 07:17:03 -0800 From: David Wolfskill To: current@freebsd.org Message-ID: <20071128151703.GF21444@bunrab.catwhisker.org> Mail-Followup-To: David Wolfskill , current@freebsd.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fc3RSXbRKaEj1MFC" Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Cc: Subject: host(1) & nslookup(1) hang, but name resolution ... works??!? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2007 15:17:04 -0000 --fc3RSXbRKaEj1MFC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable OK; this is weird and probably rather vaguer than anyone would like. I noticed this yesterday, but I needed to actually use my laptop at work, so I didn't really have much opportunity to poke around. I did some poking around this morning (on booting yesterday's CURRENT to build today's), and here's some background and what I found: * I normally run the laptop as a DHCP client. * In dhclient-exit-hooks, I have a bit of code that uses the just- acquired IP address as an argument to host(1), then parses the output to determine a hostname to assign to the laptop. This has been working for a very long time -- definitely as far back as FreeBSD 4.8; probably earlier than that. It still works fine in RELENG_6 & RELENG_7 (which I also track daily; the laptop gets a fair workout). * I'm presently running: FreeBSD g1-1.catwhisker.org 8.0-CURRENT FreeBSD 8.0-CURRENT #604: Tue Nov 2= 7 07:17:37 PST 2007 root@g1-1.catwhisker.org.:/common/S4/obj/usr/src/sy= s/CANARY i386 which is where I first noticed the issue: the invocation of host(1) appears to hang. * I tried invoking host(1) from the command line; that invocation also hung. * nslookup(1) also hung. * I tried running tcpdump(1), then invoking host(1); there was no indication of network traffic at all. * I tried running host(1) under ktrace(1); running kdump(1) with "-E" flag so I can see some timing, the output ends with: 9739 initial thread 0.010794 CALL getsockname(0x3,0xbfbfe140,0xbfbfe15c) 9739 initial thread 0.010820 RET getsockname 0 9739 initial thread 0.010837 CALL close(0x3) 9739 initial thread 0.010874 RET close 0 9739 initial thread 0.010892 CALL socket(PF_LOCAL,SOCK_STREAM,0) 9739 initial thread 0.010934 RET socket 3 9739 initial thread 0.010951 CALL close(0x3) 9739 initial thread 0.010982 RET close 0 9739 initial thread 0.012502 CALL _umtx_op(0xbfbfe0ac,0x3,0x1,0,0) 9739 initial thread 0.012535 RET _umtx_op 0 9739 initial thread 0.012552 CALL sigprocmask(SIG_BLOCK,0xbfbfe040,0x285= 01190) 9739 initial thread 0.012569 RET sigprocmask 0 9739 initial thread 0.012597 CALL _umtx_op(0x283168a0,0x5,0,0,0) 9739 initial thread 19.115591 RET _umtx_op RESTART 9739 initial thread 19.115650 PSIG SIGKILL SIG_DFL As you can see, I waited about 19 seconds before killing the host(1) process (with SIGKILL). * Despite all of this, hostname resolution is actually working -- e.g., I can ping using a hostname: g1-1(8.0-C)[21] ping -c 2 freefall.freebsd.org PING freefall.freebsd.org (69.147.83.40): 56 data bytes 64 bytes from 69.147.83.40: icmp_seq=3D0 ttl=3D56 time=3D14.120 ms 64 bytes from 69.147.83.40: icmp_seq=3D1 ttl=3D55 time=3D14.583 ms --- freefall.freebsd.org ping statistics --- 2 packets transmitted, 2 packets received, 0.0% packet loss round-trip min/avg/max/stddev =3D 14.120/14.351/14.583/0.231 ms g1-1(8.0-C)[22]=20 which is a fairly useful thing, since I'm actually sending this message from my internal mailhost (vs. my laptop). (It's also something of which I wasn't aware yesterday at work, or I might have been able to report this earlier.) * Here's what ps(1) has to say: g1-1(8.0-C)[23] ps xwwl UID PID PPID CPU PRI NI VSZ RSS MWCHAN STAT TT TIME COMMAND =2E.. 1001 24683 24682 0 20 0 4500 2588 pause Is pe 0:00.06 csh 1001 24920 24683 0 44 0 5596 1896 umtxn I+ pe 0:00.01 host 17= 2.17.1.1 * The host(1) process is not killed by SIGTERM, but SIGKILL does the job. As noted, I'm building today's CURRENT now; if there's a change in the behavior, I'll send a follow-up note. I keep a local CVS repo mirror handy, and am not at all averse to testing patches. If there are other aspects of the behavior I might check on, please let me know. Peace, david --=20 David H. Wolfskill david@catwhisker.org Proprietary data formats obfuscate, rather than disseminate, information. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --fc3RSXbRKaEj1MFC Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (FreeBSD) iEYEARECAAYFAkdNhm4ACgkQmprOCmdXAD28cgCgg75EYdf/6z4BAHnpHm9ceMb2 7hYAnArtoQUy15h9399LuQSudFJq3EPN =kqPv -----END PGP SIGNATURE----- --fc3RSXbRKaEj1MFC--