From b68d9f4541606b2291b5e54581c9d0dfe20b3922505f41615d4ffb57b647fae0 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Mon, 8 Jul 2013 21:23:43 +0000 Subject: [PATCH 1/2] Accepting request 182537 from home:sbrabec:branches:GNOME:Factory - Fix eog crash on assertion, after pressing Next (cairo-reduce-buddy-assertion.patch, bnc828074#c3). OBS-URL: https://build.opensuse.org/request/show/182537 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/cairo?expand=0&rev=73 --- cairo-reduce-buddy-assertion.patch | 34 ++++++++++++++++++++++++++++++ cairo.changes | 6 ++++++ cairo.spec | 3 +++ 3 files changed, 43 insertions(+) create mode 100644 cairo-reduce-buddy-assertion.patch diff --git a/cairo-reduce-buddy-assertion.patch b/cairo-reduce-buddy-assertion.patch new file mode 100644 index 0000000..b41a6fe --- /dev/null +++ b/cairo-reduce-buddy-assertion.patch @@ -0,0 +1,34 @@ +From 01a8bf01c6508a4fea8d40371c3049e7a2f7908a Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Fri, 15 Mar 2013 09:08:00 +0000 +Subject: [PATCH] mempool: Reduce an assert into an error return for + get_buddy() + +If we ask for a buddy that is outside of our allocation that is an +error that should not happen with a power-of-two allocated zone... +However, since it has been seen in the wild, we can safely return that +there is no buddy rather than die in a too-late assert. + +Reported-by: Anton Eliasson +Signed-off-by: Chris Wilson +--- + src/cairo-mempool.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/cairo-mempool.c b/src/cairo-mempool.c +index 96e4a62..751ede3 100644 +--- a/src/cairo-mempool.c ++++ b/src/cairo-mempool.c +@@ -157,7 +157,8 @@ get_buddy (cairo_mempool_t *pool, size_t offset, int bits) + { + struct _cairo_memblock *block; + +- assert (offset + (1 << bits) <= pool->num_blocks); ++ if (offset + (1 << bits) >= pool->num_blocks) ++ return NULL; /* invalid */ + + if (BITTEST (pool, offset + (1 << bits) - 1)) + return NULL; /* buddy is allocated */ +-- +1.8.1.4 + diff --git a/cairo.changes b/cairo.changes index f3d4b7f..4211ebd 100644 --- a/cairo.changes +++ b/cairo.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jul 8 18:49:31 CEST 2013 - sbrabec@suse.cz + +- Fix eog crash on assertion, after pressing Next + (cairo-reduce-buddy-assertion.patch, bnc828074#c3). + ------------------------------------------------------------------- Sat May 25 20:58:42 UTC 2013 - dimstar@opensuse.org diff --git a/cairo.spec b/cairo.spec index 03cddac..09c2279 100644 --- a/cairo.spec +++ b/cairo.spec @@ -30,6 +30,8 @@ Source: http://cairographics.org/releases/%{name}-%{version}.tar.xz Source99: baselibs.conf # PATCH-FIX-UPSTREAM cairo-modules-no-version.patch fdo#29319 dimstar@opensuse.org -- Build modules with -module -avoid-version. Patch0: cairo-modules-no-version.patch +# PATCH-FIX-UPSTREAM cairo-reduce-buddy-assertion.patch upstream commit 01a8bf01c6508a4fea8d40371c3049e7a2f7908a bnc828074#c3 -- Fix assert crash on unaligned memory. +Patch1: cairo-reduce-buddy-assertion.patch # These libraries are needed only for tests. # Do not enable tests in build systems, it causes build loop! #BuildRequires: librsvg-devel poppler-devel @@ -148,6 +150,7 @@ cairo. %prep %setup -q %patch0 -p1 +%patch1 -p1 %build # Needed by patch0 From e1146cdc1f4df5b9e6b83fbf8b30758c0c47c7782f12a9a8267384b4ab06b4da Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Mon, 8 Jul 2013 21:26:18 +0000 Subject: [PATCH 2/2] twea OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/cairo?expand=0&rev=74 --- cairo.changes | 4 ++-- cairo.spec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cairo.changes b/cairo.changes index 4211ebd..21cf10a 100644 --- a/cairo.changes +++ b/cairo.changes @@ -1,8 +1,8 @@ ------------------------------------------------------------------- Mon Jul 8 18:49:31 CEST 2013 - sbrabec@suse.cz -- Fix eog crash on assertion, after pressing Next - (cairo-reduce-buddy-assertion.patch, bnc828074#c3). +- Add cairo-reduce-buddy-assertion.patch: Fix eog crash on + assertion, after pressing Next (bnc#828074). ------------------------------------------------------------------- Sat May 25 20:58:42 UTC 2013 - dimstar@opensuse.org diff --git a/cairo.spec b/cairo.spec index 09c2279..e03b045 100644 --- a/cairo.spec +++ b/cairo.spec @@ -30,7 +30,7 @@ Source: http://cairographics.org/releases/%{name}-%{version}.tar.xz Source99: baselibs.conf # PATCH-FIX-UPSTREAM cairo-modules-no-version.patch fdo#29319 dimstar@opensuse.org -- Build modules with -module -avoid-version. Patch0: cairo-modules-no-version.patch -# PATCH-FIX-UPSTREAM cairo-reduce-buddy-assertion.patch upstream commit 01a8bf01c6508a4fea8d40371c3049e7a2f7908a bnc828074#c3 -- Fix assert crash on unaligned memory. +# PATCH-FIX-UPSTREAM cairo-reduce-buddy-assertion.patch bnc#828074 sbrabec@suse.cz -- Fix assert crash on unaligned memory, taken from git, commit 01a8bf0 Patch1: cairo-reduce-buddy-assertion.patch # These libraries are needed only for tests. # Do not enable tests in build systems, it causes build loop!