Re: ntpd problems after port updates

2012-04-25 Thread Dean E. Weimer

On 23.04.2012 14:52, Dean E. Weimer wrote:

On 23.04.2012 14:10, Chuck Swiger wrote:

On Apr 23, 2012, at 12:08 PM, Dean E. Weimer wrote:
Tried rebuilding without the with SSL option set, oddly it started 
once after that, but a restart caused same behavior.  gdb doesn't 
give me anything that I know how to interpret, gdb -c /ntpd.core.  (I 
haven't really used gdb before, so if I am not doing something 
correctly with it, please feel free to let me know)


Ah, you need to build ntpd with -g in CFLAGS  LDFLAGS for debugging
symbols to be present



at the risk of sounding like an complete n00b, how do I do that?
After reading through the make man page, I decided on trying to build
the port with make CFLAGS+=-g LDFLAGS+=-g install clean however I
still get the no debugging symbols found message.  Does the
information in in the Makefile for the port overwrite this option 
from

the command line?  Or am I just using the incorrect syntax here?

(gdb) file /usr/local/bin/ntpd
Reading symbols from /usr/local/bin/ntpd...(no debugging symbols
found)...done.


Even more odd, I decided to go ahead and try a couple more systems, as 
this was working fine on my test system and one production system before 
I got to the one that broke.  I now have it running on 4 production 
systems and 1 test system.  The problem is on 2 production systems one 
with the openssl option one without, both these systems are running on 
identical hardware (Dell PowerEdge R310 purchased on same order).  The 
other two production systems are both totally different hardware wise, 
one is virtual on an ESX4 server, the other is on a custom built 
machine.  The first of which had the problem I did a fresh make 
buildworld and install last night as well as a rebuild of all ports.  
Problem still persists.  I am not sure what it is about these servers 
that's causing the problem, all other applications are running fine the 
configurations on these systems are all very similar, almost all the 
same ports installed.  One of the systems has a few more ports installed 
as its has more web based applications, but the virtual production 
server has the same ports installed, built with the same /etc/make.conf 
and /etc/src.conf options against the same /var/db/ports/ directory so 
they ports were installed with the same settings, only difference is the 
run time configuration, however the ntpd configuration is the same on 
all systems.


I have also discovered since the last email that the -d option isn't 
necessary to keep it running, the -n option which keeps it from 
detaching from the session will work as well.  I worked around the issue 
for now by manually running it with daemon and adding the -n so its 
detached and running.


--
Thanks,
 Dean E. Weimer
 http://www.dweimer.net/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


ntpd problems after port updates

2012-04-23 Thread Dean E. Weimer
I am running NTPD built from ports on system that has had world rebuilt 
without ntp.  After doing some port updates this morning to the latest 
OpenSSL which caused ntp to rebuild as its built against the OpenSSL 
port.  ntpd now core dumps at start, in order to attempt and resolve the 
issue I tried starting ntpd with the -d switch added, at which point it 
loads fine without any problems.


NTP options set in rc.conf
# Enable NTP Daemon
ntpd_enable=YES
ntpd_flags=-p /var/run/ntpd.pid
ntpd_program=/usr/local/bin/ntpd

Only option checked when doing make config on the port is the with 
OpenSSL option.


if I execute: /usr/local/bin/ntpd -p /var/run/ntpd.pid
The result is a signal 11 core dump.

if I execute: /usr/local/bin/ntpd -d -p /var/run/ntpd.pid
The result is a successful launch, but of course it doesn't detach from 
the terminal and it start showing debugging logs on the terminal.


Anyone have any clue how I can determine what's causing it to crash 
when started without the -d?


--
Thanks,
 Dean E. Weimer
 http://www.dweimer.net/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: ntpd problems after port updates

2012-04-23 Thread Chuck Swiger
On Apr 23, 2012, at 11:13 AM, Dean E. Weimer wrote:
 I am running NTPD built from ports on system that has had world rebuilt 
 without ntp.  After doing some port updates this morning to the latest 
 OpenSSL which caused ntp to rebuild as its built against the OpenSSL port.  
 ntpd now core dumps at start, in order to attempt and resolve the issue I 
 tried starting ntpd with the -d switch added, at which point it loads fine 
 without any problems.

If you run 'ldd /usr/local/bin/ntpd', that might be informative.

 Only option checked when doing make config on the port is the with OpenSSL 
 option.

Consider not doing this-- OpenSSL has a much worse security history than ntpd 
itself does.  In particular, the ASN.1 parser is infamous for trouble, such as 
CVE-2012-2110.

 if I execute: /usr/local/bin/ntpd -p /var/run/ntpd.pid
 The result is a signal 11 core dump.

Run gdb against ntpd and the coredump you've gotten to see the crash backtrace. 
 Or run ntpd under gdb.

Regards,
-- 
-Chuck

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: ntpd problems after port updates

2012-04-23 Thread Dean E. Weimer

On 23.04.2012 13:19, Chuck Swiger wrote:

On Apr 23, 2012, at 11:13 AM, Dean E. Weimer wrote:
I am running NTPD built from ports on system that has had world 
rebuilt without ntp.  After doing some port updates this morning to 
the latest OpenSSL which caused ntp to rebuild as its built against 
the OpenSSL port.  ntpd now core dumps at start, in order to attempt 
and resolve the issue I tried starting ntpd with the -d switch added, 
at which point it loads fine without any problems.


If you run 'ldd /usr/local/bin/ntpd', that might be informative.

Only option checked when doing make config on the port is the with 
OpenSSL option.


Consider not doing this-- OpenSSL has a much worse security history
than ntpd itself does.  In particular, the ASN.1 parser is infamous
for trouble, such as CVE-2012-2110.


if I execute: /usr/local/bin/ntpd -p /var/run/ntpd.pid
The result is a signal 11 core dump.


Run gdb against ntpd and the coredump you've gotten to see the crash
backtrace.  Or run ntpd under gdb.



Tried rebuilding without the with SSL option set, oddly it started once 
after that, but a restart caused same behavior.  gdb doesn't give me 
anything that I know how to interpret, gdb -c /ntpd.core.  (I haven't 
really used gdb before, so if I am not doing something correctly with 
it, please feel free to let me know)


GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and 
you are
welcome to change it and/or distribute copies of it under certain 
conditions.

Type show copying to see the conditions.
There is absolutely no warranty for GDB.  Type show warranty for 
details.

This GDB was configured as amd64-marcel-freebsd.
Core was generated by `ntpd'.
Program terminated with signal 11, Segmentation fault.
#0  0x0008006878c0 in ?? ()
(gdb) bt
#0  0x0008006878c0 in ?? ()
#1  0x0c78 in ?? ()
#2  0x0008006bf800 in ?? ()
#3  0x7fff0001 in ?? ()
#4  0x000800687836 in ?? ()
#5  0x7fffcb60 in ?? ()
#6  0x7fffcb48 in ?? ()
#7  0x0066 in ?? ()
#8  0x00080142b570 in ?? ()
#9  0x7fffcf80 in ?? ()
#10 0x0003 in ?? ()
#11 0x7fffcfc0 in ?? ()
#12 0x00080166037f in ?? ()
#13 0x7fffcd70 in ?? ()
#14 0x0008006bf800 in ?? ()
[..snip..]
#532 0x0008 in ?? ()
#533 0x in ?? ()
#534 0x0009 in ?? ()
#535 0x004040d0 in ?? ()
#536 0x0007 in ?? ()
#537 0x00080067f000 in ?? ()
#538 0x000f in ?? ()
#539 signal handler called
#540 0x in ?? ()
Previous frame inner to this frame (corrupt stack?)


Running from within gdb didn't give me much either.
proxy1# gdb
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and 
you are
welcome to change it and/or distribute copies of it under certain 
conditions.

Type show copying to see the conditions.
There is absolutely no warranty for GDB.  Type show warranty for 
details.

This GDB was configured as amd64-marcel-freebsd.
(gdb) set args -c /etc/ntp.conf
(gdb) file /usr/local/bin/ntpd
Reading symbols from /usr/local/bin/ntpd...(no debugging symbols 
found)...done.

(gdb) run
Starting program: /usr/local/bin/ntpd -c /etc/ntp.conf
(no debugging symbols found)...(no debugging symbols found)...(no 
debugging symbols found)...(no debugging symbols found)...(no debugging 
symbols found)...(no debugging symbols found)...(no debugging symbols 
found)...[New LWP 100873]

(no debugging symbols found)...[New Thread 801c07400 (LWP 100873/ntpd)]

Program exited normally.
(gdb) quit
proxy1# tail -f /var/log/messages
[..snip..]
Apr 23 13:55:43 proxy1 ntpd[95834]: ntpd 4.2.6p5@1.2349 Mon Apr 23 
18:23:07 UTC 2012 (1)

Apr 23 13:55:43 proxy1 ntpd[95836]: proto: precision = 0.699 usec
Apr 23 13:55:43 proxy1 kernel: pid 95836 (ntpd), uid 0: exited on 
signal 5 (core dumped)


However it seems to have made it farther before crashing.
gdb -c /ntpd.core
[..snip..]
#832 0x0005 in ?? ()
#833 0x0008 in ?? ()
#834 0x0006 in ?? ()
#835 0x1000 in ?? ()
#836 0x0008 in ?? ()
#837 0x in ?? ()
#838 0x0009 in ?? ()
#839 0x004040d0 in ?? ()
#840 0x0007 in ?? ()
#841 0x00080067f000 in ?? ()
#842 0x000f in ?? ()
#843 signal handler called
#844 0x in ?? ()
Previous frame inner to this frame (corrupt stack?)

Of course it still runs fine with the -d option set.

--
Thanks,
 Dean E. Weimer
 http://www.dweimer.net/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: ntpd problems after port updates

2012-04-23 Thread Chuck Swiger
On Apr 23, 2012, at 12:08 PM, Dean E. Weimer wrote:
 Tried rebuilding without the with SSL option set, oddly it started once after 
 that, but a restart caused same behavior.  gdb doesn't give me anything that 
 I know how to interpret, gdb -c /ntpd.core.  (I haven't really used gdb 
 before, so if I am not doing something correctly with it, please feel free to 
 let me know)

Ah, you need to build ntpd with -g in CFLAGS  LDFLAGS for debugging symbols to 
be present

Regards,
-- 
-Chuck

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: ntpd problems after port updates

2012-04-23 Thread Dean E. Weimer

On 23.04.2012 14:10, Chuck Swiger wrote:

On Apr 23, 2012, at 12:08 PM, Dean E. Weimer wrote:
Tried rebuilding without the with SSL option set, oddly it started 
once after that, but a restart caused same behavior.  gdb doesn't give 
me anything that I know how to interpret, gdb -c /ntpd.core.  (I 
haven't really used gdb before, so if I am not doing something 
correctly with it, please feel free to let me know)


Ah, you need to build ntpd with -g in CFLAGS  LDFLAGS for debugging
symbols to be present



at the risk of sounding like an complete n00b, how do I do that?  After 
reading through the make man page, I decided on trying to build the port 
with make CFLAGS+=-g LDFLAGS+=-g install clean however I still get the 
no debugging symbols found message.  Does the information in in the 
Makefile for the port overwrite this option from the command line?  Or 
am I just using the incorrect syntax here?


(gdb) file /usr/local/bin/ntpd
Reading symbols from /usr/local/bin/ntpd...(no debugging symbols 
found)...done.


--
Thanks,
 Dean E. Weimer
 http://www.dweimer.net/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org