From owner-freebsd-stable@FreeBSD.ORG Wed Nov 15 10:14:22 2006 Return-Path: X-Original-To: stable@freebsd.org Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3D2CB16A407 for ; Wed, 15 Nov 2006 10:14:22 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.185]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0582143D67 for ; Wed, 15 Nov 2006 10:14:20 +0000 (GMT) (envelope-from uspoerlein@gmail.com) Received: by nf-out-0910.google.com with SMTP id x37so231956nfc for ; Wed, 15 Nov 2006 02:14:20 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=R2/NFCZPOjKU/qOQNXRnTy4GgG/oagNEUpgwwsjR/7cgYNHxbhfPVnMB3+BYlI7NHY6NW1/ehmYlboydrNQrjUcUmERvDOSpt++O91cFfMrPJJ1wCd1l97IMmayY5ujOO4PH10nmxBYUx1K5DrGrzyYegWfiorD3zNyKFwPEQfc= Received: by 10.78.200.3 with SMTP id x3mr66257huf.1163585659362; Wed, 15 Nov 2006 02:14:19 -0800 (PST) Received: by 10.78.155.3 with HTTP; Wed, 15 Nov 2006 02:14:19 -0800 (PST) Message-ID: <7ad7ddd90611150214q1ff88220g5105ab513908eeb3@mail.gmail.com> Date: Wed, 15 Nov 2006 11:14:19 +0100 From: "Ulrich Spoerlein" To: stable@freebsd.org, kazakov@gmail.com MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: Subject: ntpd vs nss_ldap: Crashing in getaddrinfo X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Nov 2006 10:14:22 -0000 Hi, I needed to test the ntpd from ports (net/ntp, net/ntp-devel, net/ntp-stable), but they always crashed with a SIGBUS error. Investigation lead to nss_ldap being the culprit. With nss_ldap installed and NO keyword "ldap" in /etc/nsswitch.conf, ntpd will run fine. If you either add "ldap" to passwd or group or both, ntpd will crash calling gethostaddr (even though LDAP is only used for passwd/group) /etc/nsswitch.conf: group: files ldap hosts: files dns networks: files passwd: files ldap shells: files root@build:/usr/ports/net/ntp-stable/work/ntp-4.2.2p4-RC4/ntpd# gdb ./ntpd GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-marcel-freebsd"... (gdb) r -d Starting program: /usr/ports/net/ntp-stable/work/ntp-4.2.2p4-RC4/ntpd/ntpd -d ntpd 4.2.2p4-RC4@1.1585-o Wed Nov 15 09:56:13 UTC 2006 (1) addto_syslog: precision = 1.117 usec create_sockets(123) addto_syslog: no IPv6 interfaces found addto_syslog: ntp_io: estimated max descriptors: 10951, initial socket boundary: 20 bind() fd 20, family 2, port 123, addr 0.0.0.0, flags=9 Added addr 0.0.0.0 to list of addresses addto_syslog: Listening on interface wildcard, 0.0.0.0#123 Disabled bind() fd 21, family 2, port 123, addr 16.30.58.127, flags=25 Added addr 16.30.58.127 to list of addresses addto_syslog: Listening on interface xl0, 16.30.58.127#123 Enabled bind() fd 22, family 2, port 123, addr 127.0.0.1, flags=21 Added addr 127.0.0.1 to list of addresses addto_syslog: Listening on interface lo0, 127.0.0.1#123 Enabled init_io: maxactivefd 22 local_clock: time 0 base 0.000000 offset 0.000000 freq 0.000 state 0 Program received signal SIGBUS, Bus error. 0x280a98c8 in memset () from /libexec/ld-elf.so.1 (gdb) bt #0 0x280a98c8 in memset () from /libexec/ld-elf.so.1 #1 0x280c2100 in ?? () #2 0x2809f039 in map_object () from /libexec/ld-elf.so.1 #3 0x2809c115 in elf_hash () from /libexec/ld-elf.so.1 #4 0x2809c21c in elf_hash () from /libexec/ld-elf.so.1 #5 0x2809de8c in dlopen () from /libexec/ld-elf.so.1 #6 0x2828140c in _nsdbtaddsrc () from /lib/libc.so.6 #7 0x2827cb92 in ___toupper () from /lib/libc.so.6 #8 0x2827d1b4 in _nsyyparse () from /lib/libc.so.6 #9 0x2828179e in nsdispatch () from /lib/libc.so.6 #10 0x28271776 in getaddrinfo () from /lib/libc.so.6 #11 0x0804bfee in getnetnum (num=0xbfbfe537 "ntp0.XXXX.com", addr=0xbfbfe9d0, complain=0, a_type=t_UNK) at ntp_config.c:2222 #12 0x0804cb5f in getconfig (argc=2, argv=0xbfbfebcc) at ntp_config.c:652 #13 0x0805246e in ntpdmain (argc=2, argv=0xbfbfebcc) at ntpd.c:744 #14 0x080527bb in main (argc=2, argv=0xbfbfebcc) at ntpd.c:274 (gdb) f 11 #11 0x0804bfee in getnetnum (num=0xbfbfe537 "ntp0.XXXX.com", addr=0xbfbfe9d0, complain=0, a_type=t_UNK) at ntp_config.c:2222 2222 retval = getaddrinfo(num, "ntp", &hints, &ptr); (gdb) l 2217 hints.ai_socktype = SOCK_DGRAM; 2218 #ifdef DEBUG 2219 if (debug > 3) 2220 printf("getaddrinfo %s\n", num); 2221 #endif 2222 retval = getaddrinfo(num, "ntp", &hints, &ptr); 2223 if (retval != 0 || 2224 (ptr->ai_family == AF_INET6 && isc_net_probeipv6() != ISC_R_SUCCESS)) { 2225 if (complain) 2226 msyslog(LOG_ERR, (gdb) What's happening? Uli