[dbus/f20] Add patch for testcase failure
Daniel Williams
dcbw at fedoraproject.org
Mon Nov 11 22:27:50 UTC 2013
commit ff52a85702d281a09d184bdd934bc2655dfaa4bd
Author: Dan Williams <dcbw at redhat.com>
Date: Mon Nov 11 16:28:14 2013 -0600
Add patch for testcase failure
...-7c00ed22d9b5c33f5b33221e906946b11a9bde3b.patch | 40 ++++++++++++++++++++
dbus.spec | 6 ++-
2 files changed, 44 insertions(+), 2 deletions(-)
---
diff --git a/avoid-undefined-7c00ed22d9b5c33f5b33221e906946b11a9bde3b.patch b/avoid-undefined-7c00ed22d9b5c33f5b33221e906946b11a9bde3b.patch
new file mode 100644
index 0000000..3f13319
--- /dev/null
+++ b/avoid-undefined-7c00ed22d9b5c33f5b33221e906946b11a9bde3b.patch
@@ -0,0 +1,40 @@
+From 7c00ed22d9b5c33f5b33221e906946b11a9bde3b Mon Sep 17 00:00:00 2001
+From: DreamNik <dreamnik at mail.ru>
+Date: Sun, 29 Sep 2013 10:45:58 +0000
+Subject: make_and_run_test_nodes: avoid undefined behaviour
+
+In code that looks like n[i] = v(&i), where v increments i, C leaves it
+undefined whether the old or new value of i is used to locate n[i].
+As it happens, gcc used the pre-increment value of i, but MSVC
+used the post-increment value.
+
+Fix this by inserting a sequence point to disambiguate the intended order.
+
+Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69924
+Reviewed-by: Chengwei Yang <chengwei.yang at intel.com>
+Reviewed-by: Simon McVittie <simon.mcvittie at collabora.co.uk>
+[wrote commit message, fixed whitespace -smcv]
+Signed-off-by: Simon McVittie <simon.mcvittie at collabora.co.uk>
+---
+diff --git a/dbus/dbus-marshal-recursive-util.c b/dbus/dbus-marshal-recursive-util.c
+index 9512414..a2aaaf9 100644
+--- a/dbus/dbus-marshal-recursive-util.c
++++ b/dbus/dbus-marshal-recursive-util.c
+@@ -1785,10 +1785,13 @@ make_and_run_test_nodes (void)
+ start_next_test ("All values in one big toplevel %d iteration\n", 1);
+ {
+ TestTypeNode *nodes[N_VALUES];
++ TestTypeNode *node;
+
+ i = 0;
+- while ((nodes[i] = value_generator (&i)))
+- ;
++ while ((node = value_generator (&i)))
++ {
++ nodes[i - 1] = node;
++ }
+
+ run_test_nodes (nodes, N_VALUES);
+
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/dbus.spec b/dbus.spec
index 9b93804..982bea0 100644
--- a/dbus.spec
+++ b/dbus.spec
@@ -52,7 +52,8 @@ BuildRequires: /usr/bin/Xvfb
Patch0: bindir.patch
Patch1: 0001-name-test-Don-t-run-test-autolaunch-if-we-don-t-have.patch
Patch2: 0001-test-marshal-Ensure-we-use-suitably-aligned-buffers.patch
-Patch3: 0001-_dbus_babysitter_unref-avoid-infinite-loop-if-waitpi.patch
+Patch3: avoid-undefined-7c00ed22d9b5c33f5b33221e906946b11a9bde3b.patch
+Patch4: 0001-_dbus_babysitter_unref-avoid-infinite-loop-if-waitpi.patch
%description
D-BUS is a system for sending messages between applications. It is
@@ -105,6 +106,7 @@ in this separate package so server systems need not install X.
%patch1 -p1
%patch2 -p1
%patch3 -p1
+%patch4 -p1
%build
if test -f autogen.sh; then env NOCONFIGURE=1 ./autogen.sh; else autoreconf -v -f -i; fi
@@ -148,7 +150,7 @@ mkdir -p %{buildroot}/var/lib/dbus
%check
if test -f autogen.sh; then env NOCONFIGURE=1 ./autogen.sh; else autoreconf -v -f -i; fi
-%configure %{dbus_common_config_opts} --enable-asserts --enable-verbose-mode --enable-tests
+%configure %{dbus_common_config_opts} --enable-asserts --enable-verbose-mode --enable-tests --enable-developer --with-valgrind
make clean
# TODO: better script for this...
More information about the scm-commits
mailing list