Bug 3159 - segmentation fault
Summary: segmentation fault
Status: RESOLVED WORKSFORME
Alias: None
Product: cairo
Classification: Unclassified
Component: postscript backend (show other bugs)
Version: 0.9.3
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-28 16:07 UTC by Steve Chaplin
Modified: 2005-08-22 00:14 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Steve Chaplin 2005-04-28 16:07:31 UTC
The following minimal program gives a segmentation fault

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

#define X_INCHES 2
#define Y_INCHES 2
#define X_PPI    300.0
#define Y_PPI    300.0

#define WIDTH    X_INCHES * 72.0
#define HEIGHT   Y_INCHES * 72.0

#define FILENAME "/tmp/test.ps" 

int
main (void)
{
    cairo_t *cr;
    cairo_surface_t *surface;
    FILE *file;

    file = fopen (FILENAME, "w");
    if (file == NULL) {
	fprintf (stderr, "Failed to open file %s for writing.\n", FILENAME);
	return 1;
    }

    cr = cairo_create ();
    cairo_set_target_ps (cr, file, X_INCHES, Y_INCHES, X_PPI, Y_PPI);
    cairo_show_page (cr); /* gives segmentation fault */
    return 0;
}
Comment 1 Carl Worth 2005-05-10 20:34:23 UTC
I ported this code to the latest API, which is changing the cairo_create and
cairo_set_target_ps calls to:

    surface = cairo_ps_surface_create (file, X_INCHES, Y_INCHES, X_PPI, Y_PPI);
    cr = cairo_create (surface);

and I was not able to replicate the segfault. Perhaps the bug has been fixed
between the time it was reported and now?
Comment 2 Steve Chaplin 2005-05-10 23:03:44 UTC
It works for me too with the new API, it must have been fixed somehow, perhaps
the problem was with cairo_set_target_ps() which no longer exists.
Comment 3 Carl Worth 2005-08-22 17:14:53 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.