Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 Couple bugs
Yesterday, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, DotBot, Google

Members: 0
Guests: 18
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » Act Crash
Forum Rules | Mark all | Recent Posts

Act Crash
< Newer Topic :: Older Topic > Stumped :(

Pages:<< prev 1 next >>
* #1 Jul 19, 2013, 10:38 am
Go to the top of the page
Go to the bottom of the page

Aurin
Magician
GroupMembers
Posts189
JoinedSep 5, 2010

Okay, have a crash that I've been dealing with for some time, that has been intermittent and have been adding in more and more logging information as time goes by. I'm now able to throw together the possible cause, but I'm not quite sure how to fix it, given logging information received.

Here's the crash dump:
#0  0x00000000004a844a in act (AType=48,
    format=0x1095b80 "$n greets $N warmly.", ch=0x27eb320, arg1=0x0,
    arg2=0x283a420, type=1) at comm.c:3032
3032        if(HAS_PROG(to->in_room, ACT_PROG) && to)
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.107.el6.x86_64 libgcc-4.4.7-3.el6.x86_64 libstdc++-4.4.7-3.el6.x86_64 nss-softokn-freebl-3.12.9-11.el6.x86_64 zlib-1.2.3-29.el6.x86_64
(gdb) bt
#0  0x00000000004a844a in act (AType=48,
    format=0x1095b80 "$n greets $N warmly.", ch=0x27eb320, arg1=0x0,
    arg2=0x283a420, type=1) at comm.c:3032
#1  0x0000000000511d35 in check_social (ch=0x27eb320,
    command=<value optimized out>, argument=<value optimized out>)
    at interp.c:779
#2  0x0000000000512b81 in interpret (ch=0x27eb320,
    argument=0x7fff5307fe16 "azoth") at interp.c:486
#3  0x00000000004ab48e in game_loop () at comm.c:1334
#4  0x00000000004aec43 in main (argc=<value optimized out>,
    argv=<value optimized out>) at comm.c:859


Here's the section of comm.c called out:
/* Volk - object socials */
  bool                    actobj = FALSE;

  if((type == TO_CHAR || type == TO_NOTVICT) && arg2 == NULL && AType == AT_SOCIAL)
    actobj = TRUE;

  // Possible bug fix using Remcon's code from LoP
  if(MOBtrigger && type != TO_CHAR && type != TO_VICT && type != TO_THIRD && to)
  {
    OBJ_DATA               *to_obj;

    txt = act_string(format, NULL, ch, arg1, arg2, STRING_IMM, actobj);

    if (!to)
    {
      bug("%s", "act: null to comm.c 2971", __FUNCTION__);
      return;
    }
	
	if(HAS_PROG(to->in_room, ACT_PROG) && to)  <--------Crash here
      rprog_act_trigger(txt, to->in_room, ch, (OBJ_DATA *)arg1, (void *)arg2);
	  
	// Possible bug fix addition. - Aurin
    if(!to->in_room && (to->position != POS_DEAD || !char_died(to)))
	{
	  bug("Act: to in NULL room");
	  bug("%s was not in room %d", to->name, to->in_room->vnum);
	  return;
	}


    for(to_obj = to->in_room->first_content; to_obj; to_obj = to_obj->next_content)
      if(HAS_PROG(to_obj->pIndexData, ACT_PROG))
        oprog_act_trigger(txt, to_obj, ch, (OBJ_DATA *)arg1, (void *)arg2);
  }


I was able to locate the "$n greets $N warmly." string within the Socials.dat, and it's directly related to the Greet social:
#SOCIAL
Name        greet~
CharNoArg   You greet everyone in the room.~
OthersNoArg $n greets you with a pleasant smile.~
CharFound   You warmly greet $N, saying "Well met, $N! How fare thee, on this fine day?"~
OthersFound $n greets $N warmly.~
VictFound   $n smiles at you and says, "How fare thee on this fine day, $N?"~
End


From the bugs log within the game itself, I get this on the crash:
[*****] BUG: Act: vch in NULL room! 
[*****] BUG: Londonknight -> (null) ($n smiles at you and says, "How fare thee on this fine day, $N?") 
[*****] BUG: act_string: NULL i, preventing a crash and setting it to Unknown! 

The first 2 lines are found at comm.c ACT_SECRETIVE handling:
  /*
   * ACT_SECRETIVE handling
   */
  if(IS_NPC(ch) && xIS_SET(ch->act, ACT_SECRETIVE) && type != TO_CHAR)
    return;

  if(type == TO_VICT)
  {
    if(!vch)
    {
      bug("Act: null vch with TO_VICT.");
      bug("%s (%s)", ch->name, format);
      return;
    }
    if(!vch->in_room && (vch->position != POS_DEAD || !char_died(vch)))
    {
      bug("Act: vch in NULL room!");  <----Bug points here
      bug("%s -> %s (%s)", ch->name, vch->name, format); <-----Bug points here
      return;
    }
    to = vch;
  }

Since the secretive flag is a rare flag to be used on my mud, I thought it wouldn't be relatively difficult to track down. However, I lack documentation on the decimal values for the actflags, which kind of slows down the process. While I could go through and add something in that would give a list of the values, I want to first ask if anyone has this done already--or, rather an easy way to do it, as I understand it won't be the same on all muds?

Anyway, the only mob I could find with the Secretive flag was the supermob (vnum 3). This would explain bug report 3, stating that "i" is NULL, since it would target the supermob by it's name...but it wouldn't necessarily remain the same during the trigger process if there are other things going on at the same time.

That said, a player who no longer exists--which makes it difficult to track down the exact cause, for me at least--I am unable to track down the object in question, as a search through the area files fails to return a greet social under any of the progs. Is there a way to fix this crash from happening again, without having to find the object and fixing it? I'm more than okay with a bug report that returns out of the function, so long as it names the object that causes the problem so I can get it fixed.
       
Post is unread #2 Jul 19, 2013, 6:42 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

well where you have it giving the bug messages toss in to have it show the vnums if it is a mob doing it or the description if it is the supermob for info on what program you need to look at for it.
       
Post is unread #3 Jul 19, 2013, 6:46 pm   Last edited Jul 19, 2013, 6:53 pm by Remcon
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

#2  0x0000000000512b81 in interpret (ch=0x27eb320,
    argument=0x7fff5307fe16 "azoth" ) at interp.c:486

that tells you though that it was using azoth as the one it was greeting at least.
       
Post is unread #4 Jul 19, 2013, 8:04 pm
Go to the top of the page
Go to the bottom of the page

Aurin
Magician
GroupMembers
Posts189
JoinedSep 5, 2010

Hrm...I completely overlooked that.

So, I can say that Londonknight (player) was trying to greet Azoth (player). Okay...but, the only way for the bug to trigger is if Azoth was not in the room, but still alive/connected...that being directly after a check to see if vch (Azoth in this case) existed...though it returned a null immediately on the next bug check.

Hmm...I have been having some issues with the code actually recognizing players who have not been Auth'd yet (mstat <player> returns nothing until the player is Auth'd, for example), but I haven't been able to pin that particular problem down as yet...I don't remember making any such changes, but I suppose I could have indirectly effected it somehow. Think that may be why vch->name returned NULL.

Sigh...2 separate issues then, that may not be directly related (between the bugs shown and the crash experienced). :(
       
Post is unread #5 Jul 19, 2013, 9:02 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

try changing this
   if( MOBtrigger && type != TO_CHAR && type != TO_VICT && type != TO_OTHERS && to )
   {
      OBJ_DATA *to_obj;

      txt = act_string( format, NULL, ch, arg1, arg2, STRING_IMM );
      if( HAS_PROG( to->in_room, ACT_PROG ) )
         rprog_act_trigger( txt, to->in_room, ch, ( OBJ_DATA * ) arg1, ( void * )arg2 );
      for( to_obj = to->in_room->first_content; to_obj; to_obj = to_obj->next_content )
         if( HAS_PROG( to_obj->pIndexData, ACT_PROG ) )
            oprog_act_trigger( txt, to_obj, ch, ( OBJ_DATA * ) arg1, ( void * )arg2 );
   }

to this
   if( MOBtrigger && type != TO_CHAR && type != TO_VICT && type != TO_OTHERS && to )
   {
      OBJ_DATA *to_obj;

      if( !to->in_room )
      {
         bug( "%s: to->in_room is NULL", __FUNCTION__ );
         if( is_npc( ch ) )
         {
            if( ch == supermob )
               bug( "%s: %s(%s) -> %s", __FUNCTION__, ch->name, supermob->description, to->name );
            else
               bug( "%s: %s(%d) -> %s", __FUNCTION__, ch->name, ch->pIndexData->vnum, to->name );
         }
         else
            bug( "%s: %s -> %s", __FUNCTION__, ch->name, to->name );
         return;
      }
      txt = act_string( format, NULL, ch, arg1, arg2, STRING_IMM );
      if( HAS_PROG( to->in_room, ACT_PROG ) )
         rprog_act_trigger( txt, to->in_room, ch, ( OBJ_DATA * ) arg1, ( void * )arg2 );
      for( to_obj = to->in_room->first_content; to_obj; to_obj = to_obj->next_content )
         if( HAS_PROG( to_obj->pIndexData, ACT_PROG ) )
            oprog_act_trigger( txt, to_obj, ch, ( OBJ_DATA * ) arg1, ( void * )arg2 );
   }

The main crash seems to be from the HAS_PROG check and I think it has to do with the act_string bug message you got where i was NULL. this will hopefully help you out with that issue and point out what you need to look at.
       
Post is unread #6 Jul 19, 2013, 9:05 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005


So, I can say that Londonknight (player) was trying to greet Azoth (player). Okay...but, the only way for the bug to trigger is if Azoth was not in the room, but still alive/connected...that being directly after a check to see if vch (Azoth in this case) existed...though it returned a null immediately on the next bug check.

While odd it means that it wasn't NULL just all the data was for it lol,
       
Post is unread #7 Jul 20, 2013, 8:06 am
Go to the top of the page
Go to the bottom of the page

Aurin
Magician
GroupMembers
Posts189
JoinedSep 5, 2010

Remcon said:


<br />
So, I can say that Londonknight (player) was trying to greet Azoth (player). Okay...but, the only way for the bug to trigger is if Azoth was not in the room, but still alive/connected...that being directly after a check to see if vch (Azoth in this case) existed...though it returned a null immediately on the next bug check.
<br />

<br />
While odd it means that it wasn't NULL just all the data was for it lol,

Right, just for the value checked. Didn't mean to imply the pfile was NULL/corrupted. heh Again, I think this might be related to another issue I'm having where I cannot target a player with any command until he's auth'd. Wonder if it's somewhere in CAN_SEE? Was finally able to push a crash out of there, now it's happening elsewhere, though less frequently. :(

As to that, this is all that was changed, really:
  // Broke this down to a line-by-line look to see exactly what is failing - Aurin
  if(!IS_NPC(victim))
	if(xIS_SET(victim->act, PLR_WIZINVIS)) 
		if(get_trust(ch) < victim->pcdata->wizinvis)
		  return FALSE;

Hasn't crashed again since I did that, so not quite sure how that's effecting everything as there's no real change...though it stopped the crashes there. :shrug:
       
Post is unread #8 Jul 20, 2013, 2:18 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

well anytime you get a crash to stop that is always good, now you just have to figure out the other issue with seeing people who aren't authed, can_see is a great place to start on that one.
       
Pages:<< prev 1 next >>