Re: Ticks not updated, knowing why.

From: ShadowLord (dkoepke@california.com)
Date: 07/07/96


On Mon, 8 Jul 1996, Rasmus 'Con' Ronlev wrote:

> All I get is ticks not updated errors on the commands quit and kill.
> I might've found the cause of the kill stuff, as there was a level 0 mob 
> on the mud, it's fixed now, but it's yet to be seen if it works :)
> On the quit command however, I'm totaly left out in the bare. It's not 
> happening the first time someone quits, just 'sometime' when the mud 
> feels like it.. 
> 
> Any help and/or sugestions how to track down such 'tick bugs' is 
> appreciated.

Tick not updated errors only occur when the MUD does not update ticks for
quite a while.  This can really only occur if the MUD hits an inifinite
loop or the code is doing something that is taking a long time to
complete.  I believe in stock CircleMUD, this occurs after 11 minutes.
The problem is that it cannot be remedied by gdb because gdb's backtrace
lists off where the MUD "crashed" -- since the MUD is dying via signal,
the backtrace shows what exit() called to shutdown the MUD [not helpful].

The only way to catch said bugs is to examine your code for loops that
will never end.  Eg., the below code will never end:

  for (a = 0; a < 2; a++)
    a = 0;

The logic is simple.  The variable 'a' will always be under 2 because it's
set to 0 before it's incremented.  This is the simple case.  Things like
these are the easier ones to catch, but sometimes you run into this when
it's not so simple.  If you're calling functions inside of a loop, make
sure you examine the functions you've written to make sure that they don't
modify the data you're using in the loop.

These are hard to spot, so take your time and look over the code that
theoritically, "Can't be the problem."

	-dak



This archive was generated by hypermail 2b30 : 12/07/00 PST