Re: [NEWBIE] crash bug in my mud

From: Cervo (chrisf@PTD.NET)
Date: 09/23/98

On Wed, 23 Sep 1998, John Hines wrote:

> I have been having problems with my mud crashing in fights or in the
> process of fights whenever more than 1 player is logged into the mud
> I have used gdb to search a core that got dumped into my lib.
> the following is the result:

Cheers, newbies take note :)

> #0  replace_string (str=0x0, weapon_singular=0x80b11f4 "blast",
>     weapon_plural=0x80b11ed "blasts") at fight.c:447
Right here is  your problem, str=0x0 means that you are calling it with a
NULL string, the error is where you call it, meaning you'll want to search
dam_messages and damage and hit for it.  Perform violence is probably
okay, but check the rest first, and after that check perform_violence if
you can't find the error.  Maybe you are freeing a string to early with
free, or something like that.  You are sending an empty string for the
first argument to replace string, so work from there.

str++) { > (gdb) backtrace
Your error isn't in replace_string, you'll want to search those other
functions.  Of course it might be a good idea at the beginning of
replace_string to add a check

if (str==NULL) {
  // Some stuff here to log there is a problem.

But in conclusion your problem is before replace_string is called,
probably dam message or hit.  It will not be before perform violence,
because if heartbeat had an error in it all fights and pretty much the
entire mud would be scrwed.  I therefore think you should check hit and
dam messages.

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

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