Re: [NEWBIE] crash bug in my mud

From: Sean Daley (sdaley@BBNPLANET.COM)
Date: 09/23/98


At 06:14 PM 09/23/1998 -0400, you 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:
>

That str=0x0 says you've got a null string here.  That's
what's causing it to crash (most likely).

>#0  replace_string (str=0x0, weapon_singular=0x80b11f4 "blast",
>    weapon_plural=0x80b11ed "blasts") at fight.c:447

I'm going to guess that you modified dam_messages in fight.c
so that players can have more damage messages sent to them.
Given from the backtrace, dam = 100, then it's probably
trying to call a non-existant dam_weapons message.
What you have to do is make sure that in the section where you
do ...

if (dam == 0)   msgnum = 0;
else if (dam <= 2)      msgnum = 1;
...
else if (dam <= xxx)    msgnum = y;

That you have set up a total of y+1 msgs for to_room, to_char
, and to_victim.  This is setup in the struct which is defined
at the beginning of the function.

So if it's setting msgnum = 15 and you only go from 0..14 in
dam_weapons, then this would be bad.

In your case, look in that if statement to find out what message
it's trying to set for dam = 100 and make sure that that message
actually exists.

Also, make sure for each msgnum that there are 3 messages in
the struct (one for to_char, to_victim, and to_room)

Hope this helps.

Sean


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



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