Re: [bug] bpl21 boards

From: Kras Kresh (kras_kresh@hotmail.com)
Date: 09/20/02


See this is the exact same thing, just different message to free that gg
replied to as not crashing for him and just threw it in the trash. I tried
see if I could fix it. I failed. Shouldn't have taken more than a tops of
half a dozen hours, but I gave up after a half hour. Went back another day,
gave up again. And I threw it in the trash as well. Wasn't too important
except it crashes the mud when it goes down.


>From: Russell Ryan <rjwr10@HOTMAIL.COM>
>Reply-To: Circle Discussion List <CIRCLE@post.queensu.ca>
>To: CIRCLE@post.queensu.ca
>Subject: [CIRCLE] [bug] bpl21 boards
>Date: Mon, 5 Aug 2002 02:49:26 -0500
>
>Hi again all,
>
>when I was messing around with bpl21, I wrote a message on the immortal
>board (regular message, ie not blank etc.) and then removed it, I shutdown
>the mud and got an assertion failure in dbgheap.c, backtraced to free()
>then to Board_clear_board() called by Board_clear_all.
>
>heres the bit of code where it crashes
>
>void Board_clear_board(int board_type)
>{
>   int i;
>
>   for (i = 0; i < MAX_BOARD_MESSAGES; i++) {
>     if (MSG_HEADING(board_type, i))
>       free(MSG_HEADING(board_type, i));       <--- this line
>*snip*
>board type = 1(immortal board's number), i=6 in this call
>(it was the 6th message written to the board)
>
>so its crashing when it frees all the boards on the mud
>
>oh btw, ms visual c++ 6, windows me
>
>I then unzipped a fresh copy of bpl21 and compiled it. I wrote a message on
>the board, removed it, then shutdown and the same thing happened so its not
>anything I had added to it. It only seems to happen when I remove the
>message. I can write to the board, etc, shutdown and be fine.
>
>After taking a look at Board_remove_msg(...) in boards.c I came to this
>conclusion:
>After all the checks to see if its ok to remove the message, heres the code
>that actually removes it:
>
>   if (msg_storage[slot_num])
>     free(msg_storage[slot_num]);
>   msg_storage[slot_num] = 0;
>   msg_storage_taken[slot_num] = 0;
>   if (MSG_HEADING(board_type, ind))
>     free(MSG_HEADING(board_type, ind));
>
>MSG_HEADING is a char* and after its free'd its not set to NULL, I changed
>the last two lines to this:
>   if (MSG_HEADING(board_type, ind)) {
>     free(MSG_HEADING(board_type, ind));
>     MSG_HEADING(board_type, ind) = NULL;
>}
>
>and that fixed it for me
>
>Just wondering if anyone else came across this and if so how they fixed it
>
>thanks,
>rj ryan :)
>
>--
>    +---------------------------------------------------------------+
>    | 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/   |
>    +---------------------------------------------------------------+




_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

--
   +---------------------------------------------------------------+
   | 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