Re: [BUG] Large IDNums

From: Patrick Dughi (dughi@imaxx.net)
Date: 03/25/00


> On Fri, 24 Mar 2000, Pat O'Laughlin wrote:
>
> > I have come across a bug on my MUD.  ID Numbers on new characters are
> for some > reason being created EXTREMELY large.  Right now, they are
> around 25690519.  > They still are created in consecutive order but
> somehow they skipped a few million > numbers.  This doesn't seem like a
> major problem, but if it is I would like to know.  If > anyone knows why
> this happens and how to fix it, please let me know.
>
        Never seen it happen before, so I'd bet it's associated with some
new functionality you put in the code.  Go though and check everything
you've put in, especially patches which you yourself have not written.
Since someone else claimed the same issue, it's probably a patch problem.

        Not that it will necessarily help you, but a long time ago when I
was restoring a mud from a previous coder's efforts to ..I don't
know...potentially convert it to c++ by way of lisp I think... we were
having alot of crashes, most caused by some new command or function.  I
kept a global variable around which was simply a copy of the last couple
of user-entered commands before the crash.  Since alot of the crashes
would not show up until the next mob/obj/player update (someone really
should have learned how to deal with memory), this was the only real data
I had to go on, since the core just said it had crashed in mobile
activity.  This sort of passive debugging helper is nice and usable in
alot of situations whhere the error is just a symptom of a bigger problem.

        If you do a wipe to start out on normal numbers, and then, heck, I
dunno, throw something in the end of some main functions which check for
the existance of idnums > 10000 or so, I'm sure you'll be able to catch
when this random thing happens - throwing it in around any GET_IDNUM()
macros, or direct idnum references might be a good start.  If you think
it's a player command eventually causing it, you may want to do what I
did (though, since yours doesn't crash, probably a 1 shot log message
would probably be good).

if(GET_IDNUM(ch) > <some arbitraily high value && !found_hiid) {
  log("In function _x_ we have a high value for idnum");
  found_hiid=1;  /* global var, don't want to get this message 1,000,000
                        times. */
}

        Worse comes to worse, you can rewrite how circle chooses new
idnums.  Though it's bad (for reasons discussed long ago) to simply try to
fill in the holes, i'm sure there's a happy solution right there.  I state
the logging info above because I get the feeling that you're not as
confident with the code, and that logging is pretty simple.

                                                        PjD


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT