[cairo] Problem with the number of lines

Samuele Galeotta samuele at lambrate.inaf.it
Wed Feb 8 08:03:15 PST 2006


I'm working on an application for plotting data. To do this I created a 
new gtkwidget using cairo.
The new widget works correctly and plots data, but the X server crashes 
when there are approximately more than 19000 points.

Here an example:

void
life_plot_draw (LifePlot * plot, cairo_t * context)
{
 int i;
 int size = plot->x->len; /* Length of data arrays. */

 cairo_new_path (context);
 cairo_move_to (context, g_array_index (plot->x, gdouble, 0), 
g_array_index (plot->y, gdouble,0));
  
 for (i=1; i<size; i++)
 {
   cairo_line_to (context, g_array_index (plot->x, gdouble, i), 
g_array_index (plot->y, gdouble, i));
  }
  cairo_stroke (context);
  cairo_close_path (context);
}

If size is greater than 19200, the X server crashes on the call of the 
function cairo_stroke. Here the last part of the log:

Program received signal SIGPIPE, Broken pipe.
0xffffe410 in __kernel_vsyscall ()
(gdb) backtrace
#0  0xffffe410 in __kernel_vsyscall ()
#1  0x40826986 in do_writev () from /lib/tls/libc.so.6
#2  0x4061f2fe in XUnlockDisplay () from /usr/X11R6/lib/libX11.so.6
#3  0x4061f60f in _X11TransWritev () from /usr/X11R6/lib/libX11.so.6
#4  0x40603395 in _XSend () from /usr/X11R6/lib/libX11.so.6
#5  0x405c9fd9 in XRenderCompositeTrapezoids () from 
/usr/X11R6/lib/libXrender.so.1
#6  0x404327a2 in cairo_test_xlib_disable_render () from 
/usr/lib/libcairo.so.2
...

Any ideas?

Thanks,
Samuele




More information about the cairo mailing list