public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] memory leak with gtk+-2.8.20-r1
@ 2006-08-02 10:58 gwe
  2006-08-02 11:16 ` Hans-Werner Hilse
  2006-08-02 15:14 ` Randy Barlow
  0 siblings, 2 replies; 9+ messages in thread
From: gwe @ 2006-08-02 10:58 UTC (permalink / raw
  To: gentoo-user

Hello,
I use gtk+ for my soft's graphic interface.
But valgrind make an log file containing approximately 22700 lines for an
simple source code like : 
#include <gtk/gtk.h>

int main(int argc, char **argv) {
	gtk_init(&argc, &argv);
	  GtkWidget *win= gtk_window_new(GTK_WINDOW_TOPLEVEL);
	  g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(gtk_main_quit), NULL);  
	  gtk_widget_show_all(win);
	  gtk_main();
	  return EXIT_SUCCESS;
}
It's difficult to write more simple code...
I've made many searchs on the web but nothing information to resolve this problem.
I've recompiling all with : emerge -e world
downgrading all of X parts and gtk+ & glib. But the result are the same.
Visibly the big part of error are in gtk_init -> gdk_display_open and XOpenDisplay in libX11

Someone has the same problem or an solution to solve this leak of memory?
Thank you very much.
It's difficult to write more simple code...  
I've made many search on the web but nothing informations to resolve this problem.  
I've recompilling all with : emerge -e world  
downgrading all of X parts and gtk+ & glib. 
But results are the same.  
Visibly the most big part of errors are in gtk_init -> gdk_display_open and XOpenDisplay in libX11    
Someone has the same problem or an solution to solve this leak of memory?  
Thank you very much.
Gwenhaël

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gentoo-user] memory leak with gtk+-2.8.20-r1
@ 2006-08-02 11:04 gwe
  0 siblings, 0 replies; 9+ messages in thread
From: gwe @ 2006-08-02 11:04 UTC (permalink / raw
  To: gentoo-user

Hello,
I use gtk+ for my soft's graphic interface.
But valgrind make an log file containing approximately 22700 lines for an
simple source code like : 
#include <gtk/gtk.h>

int main(int argc, char **argv) {
	gtk_init(&argc, &argv);
	  GtkWidget *win= gtk_window_new(GTK_WINDOW_TOPLEVEL);
	  g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(gtk_main_quit), NULL);  
	  gtk_widget_show_all(win);
	  gtk_main();
	  return EXIT_SUCCESS;
}
It's difficult to write more simple code...
I've made many searchs on the web but nothing information to resolve this problem.
I've recompiling all with : emerge -e world
downgrading all of X parts and gtk+ & glib. But the result are the same.
Visibly the big part of error are in gtk_init -> gdk_display_open and XOpenDisplay in libX11

Someone has the same problem or an solution to solve this leak of memory?
Thank you very much.
It's difficult to write more simple code...  
I've made many search on the web but nothing informations to resolve this problem.  
I've recompilling all with : emerge -e world  
downgrading all of X parts and gtk+ & glib. 
But results are the same.  
Visibly the most big part of errors are in gtk_init -> gdk_display_open and XOpenDisplay in libX11    
Someone has the same problem or an solution to solve this leak of memory?  
Thank you very much.
Gwenhaël

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] memory leak with gtk+-2.8.20-r1
  2006-08-02 10:58 [gentoo-user] memory leak with gtk+-2.8.20-r1 gwe
@ 2006-08-02 11:16 ` Hans-Werner Hilse
  2006-08-02 15:14 ` Randy Barlow
  1 sibling, 0 replies; 9+ messages in thread
From: Hans-Werner Hilse @ 2006-08-02 11:16 UTC (permalink / raw
  To: gentoo-user

Hi,

On Wed, 02 Aug 2006 12:58:33 +0200 gwe <gwenjo@free.fr> wrote:

> Someone has the same problem or an solution to solve this leak of
> memory? Thank you very much.

You should at least describe the problem you have. You're just
describing the things you've tried to nail it down, but what are the
symptoms? What makes you think there's a memory leak in your program?

-hwh
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] memory leak with gtk+-2.8.20-r1
       [not found] ` <6FmVF-4oe-19@gated-at.bofh.it>
@ 2006-08-02 11:49   ` gwe
  2006-08-02 13:47     ` Hans-Werner Hilse
  0 siblings, 1 reply; 9+ messages in thread
From: gwe @ 2006-08-02 11:49 UTC (permalink / raw
  To: gentoo-user

Le Wed, 02 Aug 2006 13:20:07 +0200, Hans-Werner Hilse a écrit :

> Hi,
> 
> On Wed, 02 Aug 2006 12:58:33 +0200 gwe <gwenjo@free.fr> wrote:
> 
>> Someone has the same problem or an solution to solve this leak of
>> memory? Thank you very much.
> 
> You should at least describe the problem you have. You're just
> describing the things you've tried to nail it down, but what are the
> symptoms? What makes you think there's a memory leak in your program?
> 
> -hwh
I'm sorry
I post only the end of log file of valgrind (the entire file is very big
~22500 lines).
This is the result of execute the source code :
==13767== LEAK SUMMARY:
==13767==    definitely lost: 36 bytes in 1 blocks.
==13767==    indirectly lost: 120 bytes in 10 blocks.
==13767==      possibly lost: 40,264 bytes in 47 blocks.
==13767==    still reachable: 118,673 bytes in 1,963 blocks.
==13767==         suppressed: 0 bytes in 0 blocks.
--13767--  memcheck: sanity checks: 59 cheap, 3 expensive
--13767--  memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use
--13767--  memcheck: auxmaps: 0 searches, 0 comparisons
--13767--  memcheck: secondaries: 53 issued (3392k, 3M)
--13767--  memcheck: secondaries: 115 accessible and distinguished (7360k, 7M)
--13767--     tt/tc: 46,665 tt lookups requiring 56,738 probes
--13767--     tt/tc: 46,665 fast-cache updates, 8 flushes
--13767-- translate: new        19,998 (425,678 -> 6,983,632; ratio 164:10) [0 scs]
--13767-- translate: dumped     0 (0 -> ??)
--13767-- translate: discarded  209 (3,781 -> ??)
--13767-- scheduler: 2,984,389 jumps (bb entries).
--13767-- scheduler: 59/33,828 major/minor sched events.
--13767--    sanity: 60 cheap, 3 expensive checks.
--13767--    exectx: 30,011 lists, 4,057 contexts (avg 0 per list)
--13767--    exectx: 6,894 searches, 3,112 full compares (451 per 1000)
--13767--    exectx: 0 cmp2, 196 cmp4, 1,062,968 cmpAll

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] memory leak with gtk+-2.8.20-r1
  2006-08-02 11:49   ` gwe
@ 2006-08-02 13:47     ` Hans-Werner Hilse
  2006-08-02 15:20       ` Randy Barlow
  0 siblings, 1 reply; 9+ messages in thread
From: Hans-Werner Hilse @ 2006-08-02 13:47 UTC (permalink / raw
  To: gentoo-user

Hi,

On Wed, 02 Aug 2006 13:49:04 +0200 gwe <gwenjo@free.fr> wrote:

> I'm sorry
> I post only the end of log file of valgrind (the entire file is very big
> ~22500 lines).
> This is the result of execute the source code :
> ==13767== LEAK SUMMARY:
> ==13767==    definitely lost: 36 bytes in 1 blocks.
> ==13767==    indirectly lost: 120 bytes in 10 blocks.
> ==13767==      possibly lost: 40,264 bytes in 47 blocks.
> ==13767==    still reachable: 118,673 bytes in 1,963 blocks.
> ==13767==         suppressed: 0 bytes in 0 blocks.

OK, but memory usage doesn't add up while the program is running,
right? I think it may be just the missing call to gtk_exit(EXIT_SUCCESS)
instead of return EXITSUCCESS. At least gtk_exit() is supposed to do
final cleanup work.

But I think this is rather OT for this list. If you don't get more
answers here, you may seek help at the GTK project...

-hwh
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] memory leak with gtk+-2.8.20-r1
  2006-08-02 10:58 [gentoo-user] memory leak with gtk+-2.8.20-r1 gwe
  2006-08-02 11:16 ` Hans-Werner Hilse
@ 2006-08-02 15:14 ` Randy Barlow
  1 sibling, 0 replies; 9+ messages in thread
From: Randy Barlow @ 2006-08-02 15:14 UTC (permalink / raw
  To: gentoo-user

gwe wrote:
> Hello,
> I use gtk+ for my soft's graphic interface.
> But valgrind make an log file containing approximately 22700 lines for an
> simple source code like : 
> #include <gtk/gtk.h>
> 
> int main(int argc, char **argv) {
> 	gtk_init(&argc, &argv);
> 	  GtkWidget *win= gtk_window_new(GTK_WINDOW_TOPLEVEL);
> 	  g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(gtk_main_quit), NULL);  
> 	  gtk_widget_show_all(win);
> 	  gtk_main();
> 	  return EXIT_SUCCESS;
> }

For one, you didn't delete the dynamic memory you allocated when you 
were finished with it.  Before EXIT_SUCCESS, add:

delete win;

R
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] memory leak with gtk+-2.8.20-r1
  2006-08-02 13:47     ` Hans-Werner Hilse
@ 2006-08-02 15:20       ` Randy Barlow
  0 siblings, 0 replies; 9+ messages in thread
From: Randy Barlow @ 2006-08-02 15:20 UTC (permalink / raw
  To: gentoo-user

Hans-Werner Hilse wrote:
> Hi,
> 
> On Wed, 02 Aug 2006 13:49:04 +0200 gwe <gwenjo@free.fr> wrote:
> 
>> I'm sorry
>> I post only the end of log file of valgrind (the entire file is very big
>> ~22500 lines).
>> This is the result of execute the source code :
>> ==13767== LEAK SUMMARY:
>> ==13767==    definitely lost: 36 bytes in 1 blocks.
>> ==13767==    indirectly lost: 120 bytes in 10 blocks.
>> ==13767==      possibly lost: 40,264 bytes in 47 blocks.
>> ==13767==    still reachable: 118,673 bytes in 1,963 blocks.
>> ==13767==         suppressed: 0 bytes in 0 blocks.
> 
> OK, but memory usage doesn't add up while the program is running,
> right? I think it may be just the missing call to gtk_exit(EXIT_SUCCESS)
> instead of return EXITSUCCESS. At least gtk_exit() is supposed to do
> final cleanup work.

Ah yes, I wasn't aware that there was a function for this.  You should 
definitely use this in place of the delete statement because it will do 
deeper cleaning.

R
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] memory leak with gtk+-2.8.20-r1
       [not found]       ` <6FqPE-1YI-3@gated-at.bofh.it>
@ 2006-08-02 16:14         ` gwe
  2006-08-02 16:24           ` Hans-Werner Hilse
  0 siblings, 1 reply; 9+ messages in thread
From: gwe @ 2006-08-02 16:14 UTC (permalink / raw
  To: gentoo-user

Le Wed, 02 Aug 2006 17:30:10 +0200, Randy Barlow a écrit :

> Ah yes, I wasn't aware that there was a function for this.  You should 
> definitely use this in place of the delete statement because it will do 
> deeper cleaning.

the GTK Api said gtk_exit is deprecated and should not be used.  
In fact, i'm very astonished because it's not the first software with GTK
I  wrote but it's the first time that I have this problem.  
It's so recent

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] memory leak with gtk+-2.8.20-r1
  2006-08-02 16:14         ` gwe
@ 2006-08-02 16:24           ` Hans-Werner Hilse
  0 siblings, 0 replies; 9+ messages in thread
From: Hans-Werner Hilse @ 2006-08-02 16:24 UTC (permalink / raw
  To: gentoo-user

Hi,

On Wed, 02 Aug 2006 18:14:02 +0200
gwe <gwenjo@free.fr> wrote:

> > Ah yes, I wasn't aware that there was a function for this.  You should 
> > definitely use this in place of the delete statement because it will do 
> > deeper cleaning.
> 
> the GTK Api said gtk_exit is deprecated and should not be used.  
> In fact, i'm very astonished because it's not the first software with GTK
> I  wrote but it's the first time that I have this problem.  
> It's so recent

OK, I didn't counter-check it and was probably reading some outdated
documentation. I was just searching for some kind of cleanup function
and thought I found it. So it's probably in fact a gtk memory leak. Are
you by chance running non-x86? That might explain why it passed some
tests though buggy on that arch...

OK, I'm out of suggestions :-) Maybe a manual delete would help, but I
somehow doubt that (cleanup is probably done by gtk_main_quit() now?)

-hwh
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-08-02 16:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-02 10:58 [gentoo-user] memory leak with gtk+-2.8.20-r1 gwe
2006-08-02 11:16 ` Hans-Werner Hilse
2006-08-02 15:14 ` Randy Barlow
  -- strict thread matches above, loose matches on Subject: below --
2006-08-02 11:04 gwe
     [not found] <6FmCn-3KJ-17@gated-at.bofh.it>
     [not found] ` <6FmVF-4oe-19@gated-at.bofh.it>
2006-08-02 11:49   ` gwe
2006-08-02 13:47     ` Hans-Werner Hilse
2006-08-02 15:20       ` Randy Barlow
     [not found] <6FnoP-4ZX-69@gated-at.bofh.it>
     [not found] ` <6FnoP-4ZX-71@gated-at.bofh.it>
     [not found]   ` <6FnoP-4ZX-67@gated-at.bofh.it>
     [not found]     ` <6FpgY-7RO-5@gated-at.bofh.it>
     [not found]       ` <6FqPE-1YI-3@gated-at.bofh.it>
2006-08-02 16:14         ` gwe
2006-08-02 16:24           ` Hans-Werner Hilse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox