Random Crashes on SWRFUSS

Posted by Jason on Mon 18 Jun 2012 02:08 AM — 7 posts, 32,580 views.

#0
ok here is what I got... and I don't get why it is crashing... The code is the same as it was on my non fuss code.

My game is crashing at this line of code


   if( fPrompt && !mud_down && d->connected == CON_PLAYING )
   {
      ch = d->original ? d->original : d->character;
[bold]      if( IS_SET( ch->act, PLR_BLANK ) )  THIS LINE HERE CRASHES[/bold]
         write_to_buffer( d, "\r\n", 2 );

      if( IS_SET( ch->act, PLR_PROMPT ) )
         display_prompt( d );
      if( IS_SET( ch->act, PLR_TELNET_GA ) )
         write_to_buffer( d, (const char *)go_ahead_str, 0 );
   }

This is the same as the non-fuss version. it seems to crash upon characters dying... or disconnecting abruptly. not really sure why.

Here is what the core file reads

(gdb) bt
#0  0x080d3ec8 in flush_buffer (d=0x9b42580, fPrompt=true) at comm.c:1186
#1  0x080d2a33 in game_loop () at comm.c:611
#2  0x080d1d15 in main (argc=5, argv=0xbfffe464) at comm.c:252
Current language:  auto; currently c++
USA Global Moderator #1
what is d->character right before the crash?
#2
0x0
Netherlands #3
Well then, that is your problem. You can't dereference null. Maybe your problem is somewhere else and it shows here, or this snippet makes wrong assumptions and that causes the crash.
#4
Where might i even go about looking for this issue....Maybe the Account snippet I put in?
USA Global Moderator #5
Maybe. We can't help you with that because we don't know what you're doing. This may be a good time to learn about general debugging techniques.

http://www.drpaulcarter.com/cs/debug.php#4.
http://cs.baylor.edu/~donahoo/tools/gdb/tutorial.html
Amended on Sat 30 Jun 2012 06:04 PM by Fiendish
Australia Forum Administrator #6
http://www.gammon.com.au/gdb