Some more memory leaks as pointed out by Valgrind

Christian Stimming stimming at tuhh.de
Tue May 8 16:35:56 EDT 2007


Some more output of valgrind. This time I started gnucash with one short file, 
opened another one, then the first one again. If there is a memory leak on 
opening any file as reported by 
http://bugzilla.gnome.org/show_bug.cgi?id=431324 , it should show up by now.  

However, I don't observe any clear memory leak that is due to file opening 
(maybe with the exception of gnc_commodity_new, third from last in the list). 
In any case here's the list of memory leaks in increasing order; maybe 
someone notices places where we can do something about it. 

Christian

==20033== 102 bytes in 20 blocks are definitely lost in loss record 118 of 278
==20033==    at 0x4023515: malloc (vg_replace_malloc.c:149)
==20033==    by 0x4B6C915: xmlStrndup (in /usr/lib/libxml2.so.2.6.26)
==20033==    by 0x4B6CA07: xmlStrdup (in /usr/lib/libxml2.so.2.6.26)
==20033==    by 0x4B1F0C4: xmlNodeGetContent (in /usr/lib/libxml2.so.2.6.26)
==20033==    by 0x42B4FCA: gnc_commodity_end_handler 
(gnc-commodity-xml-v2.c:224)
==20033==    by 0x42C6B39: sixtp_sax_end_handler (sixtp.c:522)
==20033==    by 0x4B03887: (within /usr/lib/libxml2.so.2.6.26)
==20033==    by 0x4B0F81A: xmlParseElement (in /usr/lib/libxml2.so.2.6.26)
==20033==    by 0x4B0D194: xmlParseContent (in /usr/lib/libxml2.so.2.6.26)
==20033==    by 0x4B0F7B4: xmlParseElement (in /usr/lib/libxml2.so.2.6.26)
==20033==    by 0x4B0D194: xmlParseContent (in /usr/lib/libxml2.so.2.6.26)
==20033==    by 0x4B0F7B4: xmlParseElement (in /usr/lib/libxml2.so.2.6.26)
 
==20033== 168 bytes in 18 blocks are definitely lost in loss record 131 of 278
==20033==    at 0x4023515: malloc (vg_replace_malloc.c:149)
==20033==    by 0x56A894B: vasprintf (in /lib/libc-2.5.so)
==20033==    by 0x55BD206: g_vasprintf 
(in /opt/gnome/lib/libglib-2.0.so.0.1200.4)
==20033==    by 0x55ADFC1: g_strdup_vprintf 
(in /opt/gnome/lib/libglib-2.0.so.0.1200.4)
==20033==    by 0x55ADFF6: g_strdup_printf 
(in /opt/gnome/lib/libglib-2.0.so.0.1200.4)
==20033==    by 0x4259413: gnc_history_gconf_index_to_key 
(gnc-plugin-file-history.c:121)
==20033==    by 0x425A124: gnc_history_add_file 
(gnc-plugin-file-history.c:189)
==20033==    by 0x4243619: gnc_add_history (gnc-file.c:491)
==20033==    by 0x4244FC9: gnc_post_file_open (gnc-file.c:817)
==20033==    by 0x42593A1: gnc_plugin_file_history_cmd_open_file 
(gnc-plugin-file-history.c:662)
==20033==    by 0x553A0B8: g_cclosure_marshal_VOID__VOID 
(in /opt/gnome/lib/libgobject-2.0.so.0.1200.4)
==20033==    by 0x552CC0A: g_closure_invoke 
(in /opt/gnome/lib/libgobject-2.0.so.0.1200.4)

==20033== 284 bytes in 71 blocks are definitely lost in loss record 151 of 278
==20033==    at 0x4023515: malloc (vg_replace_malloc.c:149)
==20033==    by 0x4C2888D: _wrap_gnc_module_load (swig-gnc-module.c:1257)
==20033==    by 0x54178DB: (within /usr/lib/libguile.so.17.0.1)
==20033==    by 0x541D789: scm_primitive_eval_x 
(in /usr/lib/libguile.so.17.0.1)
==20033==    by 0x543674E: scm_primitive_load (in /usr/lib/libguile.so.17.0.1)
==20033==    by 0x5417D9E: (within /usr/lib/libguile.so.17.0.1)
==20033==    by 0x5415976: scm_dapply (in /usr/lib/libguile.so.17.0.1)
==20033==    by 0x5415B62: scm_apply (in /usr/lib/libguile.so.17.0.1)
==20033==    by 0x541A74C: scm_call_0 (in /usr/lib/libguile.so.17.0.1)
==20033==    by 0x540AF37: scm_dynamic_wind (in /usr/lib/libguile.so.17.0.1)
==20033==    by 0x54178FB: (within /usr/lib/libguile.so.17.0.1)
==20033==    by 0x5418CC0: (within /usr/lib/libguile.so.17.0.1)

==20033== 666 bytes in 65 blocks are definitely lost in loss record 176 of 278
==20033==    at 0x4022854: calloc (vg_replace_malloc.c:279)
==20033==    by 0x559B1CD: g_malloc0 
(in /opt/gnome/lib/libglib-2.0.so.0.1200.4)
==20033==    by 0x404274D: kvp_frame_new (kvp_frame.c:99)
==20033==    by 0x404B74B: qof_instance_init (qofinstance.c:266)
==20033==    by 0x554C421: g_type_create_instance 
(in /opt/gnome/lib/libgobject-2.0.so.0.1200.4)
==20033==    by 0x5533E21: (within /opt/gnome/lib/libgobject-2.0.so.0.1200.4)
==20033==    by 0x5531A7A: g_object_newv 
(in /opt/gnome/lib/libgobject-2.0.so.0.1200.4)
==20033==    by 0x55325DD: g_object_new_valist 
(in /opt/gnome/lib/libgobject-2.0.so.0.1200.4)
==20033==    by 0x553278F: g_object_new 
(in /opt/gnome/lib/libgobject-2.0.so.0.1200.4)
==20033==    by 0x409A568: xaccDupeTransaction (Transaction.c:373)
==20033==    by 0x409A6A4: xaccTransBeginEdit (Transaction.c:846)
==20033==    by 0x42C0151: add_transaction_local (io-gncxml-v2.c:240)

==20033== 29,494 bytes in 1,661 blocks are definitely lost in loss record 263 
of 278
==20033==    at 0x4023515: malloc (vg_replace_malloc.c:149)
==20033==    by 0x559B265: g_malloc 
(in /opt/gnome/lib/libglib-2.0.so.0.1200.4)
==20033==    by 0x55AEA98: g_strdup 
(in /opt/gnome/lib/libglib-2.0.so.0.1200.4)
==20033==    by 0x557D5E3: g_cache_insert 
(in /opt/gnome/lib/libglib-2.0.so.0.1200.4)
==20033==    by 0x4055BB0: qof_util_string_cache_insert (qofutil.c:296)
==20033==    by 0x40A628E: gnc_commodity_new (gnc-commodity.c:573)
==20033==    by 0x40AA8AD: gnc_commodity_table_add_default_data 
(iso-4217-currencies.c:2457)
==20033==    by 0x40B0F79: commodity_table_book_begin (gnc-commodity.c:1869)
==20033==    by 0x4051470: qof_object_book_begin (qofobject.c:66)
==20033==    by 0x404F366: qof_book_new (qofbook.c:88)
==20033==    by 0x4058876: qof_session_new (qofsession.c:197)
==20033==    by 0x40BC671: gnc_get_current_session (gnc-session.c:38)

==20033== 98,116 (30,464 direct, 67,652 indirect) bytes in 119 blocks are 
definitely lost in loss record 266 of 278
==20033==    at 0x4023612: realloc (vg_replace_malloc.c:306)
==20033==    by 0x51A8013: (within /usr/lib/libfontconfig.so.1.1.0)
==20033==    by 0x51A89E3: (within /usr/lib/libfontconfig.so.1.1.0)
==20033==    by 0x51A8EDB: (within /usr/lib/libfontconfig.so.1.1.0)
==20033==    by 0x51A5662: FcFontRenderPrepare 
(in /usr/lib/libfontconfig.so.1.1.0)
==20033==    by 0x50CD308: (within /opt/gnome/lib/libpangoft2-1.0.so.0.1400.5)
==20033==    by 0x5104D5F: pango_font_map_load_fontset 
(in /opt/gnome/lib/libpango-1.0.so.0.1400.5)
==20033==    by 0x5102E01: (within /opt/gnome/lib/libpango-1.0.so.0.1400.5)
==20033==    by 0x5103141: pango_itemize_with_base_dir 
(in /opt/gnome/lib/libpango-1.0.so.0.1400.5)
==20033==    by 0x510B0FA: (within /opt/gnome/lib/libpango-1.0.so.0.1400.5)
==20033==    by 0x510BCDA: (within /opt/gnome/lib/libpango-1.0.so.0.1400.5)
==20033==    by 0x4DE05AF: (within /opt/gnome/lib/libgtk-x11-2.0.so.0.1000.6)

==20033== 391,504 bytes in 374 blocks are possibly lost in loss record 274 of 
278
==20033==    at 0x4022740: memalign (vg_replace_malloc.c:332)
==20033==    by 0x402279A: posix_memalign (vg_replace_malloc.c:425)
==20033==    by 0x55AA713: (within /opt/gnome/lib/libglib-2.0.so.0.1200.4)
==20033==    by 0x55AB4A7: g_slice_alloc 
(in /opt/gnome/lib/libglib-2.0.so.0.1200.4)
==20033==    by 0x5576308: g_array_sized_new 
(in /opt/gnome/lib/libglib-2.0.so.0.1200.4)
==20033==    by 0x5576442: g_array_new 
(in /opt/gnome/lib/libglib-2.0.so.0.1200.4)
==20033==    by 0x55B2642: g_static_private_set 
(in /opt/gnome/lib/libglib-2.0.so.0.1200.4)
==20033==    by 0x557E6AB: g_get_filename_charsets 
(in /opt/gnome/lib/libglib-2.0.so.0.1200.4)
==20033==    by 0x557E72C: (within /opt/gnome/lib/libglib-2.0.so.0.1200.4)
==20033==    by 0x55B2719: g_thread_init_glib 
(in /opt/gnome/lib/libglib-2.0.so.0.1200.4)
==20033==    by 0x5520539: g_thread_init 
(in /opt/gnome/lib/libgthread-2.0.so.0.1200.4)
==20033==    by 0x804A308: main (gnucash-bin.c:568)


More information about the gnucash-devel mailing list