Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Development
Nov 28, 2018, 10:10 am
By Keirath
First Immortal
Oct 12, 2018, 12:02 pm
By GatewaySysop
Bug in do_climb( )
Jun 5, 2018, 5:31 pm
By joeyfogas
question on overland code
May 31, 2018, 10:03 am
By joeyfogas
KaVir's Protocol Snip
May 15, 2018, 7:57 pm
By joeyfogas
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Yandex

Members: 0
Guests: 17
Stats
Files
Topics
Posts
Members
Newest Member
481
3,740
19,397
633
Rhyader
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » Multiple crashes - Need help
Forum Rules | Mark all | Recent Posts

Multiple crashes - Need help
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Jul 10, 2012, 5:03 pm
Go to the top of the page
Go to the bottom of the page

Aurin
Magician
GroupMembers
Posts189
JoinedSep 5, 2010

:headbang: So, I've been banging my head against this for the past couple weeks, and have made no headway. If anyone can help or suggest a direction, I'd greatly appreciate it!

gdb infos, I have a number of them:
#0  act (AType=6, format=0x82f6cb0 "$p slowly seeps into the ground.",
    ch=0x97d7de8, arg1=0x97e8e20, arg2=0x0, type=0) at comm.c:2981
2981        to = ch->in_room->first_person;
(gdb) bt
#0  act (AType=6, format=0x82f6cb0 "$p slowly seeps into the ground.",
    ch=0x97d7de8, arg1=0x97e8e20, arg2=0x0, type=0) at comm.c:2981
#1  0x082444db in obj_update () at update.c:2868
#2  0x0824acb9 in update_handler () at update.c:3557
#3  0x081031f2 in game_loop () at comm.c:1351
#4  0x08106b01 in main (argc=2, argv=0xbfb14494) at comm.c:859

related code in comm.c:
void act(short AType, const char *format, CHAR_DATA *ch, const void *arg1, const void *arg2, int type)
{
  char                   *txt;
  CHAR_DATA              *to;
  CHAR_DATA              *vch = (CHAR_DATA *)arg2;
  CHAR_DATA              *third = (CHAR_DATA *)arg1;

  /*
   * Discard null and zero-length messages.
   */
  if(!format || format[0] == '\0')
    return;

  if(!ch)
  {
    bug("Act: null ch. (%s)", format);
    return;
  }

  if(!ch->in_room)
    to = NULL;
  else if(type == TO_CHAR)
    to = ch;
  else if(type == TO_THIRD)
    to = third;
  else
    to = ch->in_room->first_person; // <---------Crashing here

gdb info:
#0  0x08100230 in act (AType=33, format=0x82b6d81 "$n has entered the game.",
    ch=0x9c550d8, arg1=0x0, arg2=0x0, type=5) at comm.c:3024
3024        if(HAS_PROG(to->in_room, ACT_PROG) && to)
(gdb) bt
#0  0x08100230 in act (AType=33, format=0x82b6d81 "$n has entered the game.",
    ch=0x9c550d8, arg1=0x0, arg2=0x0, type=5) at comm.c:3024
#1  0x0815d375 in genesis (d=0x9bef6f0, argument=<value optimized out>)
    at genesis.c:1986
#2  0x08103198 in game_loop () at comm.c:1330
#3  0x08106b01 in main (argc=2, argv=0xbfaf8ed4) at comm.c:859

related code in comm.c
/* Volk - object socials */
  bool                    actobj = FALSE;

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

  if(MOBtrigger && type != TO_CHAR && type != TO_VICT && to)
  {
    OBJ_DATA               *to_obj;
    txt = act_string(format, NULL, ch, arg1, arg2, STRING_IMM, actobj);
// Attempting to stop a random crash on player entering game - Aurin
    if(!to)
	{
	  bug("%d: There is no to for TO_ROOM in object socials.\r\n", __FUNCTION__);
	  return;
	}
    if(HAS_PROG(to->in_room, ACT_PROG) && to)  // <----------Crashing here
      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);
  }

Note that the bug check I put in is never logged, so it can be safely ignored, at any rate

next gdb info:
#0  can_see (ch=0xa0a7928, victim=0x1a) at handler.c:3183
3183      if(!IS_NPC(victim) && xIS_SET(victim->act, PLR_WIZINVIS))
(gdb) bt
#0  can_see (ch=0xa0a7928, victim=0x1a) at handler.c:3183
#1  0x081ad27f in mprog_translate (ch=114 'r', t=0xbff228a0 "", mob=0xa0a7928,
    actor=0x0, obj=0x0, vo=0x0, rndm=0x1a) at mud_prog.c:1960
#2  0x081b2b8b in mprog_do_command (cmnd=<value optimized out>, mob=0xa0a7928,
    actor=0x0, obj=0x0, vo=0x0, rndm=0x1a, ignore=0 '\000',
    ignore_ors=0 '\000') at mud_prog.c:2766
#3  0x081b33cc in mprog_driver (com_list=0x95b3760 "smile $r\n\r",
    mob=0xa0a7928, actor=0x0, obj=0x0, vo=0x0, single_step=0 '\000')
    at mud_prog.c:2442
#4  0x081b50c9 in mprog_percent_check (mob=0xa0a7928, actor=0x0, obj=0x0,
    vo=0x0, type=2) at mud_prog.c:2981
#5  0x081b5117 in mprog_random_trigger (mob=0xa0a7928) at mud_prog.c:3337
#6  0x0824533d in mobile_update () at update.c:1751
#7  0x0824ab20 in update_handler () at update.c:3493
#8  0x081031f2 in game_loop () at comm.c:1351
#9  0x08106b01 in main (argc=2, argv=0xbff2b474) at comm.c:859

related code in handler.c
// Broken down a bit more to see if I can't find the exact problem - Aurin	
  if(!IS_NPC(victim) && xIS_SET(victim->act, PLR_WIZINVIS)) // <-----Crashing here on xIS_SET(victim->act, PLR_WIZINVIS)
    if(victim->pcdata->wizinvis)
	   if(get_trust(ch) < victim->pcdata->wizinvis)
         return FALSE;

gdb info
#0  IS_AFFECTED (ch=0xbfd869fc, arg=47) at skills.c:14604
14604         paf_next = paf->next;
(gdb) bt
#0  IS_AFFECTED (ch=0xbfd869fc, arg=47) at skills.c:14604
#1  0x08163248 in can_see (ch=0xa51f150, victim=0xbfd869fc) at handler.c:3247
#2  0x081ad27f in mprog_translate (ch=114 'r', t=0xbfd851a0 "", mob=0xa51f150,
    actor=0x0, obj=0x0, vo=0x0, rndm=0xbfd869fc) at mud_prog.c:1960
#3  0x081b2b8b in mprog_do_command (cmnd=<value optimized out>, mob=0xa51f150,
    actor=0x0, obj=0x0, vo=0x0, rndm=0xbfd869fc, ignore=0 '\000',
    ignore_ors=0 '\000') at mud_prog.c:2766
#4  0x081b33cc in mprog_driver (com_list=0x9a0d320 "poke $r\n\r",
    mob=0xa51f150, actor=0x0, obj=0x0, vo=0x0, single_step=0 '\000')
    at mud_prog.c:2442
#5  0x081b50c9 in mprog_percent_check (mob=0xa51f150, actor=0x0, obj=0x0,
    vo=0x0, type=2) at mud_prog.c:2981
#6  0x081b5117 in mprog_random_trigger (mob=0xa51f150) at mud_prog.c:3337
#7  0x0824533d in mobile_update () at update.c:1751
#8  0x0824ab20 in update_handler () at update.c:3493
#9  0x081031f2 in game_loop () at comm.c:1351
#10 0x08106b01 in main (argc=2, argv=0xbfd8dd74) at comm.c:859

related code in skills.c
/* Volk - rewrote this to take into account bitvectors that player might be carrying.. 
 * Need to go through code and totally replace 'is xIS_SET(ch->affected_by, AFFWHATEVER'
 * with IS_AFFECTED(ch, AFFWHATEVER) so it checks BV too */
bool IS_AFFECTED ( CHAR_DATA *ch, int arg )
{
   AFFECT_DATA *paf, *paf_next;

   if ( !ch )
      return FALSE;

   if ( xIS_SET ( ch->affected_by, arg ) )
      return TRUE;

   for ( paf = ch->first_affect; paf; paf = paf_next )
   {
      paf_next = paf->next; // <---------Crashes here
      if ( xIS_SET ( paf->bitvector, arg ) )
         return TRUE;
   }

   return FALSE;
}



I swear these have to be related somehow, but I just can't figure out how. Again, any help in any form is appreciated.

Aurin
       
Post is unread #2 Jul 10, 2012, 7:09 pm   Last edited Jul 10, 2012, 7:13 pm by ayuri
Go to the top of the page
Go to the bottom of the page

ayuri
Magician
GroupMembers
Posts239
JoinedJun 13, 2008

My coding skills are really sub par but your code:
void act(short AType, const char *format, CHAR_DATA *ch, const void *arg1, const void *arg2, int type)

Does the arg1 and arg2 really need the const? Sadly that's the only thing I'm seeing that may (or may not) have any impact for your comm.c crash. The others I'm sorry but I have no insight.

ayuri
       
Post is unread #3 Jul 10, 2012, 7:21 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Sounds like it's about time to whip out valgrind.
       
Pages:<< prev 1 next >>