Bug 2950 - *** glibc detected *** double free or corruption
Summary: *** glibc detected *** double free or corruption
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: 0.9.3
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-10 03:35 UTC by Steve Chaplin
Modified: 2005-08-22 00:15 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Steve Chaplin 2005-04-10 03:35:44 UTC
The following short program gives the error message:
*** glibc detected *** double free or corruption: 0x082a7268 ***
Aborted


// start of program ---
// gcc `pkg-config --cflags --libs cairo` test_surface_finish.c -o
test_surface_finish

#include <cairo.h>

int
main (void)
{
    cairo_surface_t *surface;
    surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 10, 10);
    cairo_surface_finish (surface);
    cairo_surface_finish (surface);
    return 0;
}
// end of program --

I realise you would not deliberately call cairo_surface_finish() twice, but I
think cairo should handle the situation gracefully.
Comment 1 Carl Worth 2005-04-13 14:53:05 UTC
Thanks for the report. It was definitely a bug.

Fortunately, it was also very easy to fix. The code was just
neglecting to actually set the surface->finished field.

Now fixed in CVS, (and a test case added: cairo/test/surface-finish-twice.c).
Comment 2 Carl Worth 2005-08-22 17:15:04 UTC
Move bugs against "cvs" version to "0.9.3" so we can remove the "cvs" version.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.