Re: FontConfig memory question

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

 



On 14-Feb-2014 11:47, mathog wrote:
I'm thinking it will probably come down to building a debug version of
fontconfig, linking with that, and then tracking a whole lot of
pointers.

Did that with 2.11. The good news: all of the leaks associated with text_reassemble.c in Inkscape went away. Whatever that problem was, it was eliminated in the intervening versions. The bad news: Inkscape still can't run FcFini() just before exit without crashing.

Ran inkscape in valgrind while it was linked with the 2.11 library compiled with -g, and traced a huge number of memory leaks into FcValueSave. These 3 lines leak when that function is called from numerous locations:

	v.u.s = FcStrdup (v.u.s);
	v.u.m = FcMatrixCopy (v.u.m);
	v.u.l = FcLangSetCopy (v.u.l);

but this one doesn't

	v.u.c = FcCharSetCopy ((FcCharSet *) v.u.c);

What is this code trying to do?  Because in general

   sometype var;
   /* set the values in var */
   var = duplicate_function(var);

is going to leak if sometype has pointers to memory. The surprising thing here is not that the 3 lines noted leak, but that FcCharSetCopy doesn't. FcValueSave is called from 4 locations in fcpat.c, and all of them leaked. The only other place FcValueSave seemed to be used was in fccfg.c, but that included fcaliastail.h, which redefines FcValueSave so that the function by that name is not called.

Regards,

David Mathog
mathog@xxxxxxxxxxx
Manager, Sequence Analysis Facility, Biology Division, Caltech
_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig




[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux