[cairo] fix alignment issue on SPARC processors

Nicolas Setton setton at adacore.com
Thu Dec 4 09:12:04 PST 2014

There is an alignment issue on SPARC processors which causes a SIGBUS when
trying to write data to edges in the polygon scan converter.

Here is the patch that we've applied to circumvent the issue. 

Hope this helps!


diff --git a/src/cairo-tor-scan-converter.c b/src/cairo-tor-scan-converter.c
index 14922d0..d811825 100644
--- a/src/cairo-tor-scan-converter.c
+++ b/src/cairo-tor-scan-converter.c
@@ -273,6 +273,11 @@ struct _pool_chunk {
     /* # bytes total in this chunk */
     size_t capacity;
+    /* Pad to fix alignment issue on sparc: the long long integers
+     * are aligned on 64-bit boundaries. Make sure that this is the
+     * case in the memory pool by bumping the size of this struct. */
+    short padding;
     /* Pointer to the previous chunk or %NULL if this is the sentinel
      * chunk in the pool header. */
     struct _pool_chunk *prev_chunk;

More information about the cairo mailing list