Opened 10 years ago

Last modified 10 years ago

#44358 new defect

cairo crash on simple testcase

Reported by: ethan@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.3.1
Keywords: Cc:
Port: cairo

Description (last modified by mf2k (Frank Schima))

The cairo 1.12.16_2 port is generally working for me, but consistently crashing when run with the following code:

#include <cairo.h>

int main() {
    cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 800, 600);
    cairo_t *cr = cairo_create(surface);

    cairo_move_to(cr, 200, 300);
    cairo_curve_to(cr, 200.000000, 189.543050, 289.543050, 100.000000, 400.000000, 100.000000);
    cairo_curve_to(cr, 510.456950, 100.000000, 600.000000, 189.543050, 600.000000, 300.000000);
    cairo_curve_to(cr, 600.000000, 410.456950, 510.456950, 500.000000, 400.000000, 500.000000);
    cairo_curve_to(cr, 289.543050, 500.000000, 200.000000, 410.456950, 200.000000, 300.000000);
    cairo_clip(cr);

    cairo_move_to(cr, 352.287126, 66.212743);
    cairo_line_to(cr, 364.004851, 68.800196);
    cairo_line_to(cr, 359.045565, 91.259170);
    cairo_line_to(cr, 347.327840, 88.671716);
    cairo_line_to(cr, 352.287126, 66.212743);
    cairo_stroke(cr);

    cairo_destroy(cr);
    cairo_surface_destroy(surface);
    return 0;
}

The crash occurs in cairo_clip_intersect_rectangle_box. The exact same program is working fine under Linux and also works fine on my Mac if I manually build the latest Cairo code from git rather than use the MacPorts version.

Change History (3)

comment:1 Changed 10 years ago by mf2k (Frank Schima)

Description: modified (diff)

comment:2 Changed 10 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to ryandesign@…

In the future, please use WikiFormatting and Cc the port maintainers (port info --maintainers cairo).

comment:3 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

I don't know why you're only seeing the problem when using the MacPorts version of cairo, but I don't know the cairo code and cannot help you debug this, so I still suggest you work with the developers of cairo for a resolution to this.

Note: See TracTickets for help on using tickets.