Subject: bin/27137: ntpd dies w/ seg fault
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <mjl@emsi.priv.at>
List: netbsd-bugs
Date: 10/04/2004 11:26:27
>Number:         27137
>Category:       bin
>Synopsis:       ntpd dies w/ segfault, probably non-executable stack
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 04 09:45:01 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Martin J. Laubach
>Release:        NetBSD 2.0_RC2
>Organization:
>Environment:
System: NetBSD asparagus.emsi.priv.at 2.0_RC2 NetBSD 2.0_RC2 (ASPARAGUS) #0: Sat Oct 2 00:43:42 CEST 2004 mjl@asparagus.emsi.priv.at:/storage/netbsd/cvs/src/sys20/arch/i386/compile/ASPARAGUS i386
Architecture: i386
Machine: i386
>Description:
  I upgraded yesterday to a recent 2.0 snapshot from releng.netbsd.org
and noticed that ntpd does not seem to be running.

  Starting it manually produces:

| asparagus:20 [/var/log] # ntpd -d
| ntpd 4.2.0-r Thu Sep 30 07:02:53 UTC 2004 (1)
| addto_syslog: ntpd 4.2.0-r Thu Sep 30 07:02:53 UTC 2004 (1)
| addto_syslog: precision = 1.000 usec
| create_sockets(123)
| addto_syslog: no IPv6 interfaces found
| [..]
| peer_clear: at 0 assoc ID 31471 refid INIT
| newpeer: 127.0.0.1->127.127.1.0 mode 3 vers 4 poll 6 6 flags 0x21 0x1 ttl 0 key 00000000
| report_event: system event 'event_restart' (0x01) status 'sync_alarm, sync_unspec, 1 event, event_unspec' (0xc010)
| transmit: at 1 212.16.40.157->193.81.13.2 mode 3
| auth_agekeys: at 1 keys 1 expired 0
| timer: refresh ts 0
| receive: at 1 212.16.40.157<-193.81.13.2 mode 4 code 1
| peer 193.81.13.2 event 'event_reach' (0x84) status 'unreach, conf, 1 event, event_reach' (0xa014)
| clock_filter: n 1 off -0.370574 del 0.018434 dsp 7.937503 jit 0.000001, age 1
| Segmentation fault

  I have had that problem on Linux too, with "StackGuard" enabled, which
makes the stack non executable. There, I could rewrite the rc.d script to 
urn off StackGuard, start ntpd, re-enable StackGuard, so it indeed seemed
to be a problem with ntpd needing an executable stack area.

>How-To-Repeat:
	Start ntpd

>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: