<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>48128</bug_id>
          
          <creation_ts>2004-04-17 06:58 0000</creation_ts>
          <short_desc>ntpd segmentation fault</short_desc>
          <delta_ts>2004-11-09 07:40:12 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Unspecified</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>TEST-REQUEST</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>denys.duchier@univ-orleans.fr</reporter>
          <assigned_to>vapier@gentoo.org</assigned_to>
          <cc>fserb@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>denys.duchier@univ-orleans.fr</who>
            <bug_when>2004-04-17 06:58:54 0000</bug_when>
            <thetext>running the following command results in a segmentation fault:

sudo ntpd -c /home/denys/bin/ntpd-loria.conf -q -g -dd

where file ntpd-loria.conf contains:

server ntphost1.loria.fr iburst
server ntphost2.loria.fr iburst
server ntphost3.loria.fr iburst

A similar problem was reported on the forums
http://forums.gentoo.org/viewtopic.php?t=161697

The corresponding trace is:

ntpd 4.2.0@1.1161-r Wed Apr 14 20:14:42 CEST 2004 (1)
addto_syslog: ntpd 4.2.0@1.1161-r Wed Apr 14 20:14:42 CEST 2004 (1)
addto_syslog: signal_no_reset: signal 13 had flags 4000000
addto_syslog: set_process_priority: Leave priority alone: priority_done is &lt;2&gt;
addto_syslog: precision = 1.000 usec
create_sockets(123)
addto_syslog: no IPv6 interfaces found
bind() fd 4, family 2, port 123, addr 0.0.0.0, flags=8
flags for fd 4: 04002
bind() fd 5, family 2, port 123, addr 127.0.0.1, flags=0
flags for fd 5: 04002
bind() fd 6, family 2, port 123, addr 192.168.60.30, flags=8
flags for fd 6: 04002
bind() fd 7, family 2, port 123, addr 81.249.175.121, flags=0
flags for fd 7: 04002
create_sockets: ninterfaces=4
interface 0:  fd=4,  bfd=-1,  name=wildcard,  flags=0x8
              sin=0.0.0.0  bcast=0.0.0.0,  mask=255.255.255.255
interface 1:  fd=5,  bfd=-1,  name=lo,  flags=0x5
              sin=127.0.0.1  mask=255.0.0.0
interface 2:  fd=6,  bfd=-1,  name=eth1,  flags=0x9
              sin=192.168.60.30  bcast=192.168.60.255,  mask=255.255.255.0
interface 3:  fd=7,  bfd=-1,  name=ppp0,  flags=0x3
              sin=81.249.175.121  mask=255.255.255.255
init_io: maxactivefd 7
local_clock: at 0 state 0
getnetnum given ntphost1.loria.fr, got 2001:660:301:1:202:a5ff:fe53:dfd8 
key_expire: at 0
peer_clear: at 0 assoc ID 30604 refid INIT
newpeer: null-&gt;2001:660:301:1:202:a5ff:fe53:dfd8 mode 3 vers 4 poll 6 10 flags 0x201 0x1 ttl 0 key 00000000
getnetnum given ntphost2.loria.fr, got 2001:660:301:1:202:a5ff:fe63:1a66 
key_expire: at 0
peer_clear: at 0 assoc ID 30605 refid INIT
newpeer: null-&gt;2001:660:301:1:202:a5ff:fe63:1a66 mode 3 vers 4 poll 6 10 flags 0x201 0x1 ttl 0 key 00000000
getnetnum given ntphost3.loria.fr, got 2001:688:1fb8:1:204:76ff:feef:388 
key_expire: at 0
peer_clear: at 0 assoc ID 30606 refid INIT
newpeer: null-&gt;2001:688:1fb8:1:204:76ff:feef:388 mode 3 vers 4 poll 6 10 flags 0x201 0x1 ttl 0 key 00000000
report_event: system event &apos;event_restart&apos; (0x01) status &apos;sync_alarm, sync_unspec, 1 event, event_unspec&apos; (0xc010)
Segmentation fault

Reproducible: Always
Steps to Reproduce:</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2004-04-17 20:59:24 0000</bug_when>
            <thetext>run it through gdb and see if anything useful shows up</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>denys.duchier@univ-orleans.fr</who>
            <bug_when>2004-04-19 10:47:15 0000</bug_when>
            <thetext>running it through gdb:

(gdb) bt
#0  0x08051604 in sendpkt (dest=0x80a1d50, inter=0x0, ttl=0, pkt=0xbfffec90, len=48) at ntp_io.c:1377
#1  0x08067afd in peer_xmit (peer=0x80a1d48) at ntp_proto.c:2354
#2  0x08063691 in transmit (peer=0x80a1d48) at ntp_proto.c:295
#3  0x080719e4 in timer () at ntp_timer.c:289
#4  0x08053769 in ntpdmain (argc=5, argv=0xbffff374) at ntpd.c:1079
#5  0x08052e56 in main (argc=5, argv=0xbffff374) at ntpd.c:239

some pointer is NULL:

(gdb) p inter
$5 = (struct interface *) 0x0

which comes from a peer not properly initialized (I guess):

(gdb) f 3
#3  0x080719e4 in timer () at ntp_timer.c:289
(gdb) p peer-&gt;dstadr
$6 = (struct interface *) 0x0

I don&apos;t have time to look further into it right now as I have a conf deadline
for tomorrow.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>fserb@gentoo.org</who>
            <bug_when>2004-06-23 17:54:27 0000</bug_when>
            <thetext>Same happened here. 
If I left only one server at ntp.conf, the server runs normally.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2004-11-09 07:40:12 0000</bug_when>
            <thetext>please try 4.2.0.20040617</thetext>
          </long_desc>
      
    </bug>

</bugzilla>