[systemd-commits] 3 commits - configure.ac Makefile.am src/libsystemd

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Wed Jan 15 21:16:46 PST 2014


 Makefile.am             |   12 +++++++++++-
 configure.ac            |    2 +-
 src/libsystemd/sd-bus.c |   17 +++++++++++++++--
 3 files changed, 27 insertions(+), 4 deletions(-)

New commits:
commit 235ee2134f8819c5f48ae99a2d817b6b2147ad8a
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Tue Jan 14 14:27:48 2014 -0500

    build-sys: increase valgrind stack limit so all tests pass again

diff --git a/Makefile.am b/Makefile.am
index 677de0c..72da667 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4926,7 +4926,7 @@ valgrind-tests: $(TESTS)
 		if file $$f | grep -q shell; then \
 		echo -e "$${x}Skipping non-binary $$f"; else \
 		echo -e "$${x}Running $$f"; \
-	        libtool --mode=execute valgrind -q --leak-check=full --max-stackframe=4194400 --error-exitcode=55 $(builddir)/$$f ; fi; \
+	        libtool --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \
 		x="\n\n"; \
 	done
 

commit b7fc42e03a7f52efb8707fabbab841d8b2ffff8c
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Tue Jan 14 14:26:37 2014 -0500

    bus: break reference cycle between bus and messages
    
    Previously (6ee4f99 bus: break reference cycle between bus and
    messages) I committed the test code, but not the actual fix :)

diff --git a/Makefile.am b/Makefile.am
index 4fc9097..677de0c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2096,6 +2096,7 @@ tests += \
 	test-bus-marshal \
 	test-bus-signature \
 	test-bus-chat \
+	test-bus-cleanup \
 	test-bus-server \
 	test-bus-match \
 	test-bus-kernel \
@@ -2157,6 +2158,15 @@ test_bus_chat_LDADD = \
 	libsystemd-daemon-internal.la \
 	libsystemd-shared.la
 
+test_bus_cleanup_SOURCES = \
+	src/libsystemd/test-bus-cleanup.c
+
+test_bus_cleanup_LDADD = \
+	libsystemd-internal.la \
+	libsystemd-id128-internal.la \
+	libsystemd-daemon-internal.la \
+	libsystemd-shared.la
+
 test_bus_server_SOURCES = \
 	src/libsystemd/test-bus-server.c
 
diff --git a/src/libsystemd/sd-bus.c b/src/libsystemd/sd-bus.c
index 6bd1eaa..b76221e 100644
--- a/src/libsystemd/sd-bus.c
+++ b/src/libsystemd/sd-bus.c
@@ -1259,12 +1259,25 @@ _public_ sd_bus *sd_bus_ref(sd_bus *bus) {
 }
 
 _public_ sd_bus *sd_bus_unref(sd_bus *bus) {
+        unsigned i;
 
         if (!bus)
                 return NULL;
 
-        if (REFCNT_DEC(bus->n_ref) <= 0)
-                bus_free(bus);
+        i = REFCNT_DEC(bus->n_ref);
+        if (i != bus->rqueue_size + bus->wqueue_size)
+                return NULL;
+
+        for (i = 0; i < bus->rqueue_size; i++)
+                if (bus->rqueue[i]->n_ref > 1)
+                        return NULL;
+
+        for (i = 0; i < bus->wqueue_size; i++)
+                if (bus->wqueue[i]->n_ref > 1)
+                        return NULL;
+
+        /* we are the only holders on the messages */
+        bus_free(bus);
 
         return NULL;
 }

commit 8114dedc5910d9a9cec702f6b6658551a0cd9ede
Author: Chengwei Yang <chengwei.yang at intel.com>
Date:   Wed Jan 15 13:06:00 2014 +0800

    build-sys: fix --enable-dbus
    
    The incorrect shell code of AS_IF always get false value, so it always
    build without dbus though build with "--enable-dbus" explicitely.

diff --git a/configure.ac b/configure.ac
index 7140627..939ba6d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -249,7 +249,7 @@ m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-conf
 # ------------------------------------------------------------------------------
 have_dbus=no
 AC_ARG_ENABLE(dbus, AS_HELP_STRING([--disable-dbus], [disable usage of dbus-1 in tests]))
-AS_IF(["x$enable_dbus" != "xno"], [
+AS_IF([test "x$enable_dbus" != "xno"], [
         PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2],
                 [AC_DEFINE(HAVE_DBUS, 1, [Define if dbus-1 library is available]) have_dbus=yes],
                 [have_dbus=no])



More information about the systemd-commits mailing list