Bug 2950

Summary: *** glibc detected *** double free or corruption
Product: cairo Reporter: Steve Chaplin <d74n5pohf9>
Component: generalAssignee: Carl Worth <cworth>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: high CC: jwatt
Version: 0.9.3   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

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.