[cairo] Very large number of lines

Andrea Canciani ranma42 at gmail.com
Mon Aug 30 04:26:55 PDT 2010


Just recompiled after pulling git, I get:
(box) ranma42 at nirvana ~/Code/fdo/bugs $ ./a.out
0 0
1 1
1 1
(box) ranma42 at nirvana ~/Code/fdo/bugs $ cat necko.c
#include <cairo.h>
#include <cairo-pdf.h>
#include <stdio.h>

int main()
{
  unsigned int t=0;
  unsigned int ITER_NO=20000000;
  cairo_surface_t *surface;
  cairo_t *cr;

  surface = cairo_pdf_surface_create("necko.pdf", 1432, 1606);
  cr = cairo_create(surface);
  cairo_translate (cr, -229770, 26573.7);

  while(t<ITER_NO) {
      cairo_move_to (cr, 229770, -26573.7);
      cairo_line_to (cr, 231202, -24967.3);
      ++t;
  }

  cairo_stroke(cr);
  printf ("%d %d\n", cairo_status (cr), cairo_surface_status (surface));
  cairo_show_page(cr);
  printf ("%d %d\n", cairo_status (cr), cairo_surface_status (surface));
  cairo_surface_finish(surface);
  printf ("%d %d\n", cairo_status (cr), cairo_surface_status (surface));
  cairo_surface_destroy(surface);
  cairo_destroy(cr);

  return 0;

}
(box) ranma42 at nirvana ~/Code/fdo/bugs $ gs $g-config --cflags --libs cairo)
(box) ranma42 at nirvana ~/Code/fdo/bugs $ ./a.out
0 0
1 1
1 1

Can you confirm that you were running the old version (the one that
goes oom) when
you got your "successful" result? (The NULL-pointer error is expected, since you
are asking for the status of a cairo_t which has been already destroyed).
Andrea


More information about the cairo mailing list