ntpd segfaults on start

From: Vladimir Zakharov <zakharov.vv_at_gmail.com>
Date: Thu, 5 Sep 2019 09:12:51 +0300
Hello!

Accidentally it turned out that the ntpd does not start on boot.
Logs show that it core dumps:
2019-09-05T08:38:43.588563+03:00 vzakharov ntpd 34934 - - ntpd 4.2.8p12-a (1): Starting
2019-09-05T08:38:43.588717+03:00 vzakharov kernel - - - Security policy loaded: MAC/ntpd (mac_ntpd)
2019-09-05T08:38:43.718356+03:00 vzakharov kernel - - - pid 35074 (ntpd), jid 0, uid 123: exited on signal 11

Not sure how long does it happen. ktrace and gdb points to `setrlimit`
call. Clean rebuild has no effect. Does anyone have any idea what the
problem could be?

root_at_vzakharov:~ # uname -a
FreeBSD vzakharov 13.0-CURRENT FreeBSD 13.0-CURRENT r351834 GENERIC-NODEBUG  amd64
root_at_vzakharov:~ # ktrace -i sudo -u ntpd `which ntpd`
root_at_vzakharov:~ # kdump | tail -n 20
 29735 ntpd     CALL  dup2(0,0x2)
 29735 ntpd     RET   dup2 2
 29735 ntpd     CALL  socket(PF_LOCAL,0x10000002<SOCK_DGRAM|SOCK_CLOEXEC>,0)
 29735 ntpd     RET   socket 3
 29735 ntpd     CALL  connect(0x3,0x7fffff924f98,0x6a)
 29735 ntpd     STRU  struct sockaddr { AF_LOCAL, /var/run/logpriv }
 29735 ntpd     NAMI  "/var/run/logpriv"
 29735 ntpd     RET   connect -1 errno 13 Permission denied
 29735 ntpd     CALL  connect(0x3,0x7fffff924f98,0x6a)
 29735 ntpd     STRU  struct sockaddr { AF_LOCAL, /var/run/log }
 29735 ntpd     NAMI  "/var/run/log"
 29735 ntpd     RET   connect 0
 29735 ntpd     CALL  setsid
 29735 ntpd     RET   setsid 29735/0x7427
 29735 ntpd     CALL  getrlimit(RLIMIT_STACK,0x7fffff9250a0)
 29735 ntpd     RET   getrlimit 0
 29735 ntpd     CALL  setrlimit(RLIMIT_STACK,0x7fffff9250a0)
 29735 ntpd     RET   setrlimit 0
 29735 ntpd     PSIG  SIGSEGV SIG_DFL code=SEGV_ACCERR
 29735 ntpd     NAMI  "ntpd.core"
root_at_vzakharov:~ # ntpd
root_at_vzakharov:~ # gdb -c ntpd.core `which ntpd`
GNU gdb (GDB) 8.3 [GDB v8.3 for FreeBSD]
[...]
Reading symbols from /usr/sbin/ntpd...
Reading symbols from /usr/lib/debug//usr/sbin/ntpd.debug...
[New LWP 100946]
Core was generated by `ntpd'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  setrlimit () at setrlimit.S:4
4       RSYSCALL(setrlimit)
(gdb) bt
#0  setrlimit () at setrlimit.S:4
Backtrace stopped: Cannot access memory at address 0x7fffff3ce7c8
(gdb) quit
# cat /etc/src.conf
WITHOUT_ACCT=
WITHOUT_AMD=
WITHOUT_APM=
WITHOUT_ATM=
WITHOUT_AUTHPF=
WITHOUT_BLACKLIST=
WITHOUT_BLUETOOTH=
WITHOUT_BOOTPARAMD=
WITHOUT_BOOTPD=
WITHOUT_BSNMP=
WITHOUT_CCD=
WITHOUT_CROSS_COMPILER=
WITHOUT_CUSE=
WITHOUT_CXGBETOOL=
# WITHOUT_DEBUG_FILES=
WITHOUT_EE=
WITHOUT_FDT=
WITHOUT_FINGER=
WITHOUT_FLOPPY=
WITHOUT_FREEBSD_UPDATE=
WITHOUT_FTP=
WITHOUT_GDB=
WITHOUT_GNU_DIFF=
WITHOUT_GNU_GREP=
WITHOUT_GNU_GREP_COMPAT=
WITHOUT_GPIO=
WITHOUT_HAST=
WITHOUT_HTML=
WITHOUT_HYPERV=
WITHOUT_IPFILTER=
WITHOUT_ISCSI=
WITHOUT_KVM=
WITHOUT_LEGACY_CONSOLE=
WITHOUT_LIB32=
WITHOUT_LLVM_TARGET_ALL=
WITHOUT_LPR=
WITHOUT_MLX5TOOL=
WITHOUT_NDIS=
WITHOUT_NVME=
WITHOUT_PC_SYSINSTALL=
WITHOUT_PF=
WITHOUT_PMC=
WITHOUT_PPP=
WITHOUT_QUOTAS=
WITHOUT_RADIUS_SUPPORT=
WITHOUT_RBOOTD=
WITHOUT_SHAREDOCS=
WITHOUT_TALK=
WITHOUT_TELNET=
WITHOUT_TESTS=
WITHOUT_TFTP=
WITHOUT_TIMED=

WITH_BSD_GREP=
WITH_CCACHE_BUILD=
# WITH_CLANG_EXTRAS=
# WITH_CTF=
# WITH_RATELIMIT=
WITH_SORT_THREADS=
WITH_SVN=

BOOTSTRAP_ALL_TOOLS=

--
Regards,                 | "In theory there is no difference between theory
  Vladimir Zakharov      | and practice. In practice there is."- Yogi Berra

Received on Thu Sep 05 2019 - 04:13:00 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:21 UTC