[cairo] Re: arc segmentation fault in python

Daniel Brodie daniel at brodienet.com
Mon Dec 13 23:10:40 PST 2004

Maarten Breddels wrote:
> 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
> ------------------------------------------------------------------------
> 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()
> ------------------------------------------------------------------------

I don't have png_surface_create which is leading me to believe that this 
is happening because of my older version. I will upgrade and see if it 
goes away.


More information about the cairo mailing list