So after a nice compile, the game started up just fine. Problem is upon loading a character *Boom*. So I used gdb to track down where the issue is, and this is what i got.
(gdb)
game_loop () at comm.c:621
621 break;
(gdb)
635 if ( d == last_descriptor )
(gdb)
640 update_handler( );
(gdb)
Program received signal SIGSEGV, Segmentation fault.
0x004861df in get_char_room (ch=0xa229038, argument=0x239cb0 "someone") at handler.c:1864
warning: Source file is more recent than executable.
1864 if ( can_see( ch, rch )
(gdb)
0x7c90eaf0 in ntdll!LdrDisableThreadCalloutsForDll () from ntdll.dll
(gdb)
Single stepping until exit from function ntdll!LdrDisableThreadCalloutsForDll,
which has no line number information.
0x7c9377c1 in ntdll!LdrFindCreateProcessManifest () from ntdll.dll
(gdb)
Single stepping until exit from function ntdll!LdrFindCreateProcessManifest,
which has no line number information.
0x7c90390c in ntdll!RtlCheckRegistryKey () from ntdll.dll
(gdb)
Single stepping until exit from function ntdll!RtlCheckRegistryKey,
which has no line number information.
0x7c9377f0 in ntdll!LdrFindCreateProcessManifest () from ntdll.dll
(gdb)
Single stepping until exit from function ntdll!LdrFindCreateProcessManifest,
which has no line number information.
0x7c90392d in ntdll!RtlCheckRegistryKey () from ntdll.dll
(gdb)
Single stepping until exit from function ntdll!RtlCheckRegistryKey,
which has no line number information.
0x7c9377f5 in ntdll!LdrFindCreateProcessManifest () from ntdll.dll
(gdb)
Single stepping until exit from function ntdll!LdrFindCreateProcessManifest,
which has no line number information.
15 [main] smaug 3916 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
27214 [main] smaug 3916 open_stackdumpfile: Dumping stack trace to smaug.exe.stackdump
Program exited with code 0305400.
(gdb)
So I checked handler.c at 1864:
Error line is in bold. I'm guessing there is an issue with bool can_see, but I don't see it. I'll post can_see next.
Toy
(gdb)
game_loop () at comm.c:621
621 break;
(gdb)
635 if ( d == last_descriptor )
(gdb)
640 update_handler( );
(gdb)
Program received signal SIGSEGV, Segmentation fault.
0x004861df in get_char_room (ch=0xa229038, argument=0x239cb0 "someone") at handler.c:1864
warning: Source file is more recent than executable.
1864 if ( can_see( ch, rch )
(gdb)
0x7c90eaf0 in ntdll!LdrDisableThreadCalloutsForDll () from ntdll.dll
(gdb)
Single stepping until exit from function ntdll!LdrDisableThreadCalloutsForDll,
which has no line number information.
0x7c9377c1 in ntdll!LdrFindCreateProcessManifest () from ntdll.dll
(gdb)
Single stepping until exit from function ntdll!LdrFindCreateProcessManifest,
which has no line number information.
0x7c90390c in ntdll!RtlCheckRegistryKey () from ntdll.dll
(gdb)
Single stepping until exit from function ntdll!RtlCheckRegistryKey,
which has no line number information.
0x7c9377f0 in ntdll!LdrFindCreateProcessManifest () from ntdll.dll
(gdb)
Single stepping until exit from function ntdll!LdrFindCreateProcessManifest,
which has no line number information.
0x7c90392d in ntdll!RtlCheckRegistryKey () from ntdll.dll
(gdb)
Single stepping until exit from function ntdll!RtlCheckRegistryKey,
which has no line number information.
0x7c9377f5 in ntdll!LdrFindCreateProcessManifest () from ntdll.dll
(gdb)
Single stepping until exit from function ntdll!LdrFindCreateProcessManifest,
which has no line number information.
15 [main] smaug 3916 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
27214 [main] smaug 3916 open_stackdumpfile: Dumping stack trace to smaug.exe.stackdump
Program exited with code 0305400.
(gdb)
So I checked handler.c at 1864:
/* Find a char in the room. */
CHAR_DATA *get_char_room( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
CHAR_DATA *rch;
int number, count, vnum;
number = number_argument( argument, arg );
if ( !str_cmp( arg, "self" ) )
return ch;
if ( get_trust(ch) >= LEVEL_CODER && is_number( arg ) )
vnum = atoi( arg );
else
vnum = -1;
count = 0;
for ( rch = ch->in_room->first_person; rch; rch = rch->next_in_room )
if ( can_see( ch, rch )
&& (((nifty_is_name( arg, rch->name ) || (IS_NPC(rch) && nifty_is_name( arg, rch->pcdata->title )))
|| (IS_NPC(rch) && vnum == rch->pIndexData->vnum))))
{
if ( number == 0 && !IS_NPC(rch) )
return rch;
else
if ( ++count == number )
return rch;
}
if ( vnum != -1 )
return NULL;
/* If we didn't find an exact match, run through the list of characters
again looking for prefix matching, ie gu == guard. Added by Narn, Sept/96 */
count = 0;
for ( rch = ch->in_room->first_person; rch; rch = rch->next_in_room )
{
if ( !can_see( ch, rch ) || (!nifty_is_name_prefix( arg, rch->name )
&& (IS_NPC(rch) || (!IS_NPC(rch) && !nifty_is_name_prefix( arg, rch->pcdata->title )))))
continue;
if ( number == 0 && !IS_NPC(rch) )
return rch;
else
if ( ++count == number )
return rch;
}
return NULL;
}Error line is in bold. I'm guessing there is an issue with bool can_see, but I don't see it. I'll post can_see next.
Toy