Subject: Re: dmalloc useless?

From: Dan Espen <[email-masked]>
Date: Sat, 01 Jan 2000 01:16:01 -0500

Dominik Vogt <[email-masked]> writes:
> Paul (PDS), I've tried to use dmalloc with fvwm but ran
> into several problems that make dmalloc useless for us
> if they can't be solved:

I'm not Paul, but I've got to sit at this desk for 7 more hours...

Never saw this before.  Sort of a poor man's Purify.

>  1) All modules and fvwm itself dump their log into the
>     same file.  The last one to exit wins.  This can be
>     circumvented by compiling everything w/o dmalloc,
>     then reconfiguring and compiling fvwm or the specific
>     module with dmalloc.
>     [inconvenient but no show stopper]
> 
>  2) modules/FvwmGtk/menu.c can't be compiled with dmalloc
>     because the dmalloc header does something bad with a
>     macro 'FREE' that seems to be used in g_free.
>     [can be circumvented by removing g_free() from the file]
> 
>  3) Virtually all memory allocations are reported from
>     safemalloc.c :-(  A stack trace is needed to make this
>     information usable!
>     [very serious problem]

Perhaps when using dmalloc, "safemalloc" could be represented
by a macro instead of a function?

>  4) dmalloc reports *thousands* blocks of unfreed memory
>     when fvwm exits.  This makes leak detection nigh
>     impossible.

I'm guessing I know  what this is.  It must  be complaining about  the
memory we allocate and never  free,  for example all our  keybindings?
Can't see  how this could  be  solved, the  code  to clean up  all our
memory would be considerable.

> Any ideas how to solve these problems (don't care about
> 1 or 2 unless 3 and 4 are solved)?

--
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Sun, 2 Jan 2000 06:25:31 +0100

> by a macro instead of a function?

That won't bring us anywhere.  It will then report that 50%
of the chunks are allocated from libs/Parse.c.  Without a
stack trace ...

> memory would be considerable.

No, you overestimate the memory we knowingly leak.  I've
spent long hours to make fvwm free virtually everything.
Recently I drastically improved freeing key bindings.
I'm only aware of three of four things that are not freed.

 1) Colours
 2) Styles
 3) Some things in Button/Title/BorderStyles
 4) Environment strings

I have only a few of 2, 3 and 4 in my config file
(<50).  And I rarely change colours.  My guess is
that dmalloc simply reports *everything* that is
not explicitly freed before fvwm shuts down. When
you exit fvwm it doesn't bother to free e.g. styles,
menu styles or key bindings explicitly.

Bye

Dominik ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]