[CODE] Problem with Stock Code in Comm.c

From: Justin Adler (spam@WORLD-DOMINATION.COM.AU)
Date: 05/27/03


Hello Folks.

   we've been using code from bp11 (or was it 12), and have no troubles
with this section of code in comm.c

   Just last week, the mud failed to reboot, and still does.

   It hangs (infinite loop) in comm.c

   We tried updating the current *section* in comm.c to latest version of
circle, and it's still doing the same thing. (infinite loop).

here is OUR code (take note of the snprintf's for debugging), and what is
happening...

<around line comm.c:780>

    /* Calculate the time we should wake up */
    timediff(&temp_time, &opt_time, &process_time);
    timeadd(&last_time, &before_sleep, &temp_time);

  snprintf (buf, sizeof(buf), "wake time %ld %ld",
           last_time.tv_usec, last_time.tv_sec);
  log(buf);

    /* Now keep sleeping until that time has come */
    gettimeofday (&now, (void *)NULL);
    timediff(&timeout, &last_time, &now);

  snprintf (buf, sizeof(buf), "last time %ld %ld",
           timeout.tv_usec, timeout.tv_sec);
  log(buf);
    /* Go to sleep */
    do {
      circle_sleep(&timeout);
      gettimeofday (&now, (void *)NULL);
      //timeout = timediff (last_time, now);
      timediff(&timeout, &last_time, &now);
  snprintf (buf, sizeof(buf), "last time loop %ld %ld",
           timeout.tv_usec, timeout.tv_sec);
  log(buf);
    } while (timeout.tv_usec || timeout.tv_sec);

...

<output>
...
May 27 10:04:43 :: Boot db -- DONE.
May 27 10:04:43 :: Entering game loop.
May 27 10:04:43 :: wake time 457763 1054047883
May 27 10:04:43 :: last time 99679 0
May 27 10:04:43 :: last time loop 0 0
May 27 10:04:43 :: wake time 557763 1054047883
May 27 10:04:43 :: last time 89061 0
May 27 10:04:43 :: last time loop 0 21024933
May 27 10:04:43 :: last time loop 0 21024933
May 27 10:04:43 :: last time loop 0 21024933
May 27 10:04:43 :: last time loop 0 21024933
May 27 10:04:43 :: last time loop 0 21024933
May 27 10:04:43 :: last time loop 0 21024933
.....

please help! suggestions?

-Jussy-

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/26/03 PDT