Memory corruption in file_to_string and file_to_string_alloc?

From: Artovil (artovil@arcanerealms.org)
Date: 11/13/01


Hello,

Quick info: CircleMUD 3.0 bpl 18, ASCII pfiles, DG Scripts 0.99, OasisOLC
2.0, Linux

I've been with the list for a while now, and I must apologize for my
rudimentary perception of pointers and rvalues and lvalues, and oh my!  I
recently started using the Electric Fence library, and as I sat here and
tried some stuff out, I noticed that the mud SIGSEGV's when I view a text
file in the mud, and then reload any of the textfiles.

 > credits
...
 > reload imotd

Program received signal SIGSEGV, Segmentation fault.
0x808ba15 in file_to_string_alloc (name=0x80f85bf "text/credits",
buf=0x81164bc) at db.c:3238
3238        if (in_use->showstr_vector && *in_use->showstr_vector == *buf)

(gdb) bt
#0  0x808ba15 in file_to_string_alloc (name=0x80f85bf "text/credits",
buf=0x81164bc) at db.c:3238
#1  0x8083b85 in do_reboot (ch=0x479cc000, argument=0xbffff536 " credits",
cmd=293, subcmd=0) at db.c:283
#2  0x80aec41 in command_interpreter (ch=0x479cc000, argument=0xbffff530
"reload credits") at interpreter.c:850
#3  0x808001c in game_loop (mother_desc=6) at comm.c:872
#4  0x807f81d in init_game (port=9000) at comm.c:493
#5  0x807f4bf in main (argc=4, argv=0xbffff994) at comm.c:372

At first I thought this had to do with my MySQL conversion of
file_to_string_alloc, but I tried it on my regular source and it dumps
there too.  I even checked a clean circle30bpl19 and it happens here too.

I suppose this is a necessary evil, or is there a solution out there?

Thankful for any help and suggestions...

Kind regards,
/Torgny

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