[HarfBuzz] Possible memory leaks in latest revision

Tom Hacohen tom.hacohen at partner.samsung.com
Wed May 11 09:37:23 PDT 2011


Dear all,

Using the attached source code (also available at:
http://pastebin.com/yu3gwvM5 if you find it more convenient) valgrind
complains about a lot of memory leaks in Harfbuzz (latest revision), for
example:

==23594== 64 bytes in 1 blocks are definitely lost in loss record 5 of 6
==23594==    at 0x402425F: calloc (vg_replace_malloc.c:467)
==23594==    by 0x40BD126: hb_blob_create_sub_blob
(hb-object-private.hh:145)
==23594==    by 0x40BFA06: _hb_face_for_data_get_table (hb-font.cc:385)
==23594==    by 0x40BF7AE: hb_face_reference_table (hb-font.cc:453)
==23594==    by 0x40C4554: _hb_ot_layout_create (hb-ot-layout.cc:60)
==23594==    by 0x40BFB47: hb_face_create_for_tables (hb-font.cc:340)
==23594==    by 0x40C07D6: hb_face_create_for_data (hb-font.cc:404)
==23594==    by 0x40D0571: hb_ft_face_create (hb-ft.cc:215)
==23594==    by 0x40D05B5: hb_ft_font_create (hb-ft.cc:253)
==23594==    by 0x8048848: hb_stuff (in /tmp/a.out)
==23594==    by 0x8048924: main (in /tmp/a.out)
==23594== 
==23594== 400 bytes in 1 blocks are definitely lost in loss record 6 of
6
==23594==    at 0x402425F: calloc (vg_replace_malloc.c:467)
==23594==    by 0x40CF759: hb_ot_shape_plan_internal (hb-private.hh:255)
==23594==    by 0x40CF831: hb_ot_shape (hb-ot-shape.cc:382)
==23594==    by 0x40C0E6B: hb_shape (hb-shape.cc:48)
==23594==    by 0x804886D: hb_stuff (in /tmp/a.out)
==23594==    by 0x8048924: main (in /tmp/a.out)

I found those memory leaks in my application which used to work nicely
(without any leaks) until the recent upgrade and created this test case,
which also leaks, for you to test with.

Since it used to work and the code looks correct, I think it's a memory
leak, but it's possibly my misuse of the API. Please let me know.

Thanks,
Tom.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: a.c
Type: text/x-csrc
Size: 934 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/harfbuzz/attachments/20110511/cb1b1349/attachment.c>


More information about the HarfBuzz mailing list