Path: utzoo!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!usc!ucsd!helios.ee.lbl.gov!ace.ee.lbl.gov!leres From: leres@ace.ee.lbl.gov (Craig Leres) Newsgroups: news.software.nntp Subject: nntpd time warp bug Message-ID: <4218@helios.ee.lbl.gov> Date: 15 Nov 89 06:02:46 GMT Sender: usenet@helios.ee.lbl.gov Reply-To: leres@helios.ee.lbl.gov (Craig Leres) Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 51 Yesterday I was pawing through the nntp logfiles and happened to noticed some unusual entries, for example: Nov 13 13:22:59 helios nntpd[21705]: pi6.lbl.gov times user 0.6 system 0.5 elapsed -0.8 The bug is in serve(). Cleverly, the start and finish times are being calculated by subtracting the microseconds from the seconds... A context diff is appened. (We're running 1.5.6 but I checked and the bug is in 1.5.7 too.) Craig ------ RCS file: RCS/serve.c,v retrieving revision 1.7 diff -c -r1.7 serve.c *** /tmp/,RCSt1a14346 Tue Nov 14 21:55:34 1989 --- serve.c Tue Nov 14 21:57:24 1989 *************** *** 215,221 **** timeptr = ctime(&start); #else not USG (void) gettimeofday(&start, (struct timezone *)NULL); ! Tstart = (double) start.tv_sec - ((double)start.tv_usec)/1000000.0; timeptr = ctime(&start.tv_sec); #endif not USG if ((cp = index(timeptr, '\n')) != NULL) --- 215,221 ---- timeptr = ctime(&start); #else not USG (void) gettimeofday(&start, (struct timezone *)NULL); ! Tstart = (double) start.tv_sec + ((double)start.tv_usec)/1000000.0; timeptr = ctime(&start.tv_sec); #endif not USG if ((cp = index(timeptr, '\n')) != NULL) *************** *** 329,335 **** sys = (double)(cpu.tms_stime + cpu.tms_cstime) / HZ; #else not USG (void) gettimeofday(&finish, (struct timezone *)NULL); ! Tfinish = (double) finish.tv_sec - ((double)finish.tv_usec)/1000000.0; (void) getrusage(RUSAGE_SELF, &me); (void) getrusage(RUSAGE_CHILDREN, &kids); --- 329,335 ---- sys = (double)(cpu.tms_stime + cpu.tms_cstime) / HZ; #else not USG (void) gettimeofday(&finish, (struct timezone *)NULL); ! Tfinish = (double) finish.tv_sec + ((double)finish.tv_usec)/1000000.0; (void) getrusage(RUSAGE_SELF, &me); (void) getrusage(RUSAGE_CHILDREN, &kids);