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.
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. :-/
sounds droproot related. could you please verify your ntpd configuration
No, it is not droproot related.
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'.
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.
please post output of emerge --info and contents of ntpd.conf. FWIW, it works on a number of boxes, droproot or not.
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
reopening
vapier: it's yours, have fun ;)
I can confirm this issue. running as 'root' -> no problems running as 'ntp' -> segfault
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?
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
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
4.2.0.20040617 is in stable ...