All of lore.kernel.org
 help / color / mirror / Atom feed
* time() glitch on 2.4.18 at 177 days uptime?
@ 2002-11-02  6:37 Jim Paris
  2002-11-03 19:32 ` time() glitch on 2.4.18: solved Jim Paris
  0 siblings, 1 reply; 30+ messages in thread
From: Jim Paris @ 2002-11-02  6:37 UTC (permalink / raw)
  To: linux-kernel

I'm running Linux 2.4.18 on an Athlon (i386).

My uptime is 182 days.  About five days ago, I started noticing
strange date effects.  It may be hardware related, but I'm also
suspecting that it may be due to the long uptime, and so I'm hesitant
to reboot, in case there is a bug here that needs to get fixed.

The problem is with time().  Every second, for approximately 1.1ms,
time() reports a value that is about 2^32 microseconds (4295 seconds,
or about an hour and a quarter) in the future.  The glitches always
occur between a change of seconds.  Look at this:

$ while true; do paste <( cat /proc/uptime ) <( date ) ; done | grep -A 1 -B 1 ' 02:' | head -11
15765463.31 15455589.84	Sat Nov  2 00:59:16 EST 2002
15765463.32 15455589.84	Sat Nov  2 02:10:51 EST 2002
15765463.33 15455589.84	Sat Nov  2 00:59:17 EST 2002
--
15765465.31 15455589.84	Sat Nov  2 00:59:18 EST 2002
15765465.32 15455589.84	Sat Nov  2 02:10:53 EST 2002
15765465.34 15455589.84	Sat Nov  2 00:59:19 EST 2002
--
15765466.30 15455589.84	Sat Nov  2 00:59:19 EST 2002
15765466.32 15455589.84	Sat Nov  2 02:10:54 EST 2002
15765466.33 15455589.84	Sat Nov  2 00:59:20 EST 2002

The first two values on each line are from /proc/uptime, and the rest
is of course from "date".  This bash script runs a bit slow, which is
why it missed the glitch between :17 and :18, but by watching time()s
more frequently, I can definitely see that they're there.  I don't
know for certain whether this happens at all times during the day, but
I believe it does.  I can do some more logging to figure that out if
necessary.

I've been running ntpdate (and therefore calling do_adjtime()) every
half hour since the system booted, in case that might affect
something.

This glitch does _not_ occur on a 2.2.? system on some x86 processor
with about 256 days uptime (I unfortunately don't know any more
details than that; I only have very limited access to that machine).
I also don't have access to any other 2.4 systems with an uptime of
greater than about 80 days.

This is not a glibc bug; the erroneous values are being returned by
the kernel.  Perhaps someone can help me track this down.  I've put my
kernel config and relevant info from /proc at

    http://neurosis.mit.edu/~jim/time-glitch/

(and would appreciate a CC of any replies)

-jim

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2002-11-06 23:15 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-02  6:37 time() glitch on 2.4.18 at 177 days uptime? Jim Paris
2002-11-03 19:32 ` time() glitch on 2.4.18: solved Jim Paris
2002-11-03 20:30   ` Alan Cox
2002-11-05 16:30     ` [PATCH] " Jim Paris
2002-11-05 16:54       ` george anzinger
2002-11-05 17:10       ` Willy Tarreau
2002-11-05 18:16         ` Alan Cox
2002-11-05 18:02           ` Jim Paris
2002-11-05 18:37             ` Alan Cox
2002-11-05 18:20               ` Willy Tarreau
2002-11-05 18:50                 ` Jim Paris
2002-11-05 17:14       ` Willy Tarreau
2002-11-05 17:42         ` Jim Paris
2002-11-05 18:57           ` Richard B. Johnson
2002-11-05 19:08             ` Willy Tarreau
2002-11-05 19:29               ` Richard B. Johnson
2002-11-05 20:07                 ` Alan Cox
2002-11-05 20:14                   ` Willy Tarreau
2002-11-05 20:38                     ` Richard B. Johnson
2002-11-05 23:15                       ` Willy Tarreau
2002-11-06 12:47                         ` Richard B. Johnson
2002-11-06 13:25                           ` Alan Cox
2002-11-06 23:21                             ` Jim Paris
2002-11-05 20:23                   ` Richard B. Johnson
2002-11-05 20:57                     ` Alan Cox
2002-11-05 20:41                       ` Richard B. Johnson
2002-11-06 15:09                         ` Christer Weinigel
2002-11-06 15:49                           ` Richard B. Johnson
2002-11-05 20:06             ` Alan Cox
2002-11-05 17:32       ` Alan Cox

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.