🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
1 messages
1 total messages Started by Craig Leres Wed, 15 Nov 1989 06:02
nntpd time warp bug
#364
Author: Craig Leres
Date: Wed, 15 Nov 1989 06:02
52 lines
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);
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads