[cairo] arc segmentation fault in python

Maarten Breddels dmon at xs4all.nl
Mon Dec 13 09:23:46 PST 2004


Daniel Brodie wrote:

> Hello,
>
> I am using cairo version 0.1.23 with the python bindings.
> I seem to be getting segmentation faults when I use the arc function 
> to draw an arc on a context. It depends on what angles I use. An example:
> (although it's python code, it should be pretty obvious)
> ctx.arc(100, 100, 50, 5*pi/8, pi/8)
>
> I would like to know if this is a known bug, the intended behavior, 
> etc...
>
I noticed some crashes with arc's too, some time ago, and couldn't 
reproduce them in c, it were really random crashes. And when i tried 
running the script from c(to use the MS debugger) it didn't crash, so I 
have no idea what the problem is. But what os etc are you using? Btw, I 
can't make it crash now, the attached code seems to work fine, can you 
try to run it, or send me some code that does crash.

-Maarten
-------------- next part --------------
import cairo
from math import pi

file = open("pycairoarcbug.png", "wb")

width, height = 400, 400
ctx = cairo.Context()
surface = cairo.png_surface_create(file, cairo.FORMAT_ARGB32, width, height)
ctx.set_target_surface(surface)
ctx.arc(100, 100, 50, 5*pi/8, pi/8)
ctx.stroke()
ctx.show_page()


More information about the cairo mailing list