r45939 - in /desktop/experimental/gdk-pixbuf/debian: changelog patches/ patches/series patches/skip-large-file-tests-instead-of-ooming
laney at users.alioth.debian.org
laney at users.alioth.debian.org
Thu Sep 17 13:37:58 UTC 2015
Author: laney
Date: Thu Sep 17 13:37:58 2015
New Revision: 45939
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=45939
Log:
debian/patches/skip-large-file-tests-instead-of-ooming: Add a new patch to
skip tests which operate on large files that don't fit in memory on some
constrained systems. Not forwarded yet - this upload is to test it on our
buildds.
Added:
desktop/experimental/gdk-pixbuf/debian/patches/
desktop/experimental/gdk-pixbuf/debian/patches/series
desktop/experimental/gdk-pixbuf/debian/patches/skip-large-file-tests-instead-of-ooming
Modified:
desktop/experimental/gdk-pixbuf/debian/changelog
Modified: desktop/experimental/gdk-pixbuf/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gdk-pixbuf/debian/changelog?rev=45939&op=diff
==============================================================================
--- desktop/experimental/gdk-pixbuf/debian/changelog [utf-8] (original)
+++ desktop/experimental/gdk-pixbuf/debian/changelog [utf-8] Thu Sep 17 13:37:58 2015
@@ -1,6 +1,10 @@
gdk-pixbuf (2.31.7-2) UNRELEASED; urgency=medium
* Run the tests with VERBOSE=1
+ * debian/patches/skip-large-file-tests-instead-of-ooming: Add a new patch to
+ skip tests which operate on large files that don't fit in memory on some
+ constrained systems. Not forwarded yet - this upload is to test it on our
+ buildds.
-- Iain Lane <laney at debian.org> Thu, 17 Sep 2015 14:33:14 +0100
Added: desktop/experimental/gdk-pixbuf/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gdk-pixbuf/debian/patches/series?rev=45939&op=file
==============================================================================
--- desktop/experimental/gdk-pixbuf/debian/patches/series (added)
+++ desktop/experimental/gdk-pixbuf/debian/patches/series [utf-8] Thu Sep 17 13:37:58 2015
@@ -0,0 +1 @@
+skip-large-file-tests-instead-of-ooming
Added: desktop/experimental/gdk-pixbuf/debian/patches/skip-large-file-tests-instead-of-ooming
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gdk-pixbuf/debian/patches/skip-large-file-tests-instead-of-ooming?rev=45939&op=file
==============================================================================
--- desktop/experimental/gdk-pixbuf/debian/patches/skip-large-file-tests-instead-of-ooming (added)
+++ desktop/experimental/gdk-pixbuf/debian/patches/skip-large-file-tests-instead-of-ooming [utf-8] Thu Sep 17 13:37:58 2015
@@ -0,0 +1,143 @@
+Description: Check if we have failed due to insufficient memory and skip if so. Don't use MALLOC_PERTURB since it seems that this forces <size of file> memory to be available which OOMs on many systems.
+Author: Iain Lane <laney at debian.org>
+Bug-Upstream: https://bugzilla.gnome.org/show_bug.cgi?id=754387
+
+Index: b/tests/cve-2015-4491.c
+===================================================================
+--- a/tests/cve-2015-4491.c
++++ b/tests/cve-2015-4491.c
+@@ -19,6 +19,9 @@
+ */
+
+ #include <gdk-pixbuf.h>
++#include <malloc.h>
++
++#include "test-common.h"
+
+ static void
+ test_original (void)
+@@ -29,7 +32,8 @@
+
+ buf = gdk_pixbuf_new_from_resource_at_scale ("/test/resource/cve-2015-4491.bmp", size, size, FALSE, &err);
+
+- g_assert_no_error (err);
++ if (!assert_error_not_insufficient_memory (err))
++ return;
+
+ g_object_unref (buf);
+ }
+@@ -76,6 +80,8 @@
+ int
+ main (int argc, char *argv[])
+ {
++ /* With perturbing, this test OOMs on weaker machines. */
++ mallopt (M_PERTURB, 0);
+ g_test_init (&argc, &argv, NULL);
+
+ g_test_add_func ("/pixbuf/cve-2015-4491/original", test_original);
+Index: b/tests/pixbuf-scale.c
+===================================================================
+--- a/tests/pixbuf-scale.c
++++ b/tests/pixbuf-scale.c
+@@ -83,7 +83,9 @@
+
+ path = g_test_get_filename (G_TEST_DIST, filename, NULL);
+ ref = gdk_pixbuf_new_from_file (path, &error);
+- g_assert_no_error (error);
++
++ if (!assert_error_not_insufficient_memory (error))
++ return;
+
+ width = gdk_pixbuf_get_width (ref);
+ height = gdk_pixbuf_get_height (ref);
+@@ -111,10 +113,18 @@
+
+ path = g_test_get_filename (G_TEST_DIST, filename, NULL);
+ ref = gdk_pixbuf_new_from_file (path, &error);
+- g_assert_no_error (error);
++
++ if (!assert_error_not_insufficient_memory (error))
++ return;
+
+ pixbuf = gdk_pixbuf_add_alpha (ref, FALSE, 0, 0, 0);
+- g_assert (pixbuf != NULL);
++
++ if (pixbuf == NULL)
++ {
++ g_test_skip ("Couldn't add alpha to the image - your system probably lacks sufficient memory.");
++ return;
++ }
++
+ g_object_unref (pixbuf);
+
+ pixbuf = gdk_pixbuf_add_alpha (ref, TRUE, 0, 0, 255);
+@@ -141,10 +151,18 @@
+
+ path = g_test_get_filename (G_TEST_DIST, filename, NULL);
+ ref = gdk_pixbuf_new_from_file (path, &error);
+- g_assert_no_error (error);
++
++ if (!assert_error_not_insufficient_memory (error))
++ return;
+
+ pixbuf = gdk_pixbuf_rotate_simple (ref, GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE);
+- g_assert (pixbuf != NULL);
++
++ if (pixbuf == NULL)
++ {
++ g_test_skip ("Couldn't rotae the image - your system probably lacks sufficient memory.");
++ return;
++ }
++
+ g_object_unref (pixbuf);
+
+ g_object_unref (ref);
+Index: b/tests/test-common.c
+===================================================================
+--- a/tests/test-common.c
++++ b/tests/test-common.c
+@@ -65,6 +65,19 @@
+ }
+
+ gboolean
++assert_error_not_insufficient_memory (GError *err)
++{
++ if (err && g_error_matches (err, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY))
++ {
++ g_test_skip ("Skipping - your system has insufficient memory to load the test image.");
++ return FALSE;
++ }
++
++ g_assert_no_error (err);
++ return TRUE;
++}
++
++gboolean
+ pixdata_equal (GdkPixbuf *p1, GdkPixbuf *p2, GError **error)
+ {
+ if (gdk_pixbuf_get_colorspace (p1) != gdk_pixbuf_get_colorspace (p2)) {
+Index: b/tests/test-common.h
+===================================================================
+--- a/tests/test-common.h
++++ b/tests/test-common.h
+@@ -28,6 +28,7 @@
+ G_BEGIN_DECLS
+
+ gboolean format_supported (const gchar *filename);
++gboolean assert_error_not_insufficient_memory (GError *err);
+ gboolean pixdata_equal (GdkPixbuf *p1, GdkPixbuf *p2, GError **error);
+
+ G_END_DECLS
+Index: b/tests/Makefile.am
+===================================================================
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -60,6 +60,8 @@
+
+ cve_2015_4491_SOURCES = \
+ cve-2015-4491.c \
++ test-common.c \
++ test-common.h \
+ resources.h \
+ resources.c \
+ $(NULL)
More information about the pkg-gnome-commits
mailing list