Article View: news.software.nntp
Article #364nntpd time warp bug
From: Craig Leres
Date: Wed, 15 Nov 1989 06:02
Date: Wed, 15 Nov 1989 06:02
52 lines
2519 bytes
2519 bytes
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);
Technical Details
Message-ID:
<4218@helios.ee.lbl.gov>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!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!leresShow Full Headers
Complete Article Headers
Message-ID: <4218@helios.ee.lbl.gov> Subject: nntpd time warp bug Date: Wed, 15 Nov 1989 06:02:46 +0000 From: leres@ace.ee.lbl.gov (Craig Leres) Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!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 Newsgroups: news.software.nntp Sender: usenet@helios.ee.lbl.gov Reply-To: leres@helios.ee.lbl.gov (Craig Leres) Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 51