Re: Segfault in dg_db_scripts.c

From: Welcor (welcor@dune.net)
Date: 10/22/01


----- Original Message -----
From: "AJ" <mielikki@EXILEMUD.COM>
>(gdb) run
>Starting program: /cygdrive/c/circle19/bin/circle.exe
>Program received signal SIGSEGV, Segmentation fault.
>0x004513e7 in assign_triggers (i=0xa1ac9c0, type=0) at dg_db_scripts.c:323
>
I'd like to see the value of i:
print (char_data *)i
print (obj_data *)i
print (room_data *)i

>
>(gdb) bt
>#0  0x004513e7 in assign_triggers (i=0xa1ac9c0, type=0) at dg_db_scripts.c:323
>     switch (type)
>  {
>    case MOB_TRIGGER:
>      mob = (char_data *)i;
>      trg_proto = mob->proto_script;
>      while (trg_proto) {
>        rnum = real_trigger(trg_proto->vnum);       <--line 323
>
This suggests that the value mob->proto_script is invalid. This will cause undefined
effects on dereference.

>
> #1  0x0044bda2 in read_mobile (nr=0, type=0) at db.c:1742
>      CREATE(mob, struct char_data, 1);
>  clear_char(mob);
>  *mob = mob_proto[i];
>  mob->next = character_list;
>  character_list = mob;
>
>
>  if (!mob->points.max_hit) {
>    mob->points.max_hit = dice(mob->points.hit, mob->points.mana) +
>      mob->points.move;
>  } else
>    mob->points.max_hit = number(mob->points.hit, mob->points.mana);
>
>
>  mob->points.hit = mob->points.max_hit;
>  mob->points.mana = mob->points.max_mana;
>  mob->points.move = mob->points.max_move;   <--line 1742
>
This can't be. A backtrace will trace the calls made to get where you crash.
The above line isn't a function call. Your source must be out of sync with
your binary.

Make clean; then recompile.

>
> #2  0x0044c625 in reset_zone (zone=0) at db.c:1914
> #3  0x00446d49 in boot_db () at db.c:373
> #4  0x0043e815 in init_game (port=4000) at comm.c:353
> #5  0x0043e6e7 in main (argc=1, argv=0xa011238) at comm.c:329
<snip>

Mail me directly, if you wish.

Welcor

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST