nasty amd64 date bug?

Bruce Evans bde at zeta.org.au
Thu Nov 17 12:01:47 PST 2005


On Thu, 17 Nov 2005, Axel Gonzalez wrote:

> $ date -r 190300000000
> Sun May 14 01:06:40 CST 8000
>
> This is probably a bios error, that can't handle dates so much in the future
>
> This happens only on amd64, because it uses 64 bits utimes.

amd64 has 64 bit time_t's.  There are no utimes here.

> On i386, with 32 bits utimes, the maximun date is about 2032, so the bios
> shouldn't have problems with that date (remember the *nix version of the y2k
> problem ??)

This shows that 64-bit time_t's don't actually work.  Probably something is
looping about 190000000000 times.  There used to be such a loop in kern_tc.c.
This loop still has overflow bugs in its sanity checking (see rev.1.156)
but these only reduce the amount of looping for steps larger than INT_MAX
and increase it from 0 iterations to at most LARGE_STEP = 200 iterations for
steps smaller than INT_MAX.

> So this is not really a bug, is a feature ;)

Nah.

[Context lost to top posting.]

Bruce


More information about the freebsd-amd64 mailing list