Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 75180 - ntpd seqfaults at start
Summary: ntpd seqfaults at start
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-21 07:22 UTC by Eero Volotinen
Modified: 2005-08-19 21:10 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eero Volotinen 2004-12-21 07:22:29 UTC
Ntp seqfaults at start:

ntpd[16197]: segfault at 00000000000001b0 rip 000000000040c8ea rsp 0000007fbffff3d0 error 6

Crashing version is 4.2.0-r2

Solution: install 4.2.0.20040617

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Stefan Briesenick (RETIRED) gentoo-dev 2005-01-10 18:27:32 UTC
my ntpd (x86) segfaults since a few days (!) when I run it with "-u ntp:ntp". But not immediately, but when I run "ntptrace". If I comment out the "-u" stuff in /etc/conf.d/ntpd, and let the daemon run as root, then it doesn't segfaults. :-/
Comment 2 Mike Doty (RETIRED) gentoo-dev 2005-01-10 18:30:13 UTC
sounds droproot related.  could you please verify your ntpd configuration
Comment 3 Eero Volotinen 2005-01-11 04:55:46 UTC
No, it is not droproot related.
Comment 4 Stefan Briesenick (RETIRED) gentoo-dev 2005-01-11 11:01:40 UTC
I also have changed nothing! But then I realized, that NTP wasn't working anymore and I wanted to check it with "ntptrace".

ntpd segfaults when 'ntptrace' is called. No matter if local or remote. But it don't crash, when it runs as 'root'.
Comment 5 Danny van Dyk (RETIRED) gentoo-dev 2005-01-11 12:08:37 UTC
Please provide the output of "emerge info" (both reporters)

Is this really an amd64-bug ? (x86 has been mentioned by reporter #2 !)

Neither ntpd 4.2.0-r2 nor the one from 4.2.0.20040617 segfault for me.
Comment 6 Mike Doty (RETIRED) gentoo-dev 2005-01-11 12:39:16 UTC
please post output of emerge --info and contents of ntpd.conf. FWIW, it works on a number of boxes, droproot or not.
Comment 7 Baerbel 2005-01-26 08:08:24 UTC
This is not an amd64 issue. Same problem on my x86.

If compiled with CFLAGS="-O3 -march=i686 -pipe -fomit-frame-pointer";
works correct when compiled with standard CFLAGS.

More Infos:
*  net-misc/ntp
      Latest version available: 4.2.0.20040617
      Latest version installed: 4.2.0.20040617

emerge --info (working config):
Portage 2.0.51-r15 (default-linux/x86/2004.3, gcc-3.3.5, glibc-2.3.4.20041102-r0, 2.6.10-gentoo-r4 i686)
=================================================================
System uname: 2.6.10-gentoo-r4 i686 Intel(R) Pentium(R) M processor 1.40GHz
Gentoo Base System version 1.6.8
Python:              dev-lang/python-2.3.4 [2.3.4 (#1, Jan 15 2005, 20:51:45)]
dev-lang/python:     2.3.4
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.5, 1.8.5-r2, 1.6.3, 1.7.9, 1.4_p6, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r2
sys-devel/libtool:   1.5.10-r3
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=i686 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=i686 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="ftp:///ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://gentoo.inode.at/ http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://gentoo.math.bme.hu http://gentoo.mirror.sdv.fr http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ http://ds.thn.htu.se/linux/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://localhost:7873/gentoo-portage"
USE="x86 alsa apm avi berkdb bitmap-fonts bzip2 caps crypt cups encode esd f77 fam font-server foomaticdb fortran gdbm gif gimpprint gpm gtk gtk2 idea imagemagick imap imlib ipv6 jpeg libg++ libwww mad mikmod motif mpeg ncurses oggvorbis opengl oss pam pdflib perl png ppds qt quicktime readline sdl slang spell ssl svga tcpd tetex tiff truetype truetype-fonts type1-fonts xml2 xmms xv zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LDFLAGS, PORTDIR_OVERLAY
Comment 8 Simon Stelling (RETIRED) gentoo-dev 2005-01-26 08:14:21 UTC
reopening
Comment 9 Simon Stelling (RETIRED) gentoo-dev 2005-01-26 08:14:55 UTC
vapier: it's yours, have fun ;)
Comment 10 Stefan Briesenick (RETIRED) gentoo-dev 2005-01-26 12:54:07 UTC
I can confirm this issue.

running as 'root' -> no problems
running as 'ntp' -> segfault
Comment 11 Heiko Helmle 2005-02-07 00:48:42 UTC
This bug is CFLAG-related.

CFLAGS="-O3 -pipe" produces a broken ntpd that segfaults when queried by ntpq for example
CLFAGS="-O2 -pipe" produces a working ntpd
CFLAGS="-O2 -pipe -fomit-frame-pointer -march=pentium3" produces a working ntpd

Looks like -O3 is a bad one for this package and should be filtered, right?
Comment 12 Remy Blank 2005-02-15 06:50:44 UTC
I can confirm that ntpd crashes when queried with "ntpq -p" if compiled with "-O3". Compiling with "-O2" fixes the problem. This happens on two machines with very similar configuration, both run ntpd as "ntp:ntp".

Portage 2.0.51-r15 (default-linux/x86/2004.0, gcc-3.3.5, glibc-2.3.4.20040808-r1, 2.6.10-gentoo-r6 i686)
=================================================================
System uname: 2.6.10-gentoo-r6 i686 Intel(R) Celeron(R) CPU 1.80GHz
Gentoo Base System version 1.4.16
Python:              dev-lang/python-2.3.4-r1 [2.3.4 (#1, Feb 11 2005, 07:01:31)]
distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.4-r1
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.5, 1.6.3, 1.4_p6, 1.9.4, 1.7.9-r1, 1.8.5-r3
sys-devel/binutils:  2.15.92.0.2-r1
sys-devel/libtool:   1.5.10-r4
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -mcpu=pentium4 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -mcpu=pentium4 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distcc distlocks fixpackages sandbox sfperms userpriv usersandbox"
GENTOO_MIRRORS="http://mirror.switch.ch/mirror/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="fr_CH"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 acl alsa apache2 apm audiofile avi bash-completion berkdb bitmap-fonts cdr crypt cups curl encode fam flac font-server foomaticdb gdbm gif gpm imagemagick imap imlib jbig jpeg lcms libg++ libwww mad maildir mbox mikmod mmap mmx mpeg ncurses nls nntp oggvorbis oss pam pcre perl png ppds pthreads python quicktime readline samba sasl sdl slang spell sse ssl svga tcpd threads tiff truetype truetype-fonts type1-fonts usb wmf xml2 xv zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LC_ALL, LDFLAGS
Comment 13 Jason White 2005-03-27 01:13:24 UTC
Ntp 4.2.0-r2 gives the following log output on my Gentoo AMD64 system. 
Note that running ntpd as root works (at least it doesn't segfault).

Mar 27 18:34:41 localhost ntpd[9509]: ntpd 4.2.0@1.1161-r Fri Mar 11 18:52:10 EST 2005 (3)
Mar 27 18:34:41 localhost ntpd[9509]: signal_no_reset: signal 13 had flags 4000000
Mar 27 18:34:41 localhost ntpd[9509]: precision = 1.000 usec
Mar 27 18:34:41 localhost ntpd[9509]: kernel time sync status 0040
Mar 27 18:34:41 localhost ntpd[9509]: Frequency format error in /var/lib/ntp/ntp.drift
Mar 27 18:34:42 localhost ntpd[9511]: signal_no_reset: signal 17 had flags 4000000
Mar 27 18:34:42 localhost ntpd[9509]: cap_set_proc() failed to drop root privileges: Operation not permitted
Mar 27 18:34:44 localhost ntpd_initres[9511]: signal_no_reset: signal 14 had flags 4000000
Mar 27 18:34:44 localhost ntpd_initres[9511]: parent died before we finished, exiting

Output of emerge --info:

Gentoo Base System version 1.4.16
Portage 2.0.51.19 (default-linux/amd64/2004.3, gcc-3.4.3, glibc-2.3.4.20041102-r1, 2.6.10 x86_64)
=================================================================
System uname: 2.6.10 x86_64 AMD Athlon(tm) 64 Processor 3000+
Python:              dev-lang/python-2.3.4-r1 [2.3.4 (#1, Feb 13 2005, 22:29:09)]
dev-lang/python:     2.3.4-r1
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r1
sys-devel/libtool:   1.5.10-r4
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CFLAGS="-O2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/init.d /etc/terminfo /etc/env.d"
CXXFLAGS="-O2"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox"
GENTOO_MIRRORS="http://mirror.pacific.net.au/linux/Gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://mirror.pacific.net.au/gentoo-portage/"
USE="amd64 X Xaw3d accessibility acl acpi aim alsa apache2 arts audiofile avi bcmath berkdb bitmap-fonts bonobo bzlib cdr crypt cups curl dga dvd emacs encode esd fam fftw flac flash font-server fortran ftp gb gd gdbm ggi gif gnome gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile icq imagemagick imap imlib ipv6 java jp2 jpeg kde libwww lzw lzw-tiff mmap motif mozilla mp3 mpeg mysql ncurses nls oggvorbis opengl oscar oss pam pcmcia pdflib pelr perl php plotutils png posix python qt quicktime readline samba scanner shared spell ssl svg tcltk tcpd tetex tiff truetype truetype-fonts type1-fonts usb userlocales wxwindows xml xml2 xmlrpc xmms xpm xrandr xv yahoo zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, PORTDIR_OVERLAY

/etc/ntp.conf:
# NOTES:
#  - you should only have to update the server line below
#  - if you start getting lines like 'restrict' and 'fudge'
#    and you didnt add them, AND you run dhcpcd on your
#    network interfaces, be sure to add '-Y -N' to the
#    dhcpcd_ethX variables in /etc/conf.d/net

# Name of the servers ntpd should sync with
# Please respect the access policy as stated by the responsible person.
#server         ntp.example.tld         iburst

server pool.ntp.org

##
# A list of available servers can be found here:
# http://www.pool.ntp.org/
# http://www.pool.ntp.org/#use
# A good way to get servers for your machine is:
# netselect -s 3 pool.ntp.org
##

# you should not need to modify the following paths
driftfile       /var/lib/ntp/ntp.drift

#server ntplocal.example.com prefer 
#server timeserver.example.org 

# Warning: Using default NTP settings will leave your NTP
# server accessible to all hosts on the Internet.

# If you want to deny all machines (including your own)
# from accessing the NTP server, uncomment:
#restrict default ignore


# To deny other machines from changing the
# configuration but allow localhost:
restrict default nomodify nopeer
restrict 127.0.0.1


# To allow machines within your network to synchronize
# their clocks with your server, but ensure they are
# not allowed to configure the server or used as peers
# to synchronize against, uncomment this line.
#
#restrict 192.168.0.0 mask 255.255.255.0 nomodify nopeer notrap
server jpc
# note: jpc is a host on my local lan with ntp running
Comment 14 SpanKY gentoo-dev 2005-08-19 21:10:14 UTC
4.2.0.20040617 is in stable ...