Re: Autorun Segmentation Fault [LONG]

From: Mike Stilson (mike@velgarian.sytes.net)
Date: 08/22/02


On Thu, Aug 22, 2002 at 11:33:56AM -0400, Josh Harris wrote:
>Sorry I didn't include those, that was my first time using gdb abd I was
>trying to figure it out.
>
>COMMAND:   bt on bin/circle
>
>#0  chunk_alloc (ar_ptr=0x40189620, nb=17) at malloc.c:2990
>#1  0x400d6b47 in __libc_calloc (n=9, elem_size=1) at malloc.c:3844
>#2  0x0807bd5f in fread_string (fl=0x80e8228, error=0x80db0c0 "room #0")
>    at db.c:2272
>#3  0x08078481 in parse_room (fl=0x80e8228, virtual_nr=0) at db.c:785
>#4  0x08078270 in discrete_load (fl=0x80e8228, mode=0,
>    filename=0x80db0c0 "room #0") at db.c:723
>#5  0x0807805d in index_boot (mode=0) at db.c:651
>#6  0x080772a8 in boot_world () at db.c:250
>#7  0x08077462 in boot_db () at db.c:303
>#8  0x08072a87 in init_game (port=4000) at comm.c:440
>#9  0x0807275a in main (argc=1, argv=0xbffffb14) at comm.c:328
>#10 0x40071507 in __libc_start_main (main=0x8072458 <main>, argc=1,
>    ubp_av=0xbffffb14, init=0x8049004 <_init>, fini=0x80a7a90 <_fini>,
>    rtld_fini=0x4000dc14 <_dl_fini>, stack_end=0xbffffb0c)
>    at ../sysdeps/generic/libc-start.c:129
>
>COMMAND: l 20 on bin/circle
>
>15      in malloc.c

Ok, the command is right but you used it on the wrong frame.
try "frame 2" to select the stack frame in db.c (since that's the line
in your function that called calloc()) then "l".

Also, if this isn't stock code, have you made any changes that could
alter any of db.c, oasis, olc, or the .wld files.  (Which, at least
according to my version of stock bpl21 you have, since line 2272 is in
store_to_char, unless there's some oddness from compiler optimization
I'm not thinking of atm.)


<blind guess>
You're trying to read a string bigger than the local buf or tmp is
created to hold.
</blind guess>


-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