On Tue, Sep 27, 2005, Olaf Seibert wrote about "[ctwm] Re: ctwm memory leaks?":
> I attached a patch that I whipped together while I should have gone to
> sleep. Can you test it?
Thanks. I'll try to test this patch later.
> > These are just two example leaks I found - I can quite easily point to more.
> > The question is - is anyone interested that I continue to point to more
> > leaks as I find them?
>
> Yes please! I tend to use ctwm for days/weeks on end, so it would be
> very useful for me.
Here are more leaks that happen in the same scenario, of the xterm-opening
loop: (line numbers are still from official ctwm 3.7, without your new patch):
One leak involves, apparently, the window name, and is similar to the icon-
name leak that I showed previously:
GetWMPropertyString /tmp/ctwm-3.7/util.c:3919
AddWindow /tmp/ctwm-3.7/add_window.c:279
HandleMapRequest /tmp/ctwm-3.7/events.c:2372
DispatchEvent /tmp/ctwm-3.7/events.c:503
HandleEvents /tmp/ctwm-3.7/events.c:547
main /tmp/ctwm-3.7/ctwm.c:959
Another leak apparently involves allocating a 4-byte ColormapWindow pointer
but never freeing it. The allocation is done here:
FetchWmColormapWindows /tmp/ctwm-3.7/add_window.c:2215
AddWindow /tmp/ctwm-3.7/add_window.c:289
HandleMapRequest /tmp/ctwm-3.7/events.c:2372
DispatchEvent /tmp/ctwm-3.7/events.c:503
HandleEvents /tmp/ctwm-3.7/events.c:547
main /tmp/ctwm-3.7/ctwm.c:959
Note that the actual ColormapWindow put into this pointer (three lines down,
in a call to CreateColormapWindow), *is* freed correctly and does not leak.
Only the pointer itself is not freed and is leaked (after a loop of about
1,500 windows opening, I am left with 715 4-byte pointers like this still
allocated).
I believe that these are all the leaks for the "open new windows in a loop"
scenario I've tested. Later, in addition to testing you patches, I will
try to see if other scenarios show more leaks. I also want to test more
"natural" scenarios, i.e., simply using ctwm naturally and see if any
leaks become evident, but this will take more patience until I've used it
enough for enough of the code to be exercised.
I hope this helps,
Nadav.
--
Nadav Har'El | Tuesday, Sep 27 2005, 23 Elul 5765
[EMAIL PROTECTED] |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |Having a smoking section in a restaurant
http://nadav.harel.org.il |is like having a peeing section in a pool