Medit crash & memory wrappe

From: Rasmus Ronlev (raro94ab@STUDENT.ECON.CBS.DK)
Date: 11/27/97


NOTE:
This message got rejected because of it's original size, so I ripped out
the memory wrapper portion and placed it on the following web address:

                 http://tp.cbs.dk/~rand/memory.snippet.txt

Disclaimer;

This message is a long son of a b*. I'm sorry for those of you, whom it
might not interest, but there is some memory wrapping code attached to
this message you'd probably all like ,-) I even think it's bug free. The
basic content of this mail is abous OasisOLC though. I'm thankfull for any
help and sugestions, both on the olc portion as well as any comments on
the memory wrapper. (Attached as memory.gz - gzipped)

Hi,

Being a little wacko, I thought just posting the usual 'medit crashes'
message, I'd be a little different :)

Actually my modem-link sucks at the moment, so I haven't really been able
to dig into old mails or other resources besides Georges website.

I worked on a mud (Realms of the exiled) for quite some time, there I
installed Oasis way back (tm). I think what I had was some mix between 1.2
and 1.3. I left the above mud, to start up a new one (more or less based
on the same code, specifically I didn't change the olc), and put it on a
new site some weeks ago.

I was certain I had gotten rid of all problems with medit crashing (and a
lot of other *edit's *snicker*), at least I hadn't seen it happen on
Exiled. So, now a weeks time or so ago, when some builder started working
with the olc online it crashed on him when he used medit, and selected to
save the changes he just did.

After playing a little with the mob edit portion of the olc I found out
the olc only crashed when adding a NEW mobile and selecting to save this.
As the Oasis-knowledgable of you probably know, the crash happens when the
medit_save_internally() function free()'s mob_index and mob_proto (tried
commenting either free() out, and crashed on both occasions.

I'm not much for the idea of commenting out the free()'s of both the
mob_proto as well as the mob_index tables. I think not freeing memory when
it should be freed sucks. Not to mention that it sucks not to find the
fault causing the crash *grin*

I've been on this list for a little while (hehe), so I was perfectly aware
of Georges work with Oasis and the upgrade/patch/fixes he'd done. With
that in mind I downloaded v1.5, v1.6 and v1.6a files and patches as well
as the original (1.2/1.3) from the circle ftp site. Using the various
files, diff and patch I converted all of the olc into v1.6a.

Ok, now I was certain I would have NO PROBLEMS at all untill I would be
old enough to retire, or at least get a great job with even better pay :)

Ofcourse, since I'm writing this message, the same error occurs STILL!
*ACK!*

After scanning through the various files for all free() calls done by the
mud, and not finding any wierd messed up stuff, and after using a few
nights over the medit file I was (and am :) still in the void as to what
could cause this crash, when freeing some memory, that shouldn't be of any
problem at all to free... (It hasn't been for half a year, but perhaps
shifting linux box/libs or whatever has caused some bug to surface).

Anyway, I had written an old 'wrapper' I beleave it is called, some time
back, when Erwin told me to do so, for some wierd reason, while i was
trying to trace some problems with another portion of the code. I dug it
out and changed it arround a lot (was only a free() wrapper in the
beginning), now it's somewhat more... hehe

I've included the stuff attached in my mud-code, and the wrapper functions
DO NOT find any f* free() call that attempts to free a pointer to some
memory that was already freed, or that frees some part of a larger
allocated memory segment. I'm waffled, baffled, and tired of not having a
clue what the problem is...
So, if anyone has any bug fixes or sugestions, or just want to use the
memory wrapper go ahead (please drop me a note that you use it, and what
you think of it).

And.... if someone has a clue what I need to do to fix the olc, so it
doesn't crash, please tell me too ,-) Btw. this is the output I get from
the mud b4 it crashes if that's anything you need.:

----------------------------    GDB SNIPP    ----------------------------

Thu Nov 27 06:24:02 :: calling: medit_save_internally()
top_of_mobt: 99, new top_of_mobt: 100
Inserted: rmob_num: 28
rmob_num: 100, top_of_mobt: 99, array size: 0-100 (101)
Attempted free.
Attempting to free mob_index.
Thu Nov 27 06:24:03 :: Mob_index at: 135993248-135994848

Program received signal SIGSEGV, Segmentation fault.
0x40041559 in __libc_free ()
(gdb) where
#0  0x40041559 in __libc_free ()
#1  0x81b1788 in ?? ()
#2  0x81b17a0 in ?? ()
Cannot access memory at address 0x19.
(gdb)

----------------------------    GDB SNIPP    ----------------------------

Regards,
Rasmus aka. Rand.

.d
--
        Rasmus Ronlev DOEK'94           http://www.econ.cbs.dk/~raro94ab
             IT-Advisor               mailto:raro94ab@student.econ.cbs.dk

              B.Sc. Computer Science and Business Administration
          Stud. M.Sc. Computer Science and Business Administration


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST