Re: Crash in g_slice_alloc()




On Feb 20, 2014, at 8:14 AM, Parth Kanungo <parth k samsung com> wrote:

Hi John,

 

Thanks for the response.  I figured out a  solution later.

 

It turns out that freeing the PangoContext using g_object_unref() also frees the associated PangoFontDescription.

I was doing the mistake of freeing the PangoFontDescription again, by using pango_font_description_free().

 

However, I am curious why memory corruption occurs only after multiple executions.

You'll have to debug gslice to figure that out. If double-freeing a gslice corrupts the magazine it might take some time before gslice tries to use that particular magazine again, which would explain the delay between the double-free and the crash. That's not unique to gslice though; heap bugs often manifest well away from the actual bug. That's why there are heap debugging tools like valgrind.

Regards,
John Ralls



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