Port-sparc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ntpd wedged by libc?



On 3/11/2012 09:39, Christos Zoulas wrote:
On Mar 10,  9:37pm, agcarver+netbsd%acarver.net@localhost (AGC) wrote:
-- Subject: Re: ntpd wedged by libc?

| On 3/10/2012 20:14, Dave Hart wrote:
|>  On Sun, Mar 11, 2012 at 03:14, Christos 
Zoulas<christos%zoulas.com@localhost>   wrote:
|>>  On Mar 10,  2:56pm, agcarver+netbsd%acarver.net@localhost (AGC) wrote:
|>>  | Well, that didn't take long:
|>>  |
|>>
|>>  Hmm, does not seem to leak for me. Here's how I tested it:
|>
|>  Thanks for trying.   A question and a suggestion below.
|>
|>
|>  Assuming you're testing this on sparc32, is it necessary to byte-swap
|>  with be64toh()?  Did you verify, for example, that the last value in
|>  the log interpreted as a double is -4.2612301185727119?

It is portable to do it this way. I am testing on amd64. I have sparc64 but
no sparc32.

|>  You might be able to tickle it by changing this to:
|>
|>  fprintf(fp, "%g %.2f %.3f", u.d, u.d, u.d);

Will try, thanks!

Ok, it seems that the memory leak isn't occuring anymore but there may be an infinite loop problem. Using the snprintf workaround in ntpd, it still wedged a couple days ago using over 80% CPU. The memory usage jumped up some (from 5M to 10M) but it did not go beyond that even though I let it run in the wedged condition for hours.

The back trace is below. The daemon was running for about 12 days straight with no problems and then suddenly wedged.

Could this be a threads issue? Reading the header in libc/gdtoa/gdtoimp.h I see that pow5mult is a multithreaded function. Is there a chance for cross thread clobbering or is it just a case of a termination condition not being met in a loop and letting things spin out of control?

#0  0x103c33fc in .umul () from /usr/lib/libc.so.12
#1  0x103b58ec in __pow5mult_D2A () from /usr/lib/libc.so.12
#2  0x103b5adc in __muldi3 () from /usr/lib/libc.so.12
#3  0x103b5494 in __mult_D2A () from /usr/lib/libc.so.12
#4  0x103b56e4 in __pow5mult_D2A () from /usr/lib/libc.so.12
#5  0x103a8138 in __dtoa () from /usr/lib/libc.so.12
#6  0x103a50c0 in __vfprintf_unlocked () from /usr/lib/libc.so.12
#7  0x103a64f8 in vfprintf () from /usr/lib/libc.so.12
#8  0x103a184c in fprintf () from /usr/lib/libc.so.12
#9 0x00042518 in record_peer_stats (addr=0xb3890, status=37917, offset=0.001765422523021698, delay=0.077142598573118448, dispersion=0.0025113349042817576, jitter=0.0001220703125) at ntp_util.c:536 #10 0x00036f38 in clock_filter (peer=0xb3880, sample_offset=0.001765422523021698, sample_delay=<value optimized out>,
    sample_disp=0.00012418112579500303) at ntp_proto.c:2350
#11 0x0003772c in process_packet (peer=0xb3880, pkt=0x10522058, len=48) at ntp_proto.c:1776
#12 0x00039110 in receive (rbufp=0x10522000) at ntp_proto.c:1459
#13 0x000233e8 in ntpdmain (argc=0, argv=0xefffedf4) at ntpd.c:1069
#14 0x0001387c in ___start ()
#15 0x000137b4 in _start ()


Home | Main Index | Thread Index | Old Index