Re: Leak in the pango cairo example?



Hi,

Sebastian Bauer <mail sebastianbauer info> schrieb:
[...]
> Therefore I
> tried the cairo example, as provided at
> http://library.gnome.org/devel/pango/unstable/pango-Cairo-Rendering.html in
> order to check, whether my code is wrong.
> 
> However, even with Example 1 that is listed there, I get those leaks. You'll
> find the output of valgrind attached to this mail. Is there anything that
can
> be done about the leaks?
> 
> I'm using pango 1.20.5.

Replying to myself. I also tried with 1.22.2, because I read that there was a
memory leak fixed. However, they are still leaks. I attached the new valgrind
output.

Bye,
Sebastian
sba my:~/test$ valgrind --leak-check=full ./a.out test.png
==17736== Memcheck, a memory error detector.
==17736== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==17736== Using LibVEX rev 1854, a library for dynamic binary translation.
==17736== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==17736== Using valgrind-3.3.1-Debian, a dynamic binary instrumentation framework.
==17736== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==17736== For more details, rerun with: -v
==17736== 
==17736== 
==17736== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 28 from 2)
==17736== malloc/free: in use at exit: 356,108 bytes in 4,469 blocks.
==17736== malloc/free: 19,588 allocs, 15,119 frees, 5,431,895 bytes allocated.
==17736== For counts of detected errors, rerun with: -v
==17736== searching for pointers to 4,469 not-freed blocks.
==17736== checked 620,200 bytes.
==17736== 
==17736== 32 bytes in 1 blocks are possibly lost in loss record 4 of 69
==17736==    at 0x4C21FEB: malloc (vg_replace_malloc.c:207)
==17736==    by 0x68BEFBD: (within /usr/lib/libfontconfig.so.1.3.0)
==17736==    by 0x68BBFF5: FcFontRenderPrepare (in /usr/lib/libfontconfig.so.1.3.0)
==17736==    by 0x61F194B: pango_fc_font_map_load_fontset (pangofc-fontmap.c:1098)
==17736==    by 0x52CCFAD: itemize_state_process_run (pango-context.c:1280)
==17736==    by 0x52CD457: pango_itemize_with_base_dir (pango-context.c:1466)
==17736==    by 0x52D551E: pango_layout_check_lines (pango-layout.c:3824)
==17736==    by 0x52D67AC: pango_layout_get_extents_internal (pango-layout.c:2443)
==17736==    by 0x52D6FCD: pango_layout_get_size (pango-layout.c:2669)
==17736==    by 0x400FF8: draw_text (in /home/sba/test/a.out)
==17736==    by 0x4010FA: main (in /home/sba/test/a.out)
==17736== 
==17736== 
==17736== 292 (52 direct, 240 indirect) bytes in 1 blocks are definitely lost in loss record 14 of 69
==17736==    at 0x4C21FEB: malloc (vg_replace_malloc.c:207)
==17736==    by 0x5CEFFE0: (within /lib/libc-2.7.so)
==17736==    by 0x5CF089E: __nss_database_lookup (in /lib/libc-2.7.so)
==17736==    by 0x8D8642F: ???
==17736==    by 0x8D87968: ???
==17736==    by 0x5CA4A00: getpwnam_r (in /lib/libc-2.7.so)
==17736==    by 0x59B1D91: (within /usr/lib/libglib-2.0.so.0.1800.2)
==17736==    by 0x59B3794: g_get_home_dir (in /usr/lib/libglib-2.0.so.0.1800.2)
==17736==    by 0x52DF0DD: pango_config_key_get (pango-utils.c:623)
==17736==    by 0x52C9990: pango_find_map (modules.c:507)
==17736==    by 0x52CCD6A: itemize_state_process_run (pango-context.c:1217)
==17736==    by 0x52CD457: pango_itemize_with_base_dir (pango-context.c:1466)
==17736== 
==17736== 
==17736== 1,626 bytes in 21 blocks are possibly lost in loss record 45 of 69
==17736==    at 0x4C210FC: calloc (vg_replace_malloc.c:397)
==17736==    by 0x5987169: g_malloc0 (in /usr/lib/libglib-2.0.so.0.1800.2)
==17736==    by 0x5523024: (within /usr/lib/libgobject-2.0.so.0.1800.2)
==17736==    by 0x5523099: (within /usr/lib/libgobject-2.0.so.0.1800.2)
==17736==    by 0x5526829: g_type_register_fundamental (in /usr/lib/libgobject-2.0.so.0.1800.2)
==17736==    by 0x5530501: (within /usr/lib/libgobject-2.0.so.0.1800.2)
==17736==    by 0x552575F: g_type_init_with_debug_flags (in /usr/lib/libgobject-2.0.so.0.1800.2)
==17736==    by 0x4E2C488: pango_cairo_font_map_new (pangocairo-fontmap.c:92)
==17736==    by 0x4E2C4C4: pango_cairo_font_map_get_default (pangocairo-fontmap.c:175)
==17736==    by 0x4E2B12A: pango_cairo_create_context (pangocairo-context.c:410)
==17736==    by 0x4E2B197: pango_cairo_create_layout (pangocairo-context.c:446)
==17736==    by 0x400EA8: draw_text (in /home/sba/test/a.out)
==17736== 
==17736== 
==17736== 14,144 bytes in 12 blocks are possibly lost in loss record 62 of 69
==17736==    at 0x4C20FCF: memalign (vg_replace_malloc.c:460)
==17736==    by 0x4C21068: posix_memalign (vg_replace_malloc.c:569)
==17736==    by 0x599BB80: (within /usr/lib/libglib-2.0.so.0.1800.2)
==17736==    by 0x599CCF6: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.1800.2)
==17736==    by 0x599CE35: g_slice_alloc0 (in /usr/lib/libglib-2.0.so.0.1800.2)
==17736==    by 0x552A9CF: g_type_create_instance (in /usr/lib/libgobject-2.0.so.0.1800.2)
==17736==    by 0x550F46A: (within /usr/lib/libgobject-2.0.so.0.1800.2)
==17736==    by 0x550FAB2: g_object_newv (in /usr/lib/libgobject-2.0.so.0.1800.2)
==17736==    by 0x5510606: g_object_new_valist (in /usr/lib/libgobject-2.0.so.0.1800.2)
==17736==    by 0x551074B: g_object_new (in /usr/lib/libgobject-2.0.so.0.1800.2)
==17736==    by 0x4E2C4C4: pango_cairo_font_map_get_default (pangocairo-fontmap.c:175)
==17736==    by 0x4E2B12A: pango_cairo_create_context (pangocairo-context.c:410)
==17736== 
==17736== 
==17736== 40,768 (14,336 direct, 26,432 indirect) bytes in 28 blocks are definitely lost in loss record 66 of 69
==17736==    at 0x4C220C2: realloc (vg_replace_malloc.c:429)
==17736==    by 0x68BE782: (within /usr/lib/libfontconfig.so.1.3.0)
==17736==    by 0x68BF0F5: (within /usr/lib/libfontconfig.so.1.3.0)
==17736==    by 0x68BBFF5: FcFontRenderPrepare (in /usr/lib/libfontconfig.so.1.3.0)
==17736==    by 0x61F194B: pango_fc_font_map_load_fontset (pangofc-fontmap.c:1098)
==17736==    by 0x52CCFAD: itemize_state_process_run (pango-context.c:1280)
==17736==    by 0x52CD457: pango_itemize_with_base_dir (pango-context.c:1466)
==17736==    by 0x52D551E: pango_layout_check_lines (pango-layout.c:3824)
==17736==    by 0x52D67AC: pango_layout_get_extents_internal (pango-layout.c:2443)
==17736==    by 0x52D6FCD: pango_layout_get_size (pango-layout.c:2669)
==17736==    by 0x400FF8: draw_text (in /home/sba/test/a.out)
==17736==    by 0x4010FA: main (in /home/sba/test/a.out)
==17736== 
==17736== LEAK SUMMARY:
==17736==    definitely lost: 14,388 bytes in 29 blocks.
==17736==    indirectly lost: 26,672 bytes in 836 blocks.
==17736==      possibly lost: 15,802 bytes in 34 blocks.
==17736==    still reachable: 299,246 bytes in 3,570 blocks.
==17736==         suppressed: 0 bytes in 0 blocks.
==17736== Reachable blocks (those to which a pointer was found) are not shown.
==17736== To see them, rerun with: --leak-check=full --show-reachable=yes


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]