Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Mar 2014 23:35:44 GMT
From:      Henry Hu <henry.hu.sh@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/187514: [patch] graphics/cairo: backport fix of assertion failure
Message-ID:  <201403122335.s2CNZiMA085054@cgiserv.freebsd.org>
Resent-Message-ID: <201403122340.s2CNe16s039130@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         187514
>Category:       ports
>Synopsis:       [patch] graphics/cairo: backport fix of assertion failure
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 12 23:40:01 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Henry Hu
>Release:        FreeBSD 11-CURRENT
>Organization:
Columbia University
>Environment:
FreeBSD pepsi 11.0-CURRENT FreeBSD 11.0-CURRENT #1 r263054M: Tue Mar 11 22:50:23 EDT 2014     root@:/usr/obj/usr/src/sys/MYKERNEL  amd64

>Description:
This patch adds an extra patch to graphics/cairo which fixes a case that may trigger assertion failure.

I know that a new cairo port is being worked on. However, before that one is committed(which may take some time because it breaks some systems), please add this patch to the old cairo port, so people do not suffer from this problem.

This patch is taken from here:

http://cgit.freedesktop.org/cairo/commit/?id=a419d00fbecf18736f5566e1c4e3786cc7b4586c

which fixes this bug:

https://bugs.freedesktop.org/show_bug.cgi?id=41409

On FreeBSD, if you use old cairo with the newly committed textproc/ibus on a FreeBSD 9/amd64 system with XFCE desktop, ibus's panel fails to start with the assertion failure mentioned in the bug report.

The patch attached fixes the problem. Alternatively, new cairo(1.12) already includes that fix.
>How-To-Repeat:
1. Start XFCE desktop on FreeBSD 9/amd64
2. Install ibus 1.5.5
3. Start ibus

ibus-ui-gtk3 fails to start with assertion failure.
>Fix:


Patch attached with submission follows:

diff -ruN /usr/ports/graphics/cairo/Makefile ./Makefile
--- /usr/ports/graphics/cairo/Makefile	2013-12-19 22:12:19.000000000 -0500
+++ ./Makefile	2014-03-12 14:17:10.000000000 -0400
@@ -4,7 +4,7 @@
 
 PORTNAME=	cairo
 PORTVERSION=	1.10.2
-PORTREVISION=	7
+PORTREVISION=	8
 PORTEPOCH?=	2
 CATEGORIES=	graphics
 MASTER_SITES=	http://cairographics.org/releases/
diff -ruN /usr/ports/graphics/cairo/files/patch-a419d00f ./files/patch-a419d00f
--- /usr/ports/graphics/cairo/files/patch-a419d00f	1969-12-31 19:00:00.000000000 -0500
+++ ./files/patch-a419d00f	2014-03-12 14:11:10.000000000 -0400
@@ -0,0 +1,36 @@
+From a419d00fbecf18736f5566e1c4e3786cc7b4586c Mon Sep 17 00:00:00 2001
+From: Uli Schlachter <psychon@znc.in>
+Date: Sat, 08 Oct 2011 11:40:11 +0000
+Subject: flush: Detach mime data
+
+Drawing directly to a surface has to be surrounded with cairo_surface_flush()
+and cairo_surface_mark_dirty().
+
+However, if the surface has mime data associated, this would hit the following
+assert:
+
+lt-cairo-test-suite: cairo-surface.c:1381: cairo_surface_mark_dirty_rectangle:
+Assertion `! _cairo_surface_has_mime_data (surface)' failed.
+
+This is now fixed by detaching all mime data in cairo_surface_flush().
+
+Buzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41409
+
+Fixes: create-from-png, create-from-png-stream
+
+Signed-off-by: Uli Schlachter <psychon@znc.in>
+---
+diff --git a/src/cairo-surface.c b/src/cairo-surface.c
+index 3be6d42..0810f18 100644
+--- src/cairo-surface.c
++++ src/cairo-surface.c
+@@ -1314,6 +1314,7 @@ cairo_surface_flush (cairo_surface_t *surface)
+ 
+     /* update the current snapshots *before* the user updates the surface */
+     _cairo_surface_detach_snapshots (surface);
++    _cairo_surface_detach_mime_data (surface);
+ 
+     if (surface->backend->flush) {
+ 	status = surface->backend->flush (surface);
+--
+cgit v0.9.0.2-2-gbebe


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403122335.s2CNZiMA085054>