Re: Malloc debugging (Was: Medit crash)

From: Luis Pedro Passos Carvalho (lpcarvalho@SONAE.PT)
Date: 11/28/97


|
| Anyway, would it be possible and/or a good idea making some sort of wrapper
| for all the 'writes' into memory ? I guess doing that with the code I'm
| currently

I'm not sure if it would be even possible.

Unless... *brainstorm*

If you used C++ you could modify several operators and add them to your wrapper
Let's see: & and *, [] those allow you to get the dynamic references to memory.
At least that way you can know if YOUR code is corrupting the memory.
Unfortunately that way you can't catch it if it is being done in libc by invalid
parameters or something like that.
I don't know if it's feasible but... good luck anyway.

| using
| would really hog up CPU time *snicker* Not to mention making it take a century
| to
| boot up the mud. But, I'm desperately in need of a good way to find and bugfix
| such
| problems like this (also in the future).
|
| In the case of writing a wrapper, what functions would I need to make a
| wrapper for,
| and where would I find the information on the structures (the header size) for
| the
| malloc() function, so I can also test for occurances, that overwrite those

Let's see... vi, grep, sources of libc, sources of the kernel. I guess you have
everything to study how memory is managed in linux. My bet goes to the sources of libc
Grep for malloc and free.

--
Luis Carvalho
lpcarvalho@sonae.pt
lpassos@mail.telepac.pt


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