✘ntpd segfault

Gary E. Miller gem at rellim.com
Fri Aug 31 01:36:09 UTC 2018


Yo Eric!
 
> > Gary E. Miller via devel <devel at ntpsec.org>:  
> > > I'm seeing something new and odd with NTPsec git head.  When I
> > > kill the old ntpd to start a new one, this is in my logs:
> > > 
> > > [834374.559668] ntpd[8904]: segfault at 88 ip 00005581071fb466 sp
> > > 00007fff53c460c0 error 4 in ntpd (deleted)[5581071c2000+7f000]    

> I see the gpsd_shutdown() function was changed in that commit.  The
> only change in refclock_gpsd.c.  I do not understand the change.

By funny coincidence, my gcc 8.2.0 just found this:

[ 86/135] Compiling ntpd/refclock_modem.c
In file included from ../../include/ntp_stdlib.h:18,
                 from ../../include/ntp.h:15,
                 from ../../ntpd/refclock_gpsd.c:70:
../../ntpd/refclock_gpsd.c: In function 'gpsd_shutdown':
../../ntpd/refclock_gpsd.c:626:21: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'int' [-Wformat=]
        (LOG_NOTICE, "%s: shutdown: gpsd_json(%d)", unit));
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~

Which happens to flag one of the changes in the problem commit:

-             (LOG_NOTICE, "%s: shutdown", refclock_name(peer)));
+             (LOG_NOTICE, "%s: shutdown: gpsd_json(%d)", unit));

Sure looks like a potential segfault....

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 851 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20180830/d30a74e5/attachment.bin>


More information about the devel mailing list