From nobody@FreeBSD.org  Fri Sep 28 21:49:00 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6D96516A419
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 28 Sep 2007 21:49:00 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 48F0513C47E
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 28 Sep 2007 21:49:00 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l8SLn0RU050504
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 28 Sep 2007 21:49:00 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.1/8.14.1/Submit) id l8SLn0sw050503;
	Fri, 28 Sep 2007 21:49:00 GMT
	(envelope-from nobody)
Message-Id: <200709282149.l8SLn0sw050503@www.freebsd.org>
Date: Fri, 28 Sep 2007 21:49:00 GMT
From: Warren Block <wblock@wonkity.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ntpd core dumps if hostnames are not specifed with "-4" option
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         116722
>Category:       bin
>Synopsis:       ntpd(8): ntpd core dumps if hostnames are not specifed with "-4" option
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 28 21:50:01 GMT 2007
>Closed-Date:    Tue Nov 01 04:21:28 UTC 2011
>Last-Modified:  Tue Nov 01 04:21:28 UTC 2011
>Originator:     Warren Block
>Release:        6.2-STABLE
>Organization:
>Environment:
FreeBSD speedy.wonkity.com 6.2-STABLE FreeBSD 6.2-STABLE #0: Fri Sep 28 13:51:02 MDT 2007     root@speedy.wonkity.com:/usr/obj/usr/src/sys/SPEEDY  i386
>Description:
Client system using ntpd has a kernel with only IPv4.  ntpd core dumps
if hostnames are used without specific IPv4 notation.
>How-To-Repeat:
Compile/install kernel with INET but without INET6 kernel option.  In
/etc/ntp.conf, use only server name:

# bad /etc/ntp.conf
server wonkity.com

This causes ntpd to core dump on startup:

speedy kernel: pid 1276 (ntpd), uid 0: exited on signal 11 (core dumped)


ntpd starts and runs normally if an IP address is used or if hostnames
are preceded with the poorly-documented "-4" option:

# good /etc/ntp.conf
server 10.0.0.1
server -4 wonkity.com
>Fix:
Workaround: when running ntpd on clients with only IPv4, use IP addresses or precede hostnames with "-4" in /etc/ntp.conf.

>Release-Note:
>Audit-Trail:

From: Remko Lodder <remko@FreeBSD.org>
To: Warren Block <wblock@wonkity.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/116722: ntpd core dumps if hostnames are not specifed with
 "-4" option
Date: Sat, 29 Sep 2007 10:31:39 +0200

 Hello, can you do some debugging on the core dump? This might tell us
 what is going on more specifically.
 
 Thanks,
 remko
 
 -- 
 Kind regards,
 
      Remko Lodder               ** remko@elvandar.org
      FreeBSD                    ** remko@FreeBSD.org
 
      /* Quis custodiet ipsos custodes */

From: Warren Block <wblock@wonkity.com>
To: Remko Lodder <remko@FreeBSD.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/116722: ntpd core dumps if hostnames are not specifed with
 "-4" option
Date: Mon, 1 Oct 2007 17:49:19 -0600 (MDT)

 On Sat, 29 Sep 2007, Remko Lodder wrote:
 
 > Hello, can you do some debugging on the core dump? This might tell us
 > what is going on more specifically.
 
 speedy% gdb /usr/sbin/ntpd ntpd.core
 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"...
 Core was generated by `ntpd'.
 Program terminated with signal 11, Segmentation fault.
 Reading symbols from /lib/libm.so.4...done.
 Loaded symbols for /lib/libm.so.4
 Reading symbols from /lib/libmd.so.3...done.
 Loaded symbols for /lib/libmd.so.3
 Reading symbols from /lib/libcrypto.so.4...done.
 Loaded symbols for /lib/libcrypto.so.4
 Reading symbols from /lib/libc.so.6...done.
 Loaded symbols for /lib/libc.so.6
 Reading symbols from /libexec/ld-elf.so.1...done.
 Loaded symbols for /libexec/ld-elf.so.1
 #0  0x08057520 in sendpkt (dest=0x808c588, inter=0x0, ttl=0, pkt=0xbfbfe4f0, len=48)
      at /usr/src/usr.sbin/ntp/ntpd/../../../contrib/ntp/ntpd/ntp_io.c:1377
 1377            switch (inter->sin.ss_family) {
 (gdb) bt
 #0  0x08057520 in sendpkt (dest=0x808c588, inter=0x0, ttl=0, pkt=0xbfbfe4f0, len=48)
      at /usr/src/usr.sbin/ntp/ntpd/../../../contrib/ntp/ntpd/ntp_io.c:1377
 #1  0x0805eb59 in transmit (peer=0x808c588) at /usr/src/usr.sbin/ntp/ntpd/../../../contrib/ntp/ntpd/ntp_proto.c:2354
 #2  0x080664ad in timer () at /usr/src/usr.sbin/ntp/ntpd/../../../contrib/ntp/ntpd/ntp_timer.c:289
 #3  0x080676ff in ntpdmain (argc=0, argv=0xbfbfeab0) at /usr/src/usr.sbin/ntp/ntpd/../../../contrib/ntp/ntpd/ntpd.c:1032
 #4  0x080677e7 in main (argc=8, argv=0xbfbfebc8) at /usr/src/usr.sbin/ntp/ntpd/../../../contrib/ntp/ntpd/ntpd.c:234
 (gdb) l
 234             return ntpdmain(argc, argv);
 235     }
 236     #endif
 237     #endif /* SIM */
 238
 239     #ifdef _AIX
 240     /*
 241      * OK. AIX is different than solaris in how it implements plock().
 242      * If you do NOT adjust the stack limit, you will get the MAXIMUM
 243      * stack size allocated and PINNED with you program. To check the 
 (gdb)
 
 -Warren Block * Rapid City, South Dakota USA
State-Changed-From-To: open->closed 
State-Changed-By: wblock 
State-Changed-When: Tue Nov 1 04:20:10 UTC 2011 
State-Changed-Why:  
No longer applies. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116722 
>Unformatted:
