Re: Malloc problems

From: Mike Stilson (mike@velgarian.sytes.net)
Date: 10/01/02


On Tue, Oct 01, 2002 at 05:48:21PM -0600, Sam Moggach wrote:
>If there is more than 1 person logged on, and someone quits. the mud
>crashes. this is what gdb gives me
>
>#0  0x4007a7d6 in chunk_free (ar_ptr=0x400cebd0, p=0x82bd4cc) at
>malloc.c:2950
>#1  0x4007a6a1 in __libc_free (mem=0x82bd4d4) at malloc.c:2877
>#2  0x8077ca8 in free_char (ch=0x82be0c0) at db.c:2836
>#3  0x806f007 in close_socket (d=0x82bd4d0) at comm.c:2028
>#4  0x806d68f in game_loop (mother_desc=6) at comm.c:880
>#5  0x806cd7b in init_game (port=3932) at comm.c:473
>#6  0x806c9f5 in main (argc=1, argv=0xbffffd90) at comm.c:331
>(gdb) quit
>
>
>This happened after adding ascii pfiles and copyover to circlebpl21 so i'm
>sure a lot of people have run into this problem. but i'm a n00b still and i
>cant figure out why this is happening. thanks!

the gdb trace is great, but could you alsy send the output of:
(gdb) frame 2
(gdb) list

helps to see the surrounding code.

(fyi:)
frame 2:  This select the frame (#2) of interest, since the last point
within your code that is causing the segv is pretty reliably where the
error is.  Odds are you're doubly-freeing something.

list: list the code surrounding the errant line.

-me

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