From 99cd6b59a83336470a35fd0525c06ca475a06e70 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 22 Feb 2011 18:51:55 +0000 Subject: [PATCH 01/10] Add a hackish script to reproduce fd.o #34393 The number of messages is arbitrary; the more messages, the more likely the crash is. 2000 messages seem to cause it reliably, on this laptop. The script may have race conditions (there are a couple of hard-coded sleep calls), so I haven't set it up to be run automatically. --- .gitignore | 2 + configure.ac | 1 + test/Makefile.am | 2 +- test/data/valid-config-files/incoming-limit.conf | 18 +++++++++++ test/manual/Makefile.am | 12 ++++++++ test/manual/limit.in | 34 ++++++++++++++++++++++ 6 files changed, 68 insertions(+), 1 deletions(-) create mode 100644 test/data/valid-config-files/incoming-limit.conf create mode 100644 test/manual/Makefile.am create mode 100644 test/manual/limit.in diff --git a/.gitignore b/.gitignore index db3db97..2640537 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,5 @@ tags /lcov.html/ /lcov.info /lcov.info.tmp +/test/manual/dbus-daemon.addr.*.tmp +/test/manual/test-limit diff --git a/configure.ac b/configure.ac index 03914e1..6013699 100644 --- a/configure.ac +++ b/configure.ac @@ -1639,6 +1639,7 @@ dbus/Makefile bus/Makefile tools/Makefile test/Makefile +test/manual/Makefile test/name-test/Makefile doc/Makefile doc/dbus-daemon.1 diff --git a/test/Makefile.am b/test/Makefile.am index 9d0681b..91ed75f 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,7 +1,7 @@ ## the "name-test" subdir in fact contains a bunch of tests now that need a temporary bus ## to be running to do stuff with. The directory should be renamed. ## We want to build the current directory first to pick up the testutils lib -SUBDIRS= . name-test +SUBDIRS= . manual name-test DIST_SUBDIRS=name-test INCLUDES=-I$(top_srcdir) $(DBUS_TEST_CFLAGS) diff --git a/test/data/valid-config-files/incoming-limit.conf b/test/data/valid-config-files/incoming-limit.conf new file mode 100644 index 0000000..abfab3f --- /dev/null +++ b/test/data/valid-config-files/incoming-limit.conf @@ -0,0 +1,18 @@ + + + + session + unix:tmpdir=/tmp + + + + + + + + + + + 1 + diff --git a/test/manual/Makefile.am b/test/manual/Makefile.am new file mode 100644 index 0000000..ab156ae --- /dev/null +++ b/test/manual/Makefile.am @@ -0,0 +1,12 @@ +# This directory contains tests which aren't run automatically, because +# they're likely to have race conditions or other flaws. + +noinst_SCRIPTS = \ + test-limit + +test-limit: limit.in Makefile + sed -e 's![@]abs_top_builddir[@]!@abs_top_builddir@!g' \ + -e 's![@]abs_top_srcdir[@]!@abs_top_srcdir@!g' \ + < $< > $@.o + chmod +x $@.o + mv $@.o $@ diff --git a/test/manual/limit.in b/test/manual/limit.in new file mode 100644 index 0000000..51c897e --- /dev/null +++ b/test/manual/limit.in @@ -0,0 +1,34 @@ +#!/bin/sh + +abs_top_builddir="@abs_top_builddir@" +abs_top_srcdir="@abs_top_srcdir@" +pid=$$ + +set -e + +snooze () { + # hack! + sleep 1 +} + +config_file="$abs_top_srcdir/test/data/valid-config-files/incoming-limit.conf" + +"${abs_top_builddir}"/bus/dbus-daemon \ + --config-file="$config_file" --nofork \ + --print-address=3 \ + 3> dbus-daemon.addr.$pid.tmp & +daemon_pid=$! +snooze +daemon_addr=`cat dbus-daemon.addr.$pid.tmp` +DBUS_SESSION_BUS_ADDRESS="${daemon_addr}" +export DBUS_SESSION_BUS_ADDRESS + +"${abs_top_builddir}/tools/dbus-echo" --name=com.example.Echo & +echo_pid=$! +snooze + +"${abs_top_builddir}/tools/dbus-spam" --dest=com.example.Echo --count=2000 --flood + +kill $echo_pid +kill $daemon_pid +rm dbus-daemon.addr.$pid.tmp -- 1.7.4.1