r52474 - in /desktop/experimental/glib2.0/debian: ./ patches/
laney at users.alioth.debian.org
laney at users.alioth.debian.org
Fri Jun 23 10:09:11 UTC 2017
Author: laney
Date: Fri Jun 23 10:09:10 2017
New Revision: 52474
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=52474
Log:
* New upstream release 2.53.3.
* d/p/0001-gdatetime-Fix-a-potential-overflow-in-overflow-calcu.patch,
d/p/0002-tests-Fix-GDateTime-overflow-tests-on-32-bit-archite.patch,
d/p/0003-tests-Fix-overflows-in-find_maximum_supported_tv_sec.patch:
Cherry-picks to fix some overflow problems in GDateTime on 32 bit arches.
Added:
desktop/experimental/glib2.0/debian/patches/0001-gdatetime-Fix-a-potential-overflow-in-overflow-calcu.patch
desktop/experimental/glib2.0/debian/patches/0002-tests-Fix-GDateTime-overflow-tests-on-32-bit-archite.patch
desktop/experimental/glib2.0/debian/patches/0003-tests-Fix-overflows-in-find_maximum_supported_tv_sec.patch
Modified:
desktop/experimental/glib2.0/debian/changelog
desktop/experimental/glib2.0/debian/control
desktop/experimental/glib2.0/debian/patches/series
Modified: desktop/experimental/glib2.0/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/glib2.0/debian/changelog?rev=52474&op=diff
==============================================================================
--- desktop/experimental/glib2.0/debian/changelog [utf-8] (original)
+++ desktop/experimental/glib2.0/debian/changelog [utf-8] Fri Jun 23 10:09:10 2017
@@ -1,3 +1,13 @@
+glib2.0 (2.53.3-1) UNRELEASED; urgency=medium
+
+ * New upstream release 2.53.3.
+ * d/p/0001-gdatetime-Fix-a-potential-overflow-in-overflow-calcu.patch,
+ d/p/0002-tests-Fix-GDateTime-overflow-tests-on-32-bit-archite.patch,
+ d/p/0003-tests-Fix-overflows-in-find_maximum_supported_tv_sec.patch:
+ Cherry-picks to fix some overflow problems in GDateTime on 32 bit arches.
+
+ -- Iain Lane <laney at debian.org> Mon, 12 Jun 2017 16:38:13 +0100
+
glib2.0 (2.53.2-1) experimental; urgency=medium
* New upstream release 2.53.2
Modified: desktop/experimental/glib2.0/debian/control
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/glib2.0/debian/control?rev=52474&op=diff
==============================================================================
--- desktop/experimental/glib2.0/debian/control [utf-8] (original)
+++ desktop/experimental/glib2.0/debian/control [utf-8] Fri Jun 23 10:09:10 2017
@@ -6,7 +6,7 @@
Section: libs
Priority: optional
Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers at lists.alioth.debian.org>
-Uploaders: Iain Lane <laney at debian.org>, Michael Biebl <biebl at debian.org>
+Uploaders: Iain Lane <laney at debian.org>
Build-Depends: debhelper (>= 10~),
dh-exec,
dh-python,
Added: desktop/experimental/glib2.0/debian/patches/0001-gdatetime-Fix-a-potential-overflow-in-overflow-calcu.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/glib2.0/debian/patches/0001-gdatetime-Fix-a-potential-overflow-in-overflow-calcu.patch?rev=52474&op=file
==============================================================================
--- desktop/experimental/glib2.0/debian/patches/0001-gdatetime-Fix-a-potential-overflow-in-overflow-calcu.patch (added)
+++ desktop/experimental/glib2.0/debian/patches/0001-gdatetime-Fix-a-potential-overflow-in-overflow-calcu.patch [utf-8] Fri Jun 23 10:09:10 2017
@@ -0,0 +1,39 @@
+From 2db7aa479919dc7ae8742f52ad5d54191a7282fd Mon Sep 17 00:00:00 2001
+From: Philip Withnall <withnall at endlessm.com>
+Date: Fri, 16 Jun 2017 12:31:58 +0100
+Subject: [PATCH 1/3] gdatetime: Fix a potential overflow in overflow
+ calculations
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+I can’t remember whether glong (tv.tv_sec) needs to be explicitly
+promoted to gint64 here, or whether C does it automatically. Safer to
+make the cast explicit to avoid overflow issues on 32-bit platforms,
+where glong is 32-bit.
+
+Signed-off-by: Philip Withnall <withnall at endlessm.com>
+
+https://bugzilla.gnome.org/show_bug.cgi?id=783841
+
+Applied-Upstream: 2.53.4
+---
+ glib/gdatetime.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/glib/gdatetime.c b/glib/gdatetime.c
+index 7695adf09..745a32a9d 100644
+--- a/glib/gdatetime.c
++++ b/glib/gdatetime.c
+@@ -128,7 +128,7 @@ struct _GDateTime
+ #define INSTANT_TO_UNIX(instant) \
+ ((instant)/USEC_PER_SECOND - UNIX_EPOCH_START * SEC_PER_DAY)
+ #define UNIX_TO_INSTANT(unix) \
+- (((unix) + UNIX_EPOCH_START * SEC_PER_DAY) * USEC_PER_SECOND)
++ (((gint64) (unix) + UNIX_EPOCH_START * SEC_PER_DAY) * USEC_PER_SECOND)
+ #define UNIX_TO_INSTANT_IS_VALID(unix) \
+ ((gint64) (unix) <= INSTANT_TO_UNIX (G_MAXINT64))
+
+--
+2.11.0
+
Added: desktop/experimental/glib2.0/debian/patches/0002-tests-Fix-GDateTime-overflow-tests-on-32-bit-archite.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/glib2.0/debian/patches/0002-tests-Fix-GDateTime-overflow-tests-on-32-bit-archite.patch?rev=52474&op=file
==============================================================================
--- desktop/experimental/glib2.0/debian/patches/0002-tests-Fix-GDateTime-overflow-tests-on-32-bit-archite.patch (added)
+++ desktop/experimental/glib2.0/debian/patches/0002-tests-Fix-GDateTime-overflow-tests-on-32-bit-archite.patch [utf-8] Fri Jun 23 10:09:10 2017
@@ -0,0 +1,89 @@
+From 30fed3b906f3408aa4fc9a7996fa03cf7b940ebe Mon Sep 17 00:00:00 2001
+From: Philip Withnall <withnall at endlessm.com>
+Date: Fri, 16 Jun 2017 12:42:32 +0100
+Subject: [PATCH 2/3] tests: Fix GDateTime overflow tests on 32-bit
+ architectures
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+On architectures where sizeof(glong) == 32 bits, there are no problems
+with overflow when constructing a GDateTime from a GTimeVal. Adjust the
+test for this by basing it on the maximum supported tv_sec value it can
+calculate, rather than a fixed ‘known unsupported’ value.
+
+Signed-off-by: Philip Withnall <withnall at endlessm.com>
+
+https://bugzilla.gnome.org/show_bug.cgi?id=783841
+
+Applied-Upstream: 2.53.4
+---
+ glib/tests/gdatetime.c | 35 +++++++++++++++++++++--------------
+ 1 file changed, 21 insertions(+), 14 deletions(-)
+
+diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c
+index db04870d2..398544500 100644
+--- a/glib/tests/gdatetime.c
++++ b/glib/tests/gdatetime.c
+@@ -401,7 +401,10 @@ find_maximum_supported_tv_sec (void)
+
+ /* Check that trying to create a #GDateTime too far in the future reliably
+ * fails. With a #GTimeVal, this is subtle, as the tv_usec are added into the
+- * calculation part-way through. */
++ * calculation part-way through.
++ *
++ * This varies a bit between 32- and 64-bit architectures, due to the
++ * differences in the size of glong (tv.tv_sec). */
+ static void
+ test_GDateTime_new_from_timeval_overflow (void)
+ {
+@@ -410,29 +413,33 @@ test_GDateTime_new_from_timeval_overflow (void)
+
+ g_test_bug ("782089");
+
+- tv.tv_sec = G_MAXLONG;
+- tv.tv_usec = 0;
+-
+- dt = g_date_time_new_from_timeval_utc (&tv);
+- g_assert_null (dt);
+-
+- dt = g_date_time_new_from_timeval_local (&tv);
+- g_assert_null (dt);
+-
+ tv.tv_sec = find_maximum_supported_tv_sec ();
+ tv.tv_usec = G_USEC_PER_SEC - 1;
+
+ g_test_message ("Maximum supported GTimeVal.tv_sec = %lu", tv.tv_sec);
+
++ /* Sanity check: do we support the year 2000? */
++ g_assert_cmpint (tv.tv_sec, >=, 946684800);
++
+ dt = g_date_time_new_from_timeval_utc (&tv);
+ g_assert_nonnull (dt);
+ g_date_time_unref (dt);
+
+- tv.tv_sec++;
+- tv.tv_usec = 0;
++ dt = g_date_time_new_from_timeval_local (&tv);
++ g_assert_nonnull (dt);
++ g_date_time_unref (dt);
+
+- dt = g_date_time_new_from_timeval_utc (&tv);
+- g_assert_null (dt);
++ if (tv.tv_sec < G_MAXLONG)
++ {
++ tv.tv_sec++;
++ tv.tv_usec = 0;
++
++ dt = g_date_time_new_from_timeval_utc (&tv);
++ g_assert_null (dt);
++
++ dt = g_date_time_new_from_timeval_local (&tv);
++ g_assert_null (dt);
++ }
+ }
+
+ static void
+--
+2.11.0
+
Added: desktop/experimental/glib2.0/debian/patches/0003-tests-Fix-overflows-in-find_maximum_supported_tv_sec.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/glib2.0/debian/patches/0003-tests-Fix-overflows-in-find_maximum_supported_tv_sec.patch?rev=52474&op=file
==============================================================================
--- desktop/experimental/glib2.0/debian/patches/0003-tests-Fix-overflows-in-find_maximum_supported_tv_sec.patch (added)
+++ desktop/experimental/glib2.0/debian/patches/0003-tests-Fix-overflows-in-find_maximum_supported_tv_sec.patch [utf-8] Fri Jun 23 10:09:10 2017
@@ -0,0 +1,58 @@
+From 428acd9b1486beba186c073577ea659eee44ae0a Mon Sep 17 00:00:00 2001
+From: Philip Withnall <withnall at endlessm.com>
+Date: Mon, 19 Jun 2017 13:57:36 +0100
+Subject: [PATCH 3/3] tests: Fix overflows in find_maximum_supported_tv_sec()
+
+The addition (highest_success + lowest_failure) could have overflowed,
+and typically would do on 32-bit platforms where the real
+highest_success should be G_MAXLONG. Fix that, and introduce special
+handling of the corner case of (highest_success = G_MAXLONG).
+
+Signed-off-by: Philip Withnall <withnall at endlessm.com>
+
+https://bugzilla.gnome.org/show_bug.cgi?id=783841
+
+Applied-Upstream: 2.53.4
+---
+ glib/tests/gdatetime.c | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c
+index 398544500..4cb5a0a44 100644
+--- a/glib/tests/gdatetime.c
++++ b/glib/tests/gdatetime.c
+@@ -370,19 +370,27 @@ test_GDateTime_new_from_timeval (void)
+ g_date_time_unref (dt);
+ }
+
+-static gint64
++static glong
+ find_maximum_supported_tv_sec (void)
+ {
+ glong highest_success = 0, lowest_failure = G_MAXLONG;
+ GTimeVal tv;
++ GDateTime *dt = NULL;
+
+ tv.tv_usec = 0;
+
+- while (highest_success < lowest_failure - 1)
++ /* Corner case of all glong values being valid. */
++ tv.tv_sec = G_MAXLONG;
++ dt = g_date_time_new_from_timeval_utc (&tv);
++ if (dt != NULL)
+ {
+- GDateTime *dt;
++ highest_success = tv.tv_sec;
++ g_date_time_unref (dt);
++ }
+
+- tv.tv_sec = (highest_success + lowest_failure) / 2;
++ while (highest_success < lowest_failure - 1)
++ {
++ tv.tv_sec = highest_success + (lowest_failure - highest_success) / 2;
+ dt = g_date_time_new_from_timeval_utc (&tv);
+
+ if (dt != NULL)
+--
+2.11.0
+
Modified: desktop/experimental/glib2.0/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/glib2.0/debian/patches/series?rev=52474&op=diff
==============================================================================
--- desktop/experimental/glib2.0/debian/patches/series [utf-8] (original)
+++ desktop/experimental/glib2.0/debian/patches/series [utf-8] Fri Jun 23 10:09:10 2017
@@ -1,3 +1,6 @@
+0001-gdatetime-Fix-a-potential-overflow-in-overflow-calcu.patch
+0002-tests-Fix-GDateTime-overflow-tests-on-32-bit-archite.patch
+0003-tests-Fix-overflows-in-find_maximum_supported_tv_sec.patch
01_gettext-desktopfiles.patch
02_gettext-desktopfiles-ubuntu.patch
03_disble_glib_compile_schemas_warning.patch
More information about the pkg-gnome-commits
mailing list