Bug 8102 - context.push_group() crashes when floating point transformation exists
Summary: context.push_group() crashes when floating point transformation exists
Status: RESOLVED NOTOURBUG
Alias: None
Product: pycairo
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high major
Assignee: Steve Chaplin
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-01 14:11 UTC by Niklas Volbers
Modified: 2006-09-01 22:04 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Niklas Volbers 2006-09-01 14:11:04 UTC
The context.push_group() method will cause a segmentation fault if 
(a) a transformation has been defined with a floating point number as argument
(b) a rectangular clipping region is defined using context.rectangle(...) and
context.clip()
(c) the context.push_group() method is called.

The following snippet, which is a variation of the example on the pycairo
homepage, illustrates the bug:


-------
#!/usr/bin/env python

import cairo

WIDTH, HEIGHT = 400, 400

# Setup Cairo
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, WIDTH, HEIGHT)
ctx = cairo.Context(surface)

# Set thickness of brush
ctx.set_line_width(15)

if 1: # set to 0 or just plain 42 as scaling factor and the segault will go away !
    ctx.translate(100, 42.4344454647)
ctx.rectangle(0, 0, WIDTH, HEIGHT)
ctx.clip()
ctx.push_group()

# Draw out the triangle using absolute coordinates
ctx.move_to(200, 100)
ctx.line_to(300, 300)
ctx.rel_line_to(-200, 0)
ctx.close_path()

ctx.pop_group()

# Apply the ink
ctx.stroke()

# Output a PNG file
surface.write_to_png("triangle.png")

----

(I marked the bug as major, because I think a segfault is a major bug).
Comment 1 Steve Chaplin 2006-09-01 22:04:10 UTC
I created the equivalent C cairo program and the segmentation fault occurs when
using cairo without pycairo. So the bug is in cairo not pycairo.
See the cairo bug report
    https://bugs.freedesktop.org/show_bug.cgi?id=8106


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.