08 Nov, 2007, Vladaar wrote in the 1st comment:
Votes: 0
This gdb results kinda has me baffled. Any help would be appreciated. Only happens once in a blue moon, so not easy to reproduce with Valgrind.

Program terminated with signal 11, Segmentation fault.
#0 0x0000000000492644 in act (AType=18, format=0x582c17 "$n has entered the game.", ch=0x1060df0, arg1=0x0, arg2=0x0,
type=5) at comm.c:4117
4117 if(HAS_PROG(to->in_room, ACT_PROG))
(gdb) bt
#0 0x0000000000492644 in act (AType=18, format=0x582c17 "$n has entered the game.", ch=0x1060df0, arg1=0x0, arg2=0x0,
type=5) at comm.c:4117
#1 0x00000000004978e4 in nanny (d=0x130e040, argument=0x7fff2f598581 "") at comm.c:3464
#2 0x0000000000498641 in game_loop () at comm.c:1309
#3 0x000000000049ac32 in main (argc=<value optimized out>, argv=<value optimized out>) at comm.c:874
(gdb) frame 0
#0 0x0000000000492644 in act (AType=18, format=0x582c17 "$n has entered the game.", ch=0x1060df0, arg1=0x0, arg2=0x0,
type=5) at comm.c:4117
4117 if(HAS_PROG(to->in_room, ACT_PROG))
(gdb) frame 1
#1 0x00000000004978e4 in nanny (d=0x130e040, argument=0x7fff2f598581 "") at comm.c:3464
3464 act(AT_ACTION, "$n has entered the game.", ch, NULL, NULL, TO_CANSEE);
(gdb) frame 2
#2 0x0000000000498641 in game_loop () at comm.c:1309
1309 nanny(d, cmdline);
08 Nov, 2007, Kayle wrote in the 2nd comment:
Votes: 0
I'm not all that sure, but it looks like you might have some null values being passes. if I'm not mistaken 0x0 is NULL. Although, At 1:30 in the morning, having been up since 8 AM with a migraine, I wouldn't be surprised if I was wrong though.
08 Nov, 2007, Vladaar wrote in the 3rd comment:
Votes: 0
Hrm,

I think arg1 and arg2 are supposed to be NULL though.

act(AT_ACTION, "$n has entered the game.", ch, NULL, NULL, TO_CANSEE);

ch is the $n
arg1 is NULL
arg2 is NULL
08 Nov, 2007, Tyche wrote in the 4th comment:
Votes: 0
The problem is 'to->room' , to is an invalid pointer.
08 Nov, 2007, Davion wrote in the 5th comment:
Votes: 0
Tyche said:
The problem is 'to->room' , to is an invalid pointer.

Or room is the invalid pointer. Best way to find out, Vlad, is to use gdb's 'print' command. "print to" will show the value, and if that shows as valid data, try "print to->in_room"
08 Nov, 2007, Vladaar wrote in the 6th comment:
Votes: 0
Well checking what you guys wrote today, and trying gdb, I found there was a different crash today…. However, it involved the to->room thing again.

#0 0x0000000000492644 in act (AType=18, format=0x582c17 "a class: ", ch=0x1060df0, arg1=0x0, arg2=0x0, type=5)
at comm.c:4119
4119 for(to_obj = to->in_room->first_content; to_obj; to_obj = to_obj->next_content)
(gdb) bt
#0 0x0000000000492644 in act (AType=18, format=0x582c17 "a class: ", ch=0x1060df0, arg1=0x0, arg2=0x0, type=5)
at comm.c:4119
#1 0x00000000004978e4 in nanny (d=0x130e040, argument=0x7fff2f598581 "") at comm.c:3469
#2 0x0000000000498641 in game_loop () at comm.c:1316
#3 0x000000000049ac32 in main (argc=<value optimized out>, argv=<value optimized out>) at comm.c:908
(gdb) frame 0
#0 0x0000000000492644 in act (AType=18, format=0x582c17 "a class: ", ch=0x1060df0, arg1=0x0, arg2=0x0, type=5)
at comm.c:4119
4119 for(to_obj = to->in_room->first_content; to_obj; to_obj = to_obj->next_content)
(gdb) print to
$1 = (CHAR_DATA *) 0x12fe320
(gdb) print to->in_room
$2 = (ROOM_INDEX_DATA *) 0x0
(gdb)

I guess to->in_room is an invalid pointer then? I'm not sure how to fix that or why to->in_room would be invalid. I think it's wrapped into the code in piles of functions. What would be the best way to handle this?

Vladaar
08 Nov, 2007, Omega wrote in the 7th comment:
Votes: 0
check to see if to->in_room is valid, ie, in your connection, check to see if the act statement is before char_to_room for ch.
08 Nov, 2007, Vladaar wrote in the 8th comment:
Votes: 0
Yah it is after char_to_room

if(!location)
location = get_room_index(race_table[ch->race]->race_recall);
if(!location)
location = get_room_index(ROOM_VNUM_TEMPLE);
char_to_room(ch, location);
}
else if(ch->in_room && (IS_IMMORTAL(ch) || !IS_SET(ch->in_room->room_flags, ROOM_PROTOTYPE)))
char_to_room(ch, ch->in_room);
else if(IS_IMMORTAL(ch))
char_to_room(ch, get_room_index(ROOM_VNUM_CHAT));
else
char_to_room(ch, get_room_index(ROOM_VNUM_TEMPLE));
if(get_timer(ch, TIMER_SHOVEDRAG) > 0)
remove_timer(ch, TIMER_SHOVEDRAG);
if(get_timer(ch, TIMER_PKILLED) > 0)
remove_timer(ch, TIMER_PKILLED);
act(AT_ACTION, "$n has entered the game.", ch, NULL, NULL, TO_CANSEE);


Vladaar
08 Nov, 2007, David Haley wrote in the 9th comment:
Votes: 0
Do you make sure to do char_from_room and all that first?
08 Nov, 2007, Vladaar wrote in the 10th comment:
Votes: 0
David,

No char_from_room before that in Nanny function, but… Smaugfuss doesn't have it either, so I didn't think that was the problem. Furthermore, what is boggling me is it wasn't just has entered the game that caused a crash, if you look up a few posts you'll see I had another post on to->in_room with a different function.
08 Nov, 2007, David Haley wrote in the 11th comment:
Votes: 0
Well it seems like one way or another your room lists have gotten corrupted; if you can, I would go look at the changes you made recently. (Are you using version control? :smile:) And if it's hard to run it in Valgrind, well, it might be worth it to just try and see what happens, and just run it for a while. Not a lot of time now, will write more later probably.
09 Nov, 2007, Vladaar wrote in the 12th comment:
Votes: 0
What do all these redirects mean when valgrind is running?

Thu Nov 8 16:25:46 2007 :: 6 Dragons ready at address crondonia.arthmoor.com on port 4000.
–15754– REDIR: 0x37AFE78440 (memset) redirected to 0x4A06A20 (memset)
Thu Nov 8 16:25:47 2007 :: IMC: Standard Authentication completed.
Thu Nov 8 16:25:47 2007 :: IMC: Connected to Server02. Network ID: MudBytes
–15754– REDIR: 0x37AFE73C70 (realloc) redirected to 0x4A059C5 (realloc)
Thu Nov 8 16:26:19 2007 :: Preloading player data for: Muxa
Thu Nov 8 16:26:21 2007 :: Loading player data for Muxa (8K)
Thu Nov 8 16:26:21 2007 :: Muxa@12.345.678.910 has connected.
–15754– REDIR: 0x37AFE77330 (strncat) redirected to 0x4A070E0 (strncat)
09 Nov, 2007, David Haley wrote in the 13th comment:
Votes: 0
I suspect that Valgrind is intercepting calls to certain library functions and using its own (esp. for the memory functions), but I'm not sure. Either way, I think it's harmless.
09 Nov, 2007, Davion wrote in the 14th comment:
Votes: 0
Vladaar said:
Well checking what you guys wrote today, and trying gdb, I found there was a different crash today…. However, it involved the to->room thing again.

#0 0x0000000000492644 in act (AType=18, format=0x582c17 "a class: ", ch=0x1060df0, arg1=0x0, arg2=0x0, type=5)
at comm.c:4119
4119 for(to_obj = to->in_room->first_content; to_obj; to_obj = to_obj->next_content)
(gdb) bt
#0 0x0000000000492644 in act (AType=18, format=0x582c17 "a class: ", ch=0x1060df0, arg1=0x0, arg2=0x0, type=5)
at comm.c:4119
#1 0x00000000004978e4 in nanny (d=0x130e040, argument=0x7fff2f598581 "") at comm.c:3469
#2 0x0000000000498641 in game_loop () at comm.c:1316
#3 0x000000000049ac32 in main (argc=<value optimized out>, argv=<value optimized out>) at comm.c:908
(gdb) frame 0
#0 0x0000000000492644 in act (AType=18, format=0x582c17 "a class: ", ch=0x1060df0, arg1=0x0, arg2=0x0, type=5)
at comm.c:4119
4119 for(to_obj = to->in_room->first_content; to_obj; to_obj = to_obj->next_content)
(gdb) print to
$1 = (CHAR_DATA *) 0x12fe320
(gdb) print to->in_room
$2 = (ROOM_INDEX_DATA *) 0x0
(gdb)

I guess to->in_room is an invalid pointer then? I'm not sure how to fix that or why to->in_room would be invalid. I think it's wrapped into the code in piles of functions. What would be the best way to handle this?

Vladaar



This backtrace is crashing in a different spot. Also, the 'to' variable isn't represented by the 'ch' passed to it. 'to' are the people it's sending the message to. Find out who it's crashing on. Next time, 'print to->name' and see what it shows you.
09 Nov, 2007, Vladaar wrote in the 15th comment:
Votes: 0
We got it Davion thanks. It was a clanrecall command.

Vladaar
0.0/15