Re: GLib RFC: Improve checking provided with --enable-mem-check



On Wed, 6 Jun 2001, Ben Stanley wrote:

> Hi,
> 
> I recently tried to use a glib compiled with --enable-mem-check to debug 
> gnucash, but instead ran into a 'block freed x times' message (from 
> gtkcalendar.c). The number x was an incredibly large number, suggesting that
> 
>    1. The pointer being freed had never been allocated or
>    2. The memory had been overwritten by something else after previously
>       being freed.
> 
> The current implementation cannot distinguish between these two 
> possibilities, and is incapable of detecting a few other kinds of problem.
> 
> I am proposing to make some additions to g_malloc, g_free and related 
> functions (g_malloc0, g_realloc) to make the debugging memory manager 
> more robust to misuse. This will improve it's utilitiy in bug-hunting.

[...]

> I am volunteering to implement this proposal.
> 
> I have currently only looked at gmem.c in glib-1.2.9. Is there any more 
> recent version that I should know about?

yes, for glib's devel branch, allocators are fully pluggable.

a sample mem-profile/debug implementation is provided that is much
modeled after the 1.2.x enable-mem-check aproach.
if you code up your proposal and it proves generally usefull,
we could include that into the glib tarball so peole can plug it
into existing programs.

> 
> Ben.
> 

---
ciaoTJ





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]