Re: Crashes

From: Sammy (samedi@clark.net)
Date: 07/09/96


On Sun, 7 Jul 1996, Brian Williams - Nashak wrote:

> Well, every like.. 30 minutes or so.. my mud crashes... doesn't show up 
> in the logs, and I don't have gdb.. and I don't neccisarily want it.. 
> well, I have no idea what is causing the crashes.. it's not when a god 
> types anything.. so it's not a bug in a command.. anyone got any ideas? I 
> might have to get gdb...

First of all, get GDB :)

Second, here's a nasty non-bug I've recently run accross in circle which 
I'm pretty sure applies to stock circle (saw this happen in pl10 but I'd 
expect it to apply to all patches).  If for some reason during offline 
building someone adds an extra description but leaves a blank keyword, 
the mud boots fine and you can load a copy of that object just fine, but 
if you stat the object or use a command that looks through your eq for a 
named object, the mud will crash.

The way this happened in my case was a certain immortal would crash the 
mud regularly any time he tried to read boards or mail.  He had an object 
with an extra description with no keyword, and the read mail command 
searched his inventory for anything called mail, but when it came across 
the bugy item there was no error checking in isname for null strings.

Anyway, isname assumes neither string is null because it's built for 
speed and the null checking is better left to hgher-level functions, so 
my fix was to put a check in parse_object.  Here's what I did:

Add this variable:

  char tbuf[5112];

And after this line:

      new_descr->keyword = fread_string(obj_f, buf2);

Add these:

      if(!new_descr->keyword)
	sprintf(tbuf, "SYSERR:  Obj #%d has empty edesc keyword.",
	  obj_index[i].virtual);
	log(tbuf);
	new_descr->keyword = str_dub("empty");
      }

This will fix the problem by putting a keyword on the buggy extra 
descriptions, and will let you know via the syslog file that you need to 
fix the objects.

Sam



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