[cairo] memory leak in _cairo_pattern_create_solid
Nguyen Vu Hung
vuhung16plus at gmail.com
Fri Oct 12 03:47:06 PDT 2007
Hi Chris,
2007/10/12, Chris Wilson <chris at chris-wilson.co.uk>:
> Nguyen Vu Hung (vuhung16plus at gmail.com) said:
> > I think I've found a memory leak in cairo 1.4.10, file cairo-pattern.c,
> > function _cairo_pattern_create_solid.
> > In that function, variable *pattern is malloc()'ed but has not free() yet.
[snip]
> The 'leak' is intentional as we keep a few solid patterns around to avoid
> having to continually allocate new patterns. In order to free up this
> and other static caches cairo maintains, call
> cairo_debug_reset_static_data() whilst exiting your code. You must be
> sure that you have released all of your own cairo objects - contexts,
> surfaces, patterns, fonts - before calling
> cairo_debug_reset_static_data().
Thank you.
It seems that cairo_debug_reset_static_data() calling fixes the memory
"leak" made by cairo_create();. I am now fine with
cairo_create();
cairo_debug_reset_static_data();
No more leak.
The next cairo API that I am having problem with is cairo_show_text().
In my ( real production ) application, it has to call
cairo_show_text() about 60,000,000 ( sixty millions ) times.
For the following code, valgrind reports that cairo_show_text()
creates an amount of 178,143 bytes memory leak.
Therefore, of course, if I call cairo_show_text() 60,000,000 times,
the system will run out of memory.
I've tried cairo_show_text() with cairo_debug_reset_static_data() but
it didn't realease memory for me.
So what I have to do with cairo_show_text()'s mem leak?
Is there anything similar to cairo_debug_reset_static_data that works
with cairo_show_text()?
test code:
#include <cairo.h>
int
main (int argc, char *argv[])
{
cairo_surface_t *surface;
cairo_t *cr;
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 240, 80);
cr = cairo_create (surface);
cairo_select_font_face (cr, "serif", CAIRO_FONT_SLANT_ITALIC,
CAIRO_FONT_WEIGHT_BOLD);
#if 0
cairo_set_font_size (cr, 32.0);
cairo_set_source_rgb (cr, 0.0, 0.0, 1.0);
cairo_move_to (cr, 10.0, 50.0);
#endif#if 1
cairo_show_text (cr, "Hello, world");#endif
cairo_destroy (cr);
cairo_surface_write_to_png (surface, "hello.png");
cairo_surface_destroy (surface);
cairo_debug_reset_static_data();
return 0;
}
valgrind --tool=memcheck --leak-check=full --show-reachable=yes ./testImage
ro-ft-font.c:1625)
==26214== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 36 from 1)
==26214== malloc/free: in use at exit: 178,143 bytes in 1,725 blocks.
==26214== malloc/free: 48,303 allocs, 46,578 frees, 4,454,079 bytes allocated.
==26214== For counts of detected errors, rerun with: -v
==26214== searching for pointers to 1,725 not-freed blocks.
==26214== checked 536,480 bytes.
==26214==
==26214== 12 bytes in 1 blocks are still reachable in loss record 1 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8B54C2: FcFontSetCreate (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEB15: FcConfigBuildFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B570F: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B58FD: FcInit (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEAB5: FcConfigGetCurrent (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B037D: FcConfigSubstituteWithPat (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B06C0: FcConfigSubstitute (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8060DE5: _cairo_ft_scaled_font_create_toy
(cairo-ft-font.c:1625)
==26214== by 0x805577F: cairo_scaled_font_create (cairo-scaled-font.c:540)
==26214== by 0x804F5DC: _cairo_gstate_ensure_scaled_font
(cairo-gstate.c:1466)
==26214== by 0x804F689: _cairo_gstate_text_to_glyphs (cairo-gstate.c:1503)
==26214==
==26214==
==26214== 12 bytes in 1 blocks are still reachable in loss record 2 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8AC66E: FcBlanksCreate (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BD516: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x69CE5D: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69DAB0: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x698657: XML_ParseBuffer (in /usr/lib/libexpat.so.0.5.0)
==26214== by 0x8BCFF1: FcConfigParseAndLoad (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56A1: FcInitLoadConfig (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56FF: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B58FD: FcInit (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEAB5: FcConfigGetCurrent (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B037D: FcConfigSubstituteWithPat (in
/usr/lib/libfontconfig.so.1.0.4)
==26214==
==26214==
==26214== 12 bytes in 1 blocks are still reachable in loss record 3 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8BC03A: FcExprCreateField (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BCBF3: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BCC5D: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BCCE1: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BD963: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x69CE5D: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69DAB0: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x698657: XML_ParseBuffer (in /usr/lib/libexpat.so.0.5.0)
==26214== by 0x8BCFF1: FcConfigParseAndLoad (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56A1: FcInitLoadConfig (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56FF: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214==
==26214==
==26214== 12 bytes in 1 blocks are still reachable in loss record 4 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8BBF4E: FcExprCreateMatrix (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BCC32: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BCC5D: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BCCE1: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BD963: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x69CE5D: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69DAB0: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x698657: XML_ParseBuffer (in /usr/lib/libexpat.so.0.5.0)
==26214== by 0x8BCFF1: FcConfigParseAndLoad (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56A1: FcInitLoadConfig (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56FF: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214==
==26214==
==26214== 32 bytes in 1 blocks are still reachable in loss record 5 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8B8798: FcMatrixCopy (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BBF79: FcExprCreateMatrix (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BCC32: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BCC5D: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BCCE1: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BD963: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x69CE5D: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69DAB0: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x698657: XML_ParseBuffer (in /usr/lib/libexpat.so.0.5.0)
==26214== by 0x8BCFF1: FcConfigParseAndLoad (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56A1: FcInitLoadConfig (in /usr/lib/libfontconfig.so.1.0.4)
==26214==
==26214==
==26214== 36 bytes in 3 blocks are still reachable in loss record 6 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8BC090: FcExprCreateConst (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BCC02: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BCC5D: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BD8ED: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x69CE5D: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69DAB0: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x698657: XML_ParseBuffer (in /usr/lib/libexpat.so.0.5.0)
==26214== by 0x8BCFF1: FcConfigParseAndLoad (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56A1: FcInitLoadConfig (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56FF: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B58FD: FcInit (in /usr/lib/libfontconfig.so.1.0.4)
==26214==
==26214==
==26214== 36 bytes in 3 blocks are still reachable in loss record 7 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8BBEAA: FcExprCreateDouble (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BCC20: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BCC5D: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BD8ED: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x69CE5D: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69DAB0: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69F4BF: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x6A0C86: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x698657: XML_ParseBuffer (in /usr/lib/libexpat.so.0.5.0)
==26214== by 0x8BCFF1: FcConfigParseAndLoad (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56A1: FcInitLoadConfig (in /usr/lib/libfontconfig.so.1.0.4)
==26214==
==26214==
==26214== 48 bytes in 1 blocks are still reachable in loss record 8 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8B0817: FcConfigCreate (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B5681: FcInitLoadConfig (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56FF: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B58FD: FcInit (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEAB5: FcConfigGetCurrent (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B037D: FcConfigSubstituteWithPat (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B06C0: FcConfigSubstitute (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8060DE5: _cairo_ft_scaled_font_create_toy
(cairo-ft-font.c:1625)
==26214== by 0x805577F: cairo_scaled_font_create (cairo-scaled-font.c:540)
==26214== by 0x804F5DC: _cairo_gstate_ensure_scaled_font
(cairo-gstate.c:1466)
==26214== by 0x804F689: _cairo_gstate_text_to_glyphs (cairo-gstate.c:1503)
==26214==
==26214==
==26214== 64 bytes in 4 blocks are still reachable in loss record 9 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8BB970: FcStrSetCreate (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B083A: FcConfigCreate (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B5681: FcInitLoadConfig (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56FF: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B58FD: FcInit (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEAB5: FcConfigGetCurrent (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B037D: FcConfigSubstituteWithPat (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B06C0: FcConfigSubstitute (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8060DE5: _cairo_ft_scaled_font_create_toy
(cairo-ft-font.c:1625)
==26214== by 0x805577F: cairo_scaled_font_create (cairo-scaled-font.c:540)
==26214== by 0x804F5DC: _cairo_gstate_ensure_scaled_font
(cairo-gstate.c:1466)
==26214==
==26214==
==26214== 68 bytes in 3 blocks are still reachable in loss record 10 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8BB81C: FcStrCopyFilename (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEE89: FcConfigSetCache (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B0882: FcConfigCreate (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B5681: FcInitLoadConfig (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56FF: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B58FD: FcInit (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEAB5: FcConfigGetCurrent (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B037D: FcConfigSubstituteWithPat (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B06C0: FcConfigSubstitute (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8060DE5: _cairo_ft_scaled_font_create_toy
(cairo-ft-font.c:1625)
==26214== by 0x805577F: cairo_scaled_font_create (cairo-scaled-font.c:540)
==26214==
==26214==
==26214== 154 bytes in 6 blocks are still reachable in loss record 11 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8BB7AE: FcStrCopyFilename (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BBBAF: FcStrSetAddFilename (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AED5F: FcConfigAddConfigDir (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEDFB: FcConfigAddDir (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BD333: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x69CE5D: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69DAB0: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69F4BF: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x6A0C86: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x698657: XML_ParseBuffer (in /usr/lib/libexpat.so.0.5.0)
==26214== by 0x8BCFF1: FcConfigParseAndLoad (in
/usr/lib/libfontconfig.so.1.0.4)
==26214==
==26214==
==26214== 156 bytes in 4 blocks are still reachable in loss record 12 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8BBA6E: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BBBC1: FcStrSetAddFilename (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AED5F: FcConfigAddConfigDir (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEDFB: FcConfigAddDir (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BD333: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x69CE5D: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69DAB0: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69F4BF: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x6A0C86: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x698657: XML_ParseBuffer (in /usr/lib/libexpat.so.0.5.0)
==26214== by 0x8BCFF1: FcConfigParseAndLoad (in
/usr/lib/libfontconfig.so.1.0.4)
==26214==
==26214==
==26214== 256 bytes in 1 blocks are still reachable in loss record 13 of 26
==26214== at 0x400579F: realloc (vg_replace_malloc.c:306)
==26214== by 0x8AC7DD: FcBlanksAdd (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BD542: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x69CE5D: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69DAB0: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x698657: XML_ParseBuffer (in /usr/lib/libexpat.so.0.5.0)
==26214== by 0x8BCFF1: FcConfigParseAndLoad (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56A1: FcInitLoadConfig (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56FF: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B58FD: FcInit (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEAB5: FcConfigGetCurrent (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B037D: FcConfigSubstituteWithPat (in
/usr/lib/libfontconfig.so.1.0.4)
==26214==
==26214==
==26214== 312 bytes in 26 blocks are still reachable in loss record 14 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8BBFA4: FcExprCreateBool (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BCBD5: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BCC5D: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BDD68: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x69CE5D: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69DAB0: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69F4BF: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x6A0C86: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x698657: XML_ParseBuffer (in /usr/lib/libexpat.so.0.5.0)
==26214== by 0x8BCFF1: FcConfigParseAndLoad (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56A1: FcInitLoadConfig (in /usr/lib/libfontconfig.so.1.0.4)
==26214==
==26214==
==26214== 492 bytes in 41 blocks are still reachable in loss record 15 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8AF027: FcConfigAddEdit (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BE017: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x69CE5D: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69DAB0: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69F4BF: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x6A0C86: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x698657: XML_ParseBuffer (in /usr/lib/libexpat.so.0.5.0)
==26214== by 0x8BCFF1: FcConfigParseAndLoad (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56A1: FcInitLoadConfig (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56FF: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B58FD: FcInit (in /usr/lib/libfontconfig.so.1.0.4)
==26214==
==26214==
==26214== 880 bytes in 44 blocks are still reachable in loss record 16 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8BC225: FcEditCreate (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BDD9C: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x69CE5D: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69DAB0: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69F4BF: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x6A0C86: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x698657: XML_ParseBuffer (in /usr/lib/libexpat.so.0.5.0)
==26214== by 0x8BCFF1: FcConfigParseAndLoad (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56A1: FcInitLoadConfig (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56FF: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B58FD: FcInit (in /usr/lib/libfontconfig.so.1.0.4)
==26214==
==26214==
==26214== 1,008 bytes in 36 blocks are still reachable in loss record 17 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8B5BCB: FcLangSetCreate (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B5EF8: FcLangSetCopy (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B97CE: FcValueSave (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B9F92: FcPatternFreeze (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8ACEB5: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AE32B: FcDirCacheReadDir (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B3742: FcDirScan (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEB84: FcConfigBuildFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B570F: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B58FD: FcInit (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEAB5: FcConfigGetCurrent (in
/usr/lib/libfontconfig.so.1.0.4)
==26214==
==26214==
==26214== 1,032 bytes in 86 blocks are still reachable in loss record 18 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8BC0E6: FcExprCreateOp (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BDFC9: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x69CE5D: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69DAB0: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69F4BF: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x6A0C86: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x698657: XML_ParseBuffer (in /usr/lib/libexpat.so.0.5.0)
==26214== by 0x8BCFF1: FcConfigParseAndLoad (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56A1: FcInitLoadConfig (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56FF: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B58FD: FcInit (in /usr/lib/libfontconfig.so.1.0.4)
==26214==
==26214==
==26214== 1,176 bytes in 49 blocks are still reachable in loss record 19 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8BBDEE: FcTestCreate (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BD925: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x69CE5D: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69DAB0: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69F4BF: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x6A0C86: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x698657: XML_ParseBuffer (in /usr/lib/libexpat.so.0.5.0)
==26214== by 0x8BCFF1: FcConfigParseAndLoad (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56A1: FcInitLoadConfig (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56FF: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B58FD: FcInit (in /usr/lib/libfontconfig.so.1.0.4)
==26214==
==26214==
==26214== 1,536 bytes in 1 blocks are still reachable in loss record 20 of 26
==26214== at 0x400579F: realloc (vg_replace_malloc.c:306)
==26214== by 0x8B563A: FcFontSetAdd (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8ACEDA: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AE32B: FcDirCacheReadDir (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B3742: FcDirScan (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEB84: FcConfigBuildFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B570F: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B58FD: FcInit (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEAB5: FcConfigGetCurrent (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B037D: FcConfigSubstituteWithPat (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B06C0: FcConfigSubstitute (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8060DE5: _cairo_ft_scaled_font_create_toy
(cairo-ft-font.c:1625)
==26214==
==26214==
==26214== 1,740 bytes in 145 blocks are still reachable in loss record 21 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8BBEF8: FcExprCreateString (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BCBE4: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BCC5D: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BD8ED: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x69CE5D: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69DAB0: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x69F4BF: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x6A0C86: (within /usr/lib/libexpat.so.0.5.0)
==26214== by 0x698657: XML_ParseBuffer (in /usr/lib/libexpat.so.0.5.0)
==26214== by 0x8BCFF1: FcConfigParseAndLoad (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56A1: FcInitLoadConfig (in /usr/lib/libfontconfig.so.1.0.4)
==26214==
==26214==
==26214== 3,455 bytes in 269 blocks are still reachable in loss record 22 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8BAF31: FcStrCopy (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BBB5A: FcStrSetAdd (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8BCECF: FcConfigParseAndLoad (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56A1: FcInitLoadConfig (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B56FF: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B58FD: FcInit (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEAB5: FcConfigGetCurrent (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B037D: FcConfigSubstituteWithPat (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B06C0: FcConfigSubstitute (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8060DE5: _cairo_ft_scaled_font_create_toy
(cairo-ft-font.c:1625)
==26214== by 0x805577F: cairo_scaled_font_create (cairo-scaled-font.c:540)
==26214==
==26214==
==26214== 8,466 bytes in 57 blocks are still reachable in loss record 23 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8B206A: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B22AC: FcNameParseCharSet (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B9084: FcNameParse (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8ACE36: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AE32B: FcDirCacheReadDir (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B3742: FcDirScan (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEB84: FcConfigBuildFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B570F: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B58FD: FcInit (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEAB5: FcConfigGetCurrent (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B037D: FcConfigSubstituteWithPat (in
/usr/lib/libfontconfig.so.1.0.4)
==26214==
==26214==
==26214== 24,480 bytes in 6 blocks are still reachable in loss record 24 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8B1EFF: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B22F5: FcNameParseCharSet (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B9084: FcNameParse (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8ACE36: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AE32B: FcDirCacheReadDir (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B3742: FcDirScan (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEB84: FcConfigBuildFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B570F: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B58FD: FcInit (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEAB5: FcConfigGetCurrent (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B037D: FcConfigSubstituteWithPat (in
/usr/lib/libfontconfig.so.1.0.4)
==26214==
==26214==
==26214== 39,700 bytes in 571 blocks are still reachable in loss record 25 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8B9F24: FcPatternFreeze (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8ACEB5: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AE32B: FcDirCacheReadDir (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B3742: FcDirScan (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEB84: FcConfigBuildFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B570F: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B58FD: FcInit (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEAB5: FcConfigGetCurrent (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B037D: FcConfigSubstituteWithPat (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B06C0: FcConfigSubstitute (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8060DE5: _cairo_ft_scaled_font_create_toy
(cairo-ft-font.c:1625)
==26214==
==26214==
==26214== 92,968 bytes in 364 blocks are still reachable in loss record 26 of 26
==26214== at 0x4004405: malloc (vg_replace_malloc.c:149)
==26214== by 0x8BA069: FcPatternFreeze (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8ACEB5: (within /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AE32B: FcDirCacheReadDir (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B3742: FcDirScan (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEB84: FcConfigBuildFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B570F: FcInitLoadConfigAndFonts (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B58FD: FcInit (in /usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8AEAB5: FcConfigGetCurrent (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B037D: FcConfigSubstituteWithPat (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8B06C0: FcConfigSubstitute (in
/usr/lib/libfontconfig.so.1.0.4)
==26214== by 0x8060DE5: _cairo_ft_scaled_font_create_toy
(cairo-ft-font.c:1625)
==26214==
==26214== LEAK SUMMARY:
==26214== definitely lost: 0 bytes in 0 blocks.
==26214== possibly lost: 0 bytes in 0 blocks.
==26214== still reachable: 178,143 bytes in 1,725 blocks.
==26214== suppressed: 0 bytes in 0 blocks.
> Don't worry, the best way to learn C is by reading high quality code,
> e.g. cairo, and experimenting. (Having K&R to hand helps ;-)
Thank you :P. I will try my best. I am having fun with cairo code .
--
Best Regards,
Nguyen Hung Vu
vuhung16plus{remove}@gmail.dot.com
An inquisitive look at Harajuku
http://www.flickr.com/photos/vuhung/sets/72157600109218238/
More information about the cairo
mailing list