✘Build failure

Eric S. Raymond esr at thyrsus.com
Fri Sep 1 03:35:03 UTC 2017


Fred Wright via devel <devel at ntpsec.org>:
> Here I don't see build failures (admittedly without all Gary's options),
> but I do see a test failure (OSX):
> 
> TEST(clocktime, CurrentYearExplicit)../../tests/libntp/clocktime.c:59::FAIL: Expected 3486372600 Was 104913720
> 
> This bisects to commit 5489ed5a593c8e14138e47544a1598d4c6576dee.

That's interesting.  Doesn't fail here or on Gitlab.  (The Gitlab failures
are elsewhere and confined to FreeBSD.)

The relevant section of code of code is this in libntp/clocktime.c:

	/*
	 * Year > 1970 - from a 4-digit year stamp, must be greater
	 * than POSIX epoch. Means we're not dependent on the pivot
	 * value (derived from the packet receipt timestamp, and thus
	 * ultimately from the system clock) to be correct. CLOSETIME
	 * clipping to the receive time will *not* be applied in this
	 * case. These two lines thus make it possible to recover from
	 * a trashed or zeroed system clock.
	 *
	 * Warning: the hack in the NMEA driver that rectifies 4-digit
	 * yearts from 2-digit ones has an expiration date in 2399.
	 * After that this code will go badly wrong.
	 */
	if (year > 1970) {
	    *yearstart = year_to_ntp(year);
	    return  (int32_t)*yearstart + tmp;
	}


Something about the expression "(int32_t)*yearstart + tmp" is computing
differently under MacOS than elsewhere.  Anyone got any ideas?
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>

Please consider contributing to my Patreon page at https://www.patreon.com/esr
so I can keep the invisible wheels of the Internet turning. Give generously -
the civilization you save might be your own.



More information about the devel mailing list