[-Help-] Crashes

From: Corey Hoitsma (choitsma@netcom.com)
Date: 12/15/96


Can someone help me out here?

I seem to get a crash everytime there is a new player:


Sun Dec 15 09:52:44 :: Kz [defender.lm.com] new player.
Sun Dec 15 09:52:46 :: Kz entering game with no equipment.

Program received signal SIGSEGV, Segmentation fault.
0x6003e26f in end ()
(gdb) list
102
103     /* 
*********************************************************************
104     *  main game loop and related stuff                              *
105     
********************************************************************* */
106
107     int main(int argc, char **argv)
108     {
109       int port;
110       char buf[512];
111       int pos = 1;
(gdb) bt
#0  0x6003e26f in end ()
#1  0x36641 in roll_real_abils (ch=0xbfffedd8) at class.c:419
#2  0x60004e42 in end ()
#3  0x6000527a in end ()
#4  0x60031779 in end ()
#5  0x600322e2 in end ()
#6  0x6002ee24 in end ()
#7  0x366dc in do_start (ch=0x53c200) at class.c:446
#8  0x56078 in nanny (d=0x5a2000, arg=0xbffff8a4 "1") at interpreter.c:1802
#9  0x1edd in game_loop (mother_desc=6) at comm.c:521
#10 0x164d in init_game (port=7000) at comm.c:211
#11 0x153e in main (argc=1, argv=0xbffffc6c) at comm.c:181
(gdb) f 1
#1  0x36641 in roll_real_abils (ch=0xbfffedd8) at class.c:419
419     }

This is my roll_real_abils:

void roll_real_abils(struct char_data * ch)
{
  int i, j, k, temp;
  ubyte table[6];
  ubyte rolls[4];

  for (i = 0; i < 6; i++)
    table[i] = 0;

  for (i = 0; i < 6; i++) {

    for (j = 0; j < 4; j++)
      rolls[j] = number(1, 6);

    temp = rolls[0] + rolls[1] + rolls[2] + rolls[3] -
      MIN(rolls[0], MIN(rolls[1], MIN(rolls[2], rolls[3])));

    for (k = 0; k < 6; k++)
      if (table[k] < temp) {
        temp ^= table[k];
        table[k] ^= temp;
        temp ^= table[k];
      }
  }

  ch->real_abils.str_add = 0;

  switch (GET_CLASS(ch)) {
  case CLASS_MAGIC_USER:
    ch->real_abils.intel = table[0];
    ch->real_abils.wis = table[1];
    ch->real_abils.dex = table[2];
    ch->real_abils.str = table[3];
    ch->real_abils.con = table[4];
    ch->real_abils.cha = table[5];
    break;
  case CLASS_CLERIC:
    ch->real_abils.wis = table[0];
    ch->real_abils.intel = table[1];
    ch->real_abils.str = table[2];
    ch->real_abils.dex = table[3];
    ch->real_abils.con = table[4];
    ch->real_abils.cha = table[5];
    break;
  case CLASS_DRUID:
    ch->real_abils.wis = table[0];
    ch->real_abils.intel = table[1];
    ch->real_abils.str = table[2];
    ch->real_abils.dex = table[3];
    ch->real_abils.con = table[4];
    ch->real_abils.cha = table[5];
    break;
  case CLASS_THIEF:
    ch->real_abils.dex = table[0];
    ch->real_abils.str = table[1];
    ch->real_abils.con = table[2];
    ch->real_abils.intel = table[3];
    ch->real_abils.wis = table[4];
    ch->real_abils.cha = table[5];
    break;
  case CLASS_WARRIOR:
    ch->real_abils.str = table[0];
    ch->real_abils.dex = table[1];
    ch->real_abils.con = table[2];
    ch->real_abils.wis = table[3];
    ch->real_abils.intel = table[4];
    ch->real_abils.cha = table[5];
    if (ch->real_abils.str == 18)
      ch->real_abils.str_add = number(0, 100);
    break;
  case CLASS_KNIGHT:
    ch->real_abils.con = table[0];
    ch->real_abils.wis = table[1];
    ch->real_abils.str = table[2];
    ch->real_abils.dex = table[3];
    ch->real_abils.intel = table[4];
    ch->real_abils.cha = table[5];
    if (ch->real_abils.str == 18)
      ch->real_abils.str_add = number(0, 100);
    break;
  case CLASS_RANGER:
    ch->real_abils.str = table[0];
    ch->real_abils.con = table[1];
    ch->real_abils.intel = table[2];
    ch->real_abils.wis = table[3];
    ch->real_abils.dex = table[4];
    ch->real_abils.cha = table[5];
    break;
  case CLASS_MAR:
    ch->real_abils.dex = table[0];
    ch->real_abils.con = table[1];
    ch->real_abils.str = table[2];
    ch->real_abils.intel = table[3];
    ch->real_abils.wis = table[4];
    ch->real_abils.cha = table[5];
    break;

  }
  ch->aff_abils = ch->real_abils;
}

Sorry if this is spam, but can someone please help? :) Thanks!
+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST