From: William K. V. <wk...@us...> - 2005-06-06 18:19:37
|
Hello Bob, On Mon, 2005-06-06 at 08:30, Bob Doan wrote: > Patch applied! > > > One left however is in rpdf.c, > > the call to rpdf_text is leaving allocations on the slist: > > > > ==14555== 13627 bytes in 32 blocks are still reachable in loss record 28 > > of 32 > > ==14555== at 0x1B904A80: malloc (vg_replace_malloc.c:131) > > ==14555== by 0xAA7A56: g_malloc (in /usr/lib/libglib-2.0.so.0.400.8) > > ==14555== by 0xAA8C03: g_mem_chunk_alloc (in > > /usr/lib/libglib-2.0.so.0.400.8) > > ==14555== by 0xAB675C: (within /usr/lib/libglib-2.0.so.0.400.8) > > ==14555== by 0xAB5CB1: g_slist_append (in > > /usr/lib/libglib-2.0.so.0.400.8) > > ==14555== by 0x1B945607: rpdf_stream_append (rpdf.c:142) <snip> > > Since I'm not a glib guru (actually I've not coded in C since 1997) > > I'm not certain what's going wrong here, I added the call > > to g_slist_free in rpdf_free however it didn't fix the problem. > > I see in your new patch you freed the page_contents in RPDF which looks > like the right thing to do to fix the problem. I'm going to go w/ that > patch you have now since it fixes a lot of things. I'll poke it a bit > further and see why valgrind still complains. GLIB doesn't always sys > free on a glib free call and valgrind doesn't know about this so its > harder to find mem leaks.. let me poke @ it. Actually reading the glib docs closely you hit on it: g_slist_free () void g_slist_free (GSList *list); Frees all of the memory used by a GSList. The freed elements are added to the GListAllocator free list. I had also seen this entry which I already figured out could not be fixed: ==17376== 40800 bytes in 2 blocks are still reachable in loss record 30 of 32 ==17376== at 0x1B904A80: malloc (vg_replace_malloc.c:131) ==17376== by 0x73795B: __gconv_open (in /lib/tls/libc-2.3.3.so) ==17376== by 0x7374E4: iconv_open (in /lib/tls/libc-2.3.3.so) ==17376== by 0xA8D835: (within /usr/lib/libglib-2.0.so.0.400.8) ==17376== by 0xA8D8E2: g_iconv_open (in /usr/lib/libglib-2.0.so.0.400.8) ==17376== by 0xA8DEEE: (within /usr/lib/libglib-2.0.so.0.400.8) ==17376== by 0xA8E1C0: g_convert (in /usr/lib/libglib-2.0.so.0.400.8) ==17376== by 0xA8EC81: g_locale_from_utf8 (in /usr/lib/libglib-2.0.so.0.400.8) ==17376== by 0xA94EEE: g_date_strftime (in /usr/lib/libglib-2.0.so.0.400.8) ==17376== by 0x1BD7FFC0: rlib_datetime_format_date (datetime.c:119) Since it is now the normal work week my time becomes a bit more limited. Hopefully everything goes well. Take care, William. |