[cairo] Hang in Cairo 0.1.23

Samuel Abels newsgroups at debain.org
Sun Jan 16 06:23:47 PST 2005


Hi,

it's not the latest version (0.1.23 from Sarge), but maybe it is still
not fixed. The appended file causes a hang. Stacktrace after C^C:

(gdb) ru
Starting program: /home/sam/test/test

Program received signal SIGINT, Interrupt.
0x40116a25 in pixman_composite_trapezoids () from /usr/lib/libpixman.so.1
(gdb) ba
#0  0x40116a25 in pixman_composite_trapezoids () from /usr/lib/libpixman.so.1
#1  0x40116b18 in pixman_composite_trapezoids () from /usr/lib/libpixman.so.1
#2  0x40117784 in pixman_composite_trapezoids () from /usr/lib/libpixman.so.1
#3  0x40116572 in pixman_composite_trapezoids () from /usr/lib/libpixman.so.1
#4  0x400367a5 in cairo_image_surface_create_for_data () from /usr/lib/libcairo.so.1
#5  0x4003aee1 in cairo_surface_set_repeat () from /usr/lib/libcairo.so.1
#6  0x40034212 in cairo_ft_font_create_for_ft_face () from /usr/lib/libcairo.so.1
#7  0x400345f6 in cairo_ft_font_create_for_ft_face () from /usr/lib/libcairo.so.1
#8  0x4002ff7b in cairo_fill () from /usr/lib/libcairo.so.1
#9  0x08048c18 in main () at test.c:55

This only happens when using double type values in the cairo_(move|
line)_to() functions; the hang does not happen with int type variables.

-Samuel

-------------------------------
#include <cairo.h>

#define WIDTH 376
#define HEIGHT 251
#define STRIDE (WIDTH * 4)

char image[STRIDE*HEIGHT];

int
main (void)
{
    cairo_t *cr;

    cr = cairo_create ();

    cairo_set_target_image (cr, image, CAIRO_FORMAT_ARGB32,
		      WIDTH, HEIGHT, STRIDE);

    cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT);
    cairo_set_rgb_color (cr, 1, 1, 1);
    cairo_fill (cr);
    
    cairo_move_to (cr, 0.000020,   0.500008);
    cairo_line_to (cr, 374.999985, 0.500017);
    cairo_line_to (cr, 374.999980, 250.499992);
    cairo_line_to (cr, 0.000015,   250.499983);
    cairo_line_to (cr, 0.000020,   0.500008);
    cairo_fill(cr);  /// Locked here.
    
    cairo_destroy (cr);

    return 0;
}


-- 
 ------------------------------------------------------
|      Samuel Abels       |   http://www.debain.org    |
| spam ad debain dod org  | knipknap ad jabber dod org |
 ------------------------------------------------------



More information about the cairo mailing list