[cairo] Cairo diagrams backend on OSX assertion failed (bug?)

Evan Rinehart evanrinehart at gmail.com
Sun Jan 18 12:08:46 PST 2015


Synopsis, I was testing the haskell library diagrams (
http://projects.haskell.org/diagrams/ ) with its cairo backend on OSX to
render some simple text. But running the program to generate an svg (or
png) that contains nothing but a single word results in the following error
from cairo:

```
Assertion failed: (!scaled_font->cache_frozen), function
_cairo_scaled_glyph_page_destroy, file cairo-scaled-font.c, line 459.
Abort trap: 6
```

I talked to bergey one of the developers for the cairo backend of diagrams
and after some brain-wracking he suggested to submit a bug report to cairo.

Steps to reproduce.

This is OSX 10.8.5
cairo-1.14.0 installed via homebrew
pango-1.36.8 installed via homebrew
ghc-7.8.3
diagrams-cairo-1.2.0.6

The following haskell program takes an output file name and dimensions to
render a single word.

```
module Main where

import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine

main = mainWith (text "SUPER" :: Diagram B R2)
```

ghc -o a.out Main.hs
./a.out -o out.svg -w 100 -h 100

```
Assertion failed: (!scaled_font->cache_frozen), function
_cairo_scaled_glyph_page_destroy, file cairo-scaled-font.c, line 459.
Abort trap: 6
```

Since past reports of this error in cairo seems to involve thread safety
issues, it may be that to trigger this error you need to have different
text instead of "SUPER" or to run this on a different phase of the moon,
but I get that error 100% of the time so far. Changing the output file
extension to .png or some other format (in order to use a different
backend) results in the same failed assertion.

I included my pango version because diagrams-cairo now uses pango instead
of the toy text API to deal with text formatting.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20150118/cca149c5/attachment.html>


More information about the cairo mailing list