[CODE] crash-bug with medit on pl21-dg8-oasis201

From: Ronald Evers (dlanor@xs4all.nl)
Date: 09/30/02


Hey folks,

I've found a bug in medit that I can't seem to fix. Whenever I
alter a mob that has a script set I get a seg fault when I exit
the medit menu and save it.

I'm using bpl21 with this dg_scripts_pl8_with_oasis_bpl21.patch
patch from the ftp site installed.

The mob I tried this on was the wandering spirit (1202). I gave
him one trigger (greet) that simply makes him say hi. Then just
"medit 1202;l;0;q;y" and there's your seg fault..

I found that the mud enters the while(proto) loop twice and then
crashes that second time.

Any help/idea/suggestion would be greatly appreciated.

Ronald


--------------------------------------------------------------------
GDB OUTPUT FOLLOWS
--------------------------------------------------------------------
Program received signal SIGSEGV, Segmentation fault.
free_proto_script (thing=0x82dfea0, type=0) at dg_handler.c:110
110         proto = proto->next;

(gdb) bt
#0  free_proto_script (thing=0x82dfea0, type=0) at dg_handler.c:110
#1  0x0807a96e in free_mobile (mob=0x82dfea0) at genmob.c:276
#2  0x0808e66a in cleanup_olc (d=0x82de5d8, cleanup_type=1 '\001') at
oasis.c:348
#3  0x08087991 in nanny (d=0x82de5d8, arg=0xbffff770 "y") at
interpreter.c:1390
#4  0x0806cff6 in game_loop (mother_desc=5) at comm.c:755
#5  0x0806c730 in init_game (port=4000) at comm.c:382
#6  0x0806c622 in main (argc=1, argv=0xbffffb4c) at comm.c:327
#7  0x40063e5e in __libc_start_main (main=0x806c368 <main>, argc=1,
ubp_av=0xbffffb4c, init=0x804915c <_init>, fini=0x80b5b80 <_fini>,
    rtld_fini=0x4000d3c4 <_dl_fini>, stack_end=0xbffffb3c) at
../sysdeps/generic/libc-start.c:129

(gdb) list free_proto_script
75      void free_proto_script(void *thing, int type) {
76
77        struct trig_proto_list *proto = NULL, *fproto;
78        char_data *mob;
79        obj_data *obj;
80        room_data *room;
81
82        switch (type) {
83          case MOB_TRIGGER:
84            mob = (struct char_data *)thing;
85            if (SCRIPT(mob))
86              extract_script(SCRIPT(mob));
87            SCRIPT(mob) = NULL;
88            proto = mob->proto_script;
89            mob->proto_script = NULL;
90            break;
91          case OBJ_TRIGGER:
              <snip>
99          case WLD_TRIGGER:
              <snip>
107       }
108       while (proto) {
109         fproto = proto;
110         proto = proto->next;
111         free(fproto);
112       }
113     }

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT