Re: [Libreoffice] memory leaks found with valgrind

2011-11-18 Thread Michael Meeks

On Thu, 2011-11-17 at 21:12 -0500, August Sodora wrote:
 So hooray we save 160 bytes.

Great :-) of course, that is the oosplash wrapper that -should- exit
rather sooner than it does IMHO (I still need to look into that for
3.5). The main interest would be in running valgrind on soffice.bin (I
assume you're following forks ?).

  The second initially makes me think that
 a matching XCloseDisplay is missing but I'm not sure why the call that
 is already there isn't getting called if the first leak was fixed:
 
 ==11027== 124 bytes in 1 blocks are definitely lost in loss record 6 of 8
 ==11027==at 0x4A06031: malloc (vg_replace_malloc.c:236)
 ==11027==by 0x3FA060BD79: get_peer_sock_name (xcb_auth.c:259)
 ==11027==by 0x3FA060BE45: _xcb_get_auth_info (xcb_auth.c:302)
 ==11027==by 0x3FA060B84E: xcb_connect_to_display_with_auth_info
 (xcb_util.c:424)

Of course this could just as easily be a leak in the X server; valgrind
finds them all over the place :-) anyhow, good to have you chasing that.
To debug leaks in soffice.bin you really need to:

export G_SLICE=1

Which makes LibO use the malloc allocator which valgrind can track
instead of it's own internal one. If you have run 'linkoo' then source
ooenv in program/ should set all that good stuff for you :-)

Thanks !

Michael.

-- 
michael.me...@suse.com  , Pseudo Engineer, itinerant idiot

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] memory leaks found with valgrind

2011-11-18 Thread Marc-André Laverdière
I think we should have a tiny script with all those goodies to easily
invoke. Or some alias that gets set in Env.Host.sh

What do you think?

Marc-André LAVERDIÈRE
Perseverance must finish its work so that you may be mature and complete,
not lacking anything. -James 1:4
http://asimplediscipleslife.blogspot.com/
mlaverd.theunixplace.com




On Fri, Nov 18, 2011 at 5:32 AM, Michael Meeks michael.me...@suse.comwrote:


 On Thu, 2011-11-17 at 21:12 -0500, August Sodora wrote:
  So hooray we save 160 bytes.

 Great :-) of course, that is the oosplash wrapper that -should-
 exit
 rather sooner than it does IMHO (I still need to look into that for
 3.5). The main interest would be in running valgrind on soffice.bin (I
 assume you're following forks ?).

   The second initially makes me think that
  a matching XCloseDisplay is missing but I'm not sure why the call that
  is already there isn't getting called if the first leak was fixed:
 
  ==11027== 124 bytes in 1 blocks are definitely lost in loss record 6 of 8
  ==11027==at 0x4A06031: malloc (vg_replace_malloc.c:236)
  ==11027==by 0x3FA060BD79: get_peer_sock_name (xcb_auth.c:259)
  ==11027==by 0x3FA060BE45: _xcb_get_auth_info (xcb_auth.c:302)
  ==11027==by 0x3FA060B84E: xcb_connect_to_display_with_auth_info
  (xcb_util.c:424)

 Of course this could just as easily be a leak in the X server;
 valgrind
 finds them all over the place :-) anyhow, good to have you chasing that.
 To debug leaks in soffice.bin you really need to:

export G_SLICE=1

Which makes LibO use the malloc allocator which valgrind can track
 instead of it's own internal one. If you have run 'linkoo' then source
 ooenv in program/ should set all that good stuff for you :-)

Thanks !

Michael.

 --
 michael.me...@suse.com  , Pseudo Engineer, itinerant idiot

 ___
 LibreOffice mailing list
 LibreOffice@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/libreoffice

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] memory leaks found with valgrind

2011-11-18 Thread Michael Meeks

On Fri, 2011-11-18 at 07:33 -0500, Marc-André Laverdière wrote:
 I think we should have a tiny script with all those goodies to easily
 invoke. Or some alias that gets set in Env.Host.sh

Sure - if you linkoo - just source 'ooenv' before running, a make
dev-install should do that for you, and you have to do that to run gdb
on soffice.bin anyway, so ... should be already done.

HTH,

Michael.

-- 
michael.me...@suse.com  , Pseudo Engineer, itinerant idiot

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] memory leaks found with valgrind

2011-11-17 Thread August Sodora
Hello,

I was a little curious about valgrind so I ran it against soffice and
found a few memory leaks. The two that I looked at are very minor but
I figured I'd try them to start with. The attached patch corrects the
first and the second I had difficulty understanding.

The first is caused by not calling XFreeGC when the splash screen closes:

==11027== 160 bytes in 1 blocks are definitely lost in loss record 7 of 8
==11027==at 0x4A06031: malloc (vg_replace_malloc.c:236)
==11027==by 0x3FA0A215EB: XCreateGC (CrGC.c:75)
==11027==by 0x406480: splash_create_window (splashx.c:555)
==11027==by 0x406E44: splash_create (splashx.c:781)
==11027==by 0x4088D3: sal_main_with_args (start.c:850)
==11027==by 0x408755: main (start.c:789)

So hooray we save 160 bytes. The second initially makes me think that
a matching XCloseDisplay is missing but I'm not sure why the call that
is already there isn't getting called if the first leak was fixed:

==11027== 124 bytes in 1 blocks are definitely lost in loss record 6 of 8
==11027==at 0x4A06031: malloc (vg_replace_malloc.c:236)
==11027==by 0x3FA060BD79: get_peer_sock_name (xcb_auth.c:259)
==11027==by 0x3FA060BE45: _xcb_get_auth_info (xcb_auth.c:302)
==11027==by 0x3FA060B84E: xcb_connect_to_display_with_auth_info
(xcb_util.c:424)
==11027==by 0x3FA0A4CBC9: _XConnectXCB (xcb_disp.c:92)
==11027==by 0x3FA0A34BAA: XOpenDisplay (OpenDis.c:166)
==11027==by 0x406008: splash_create_window (splashx.c:503)
==11027==by 0x406E44: splash_create (splashx.c:781)
==11027==by 0x4088D3: sal_main_with_args (start.c:850)
==11027==by 0x408755: main (start.c:789)

August Sodora
aug...@gmail.com
(201) 280-8138
From 4e067b1297c7fbab8ca90ca8747efe2a39b55793 Mon Sep 17 00:00:00 2001
From: August Sodora aug...@gmail.com
Date: Thu, 17 Nov 2011 21:06:16 -0500
Subject: [PATCH] Valgrind: fixed memory leak

---
 desktop/unx/source/splashx.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/desktop/unx/source/splashx.c b/desktop/unx/source/splashx.c
index 0c7024d..3d3981d 100644
--- a/desktop/unx/source/splashx.c
+++ b/desktop/unx/source/splashx.c
@@ -744,6 +744,12 @@ void splash_destroy(struct splash* splash)
 {
 if(splash-display)
 {
+if(splash-gc)
+{
+XFreeGC(splash-display, splash-gc);
+splash-gc = NULL;
+}
+
 XCloseDisplay( splash-display );
 splash-display = NULL;
 png_destroy_read_struct( (splash-png_ptr), (splash-info_ptr), NULL );
-- 
1.7.4.4

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice