Commit graph

5672 commits

Author SHA1 Message Date
Ralf Habacker
ae96d7c55c Fix setup of build time output paths in cmake
Instead of the variables EXECUTABLE_OUTPUT_PATH and
LIBRARY_OUTPUT_PATH, which have become obsolete since
cmake 3.x, CMAKE_xxx_OUTPUT_PATH is now used to define
output paths in the build directory.
2018-12-17 16:25:03 +01:00
Simon McVittie
e64c60cf46 Merge branch 'copyright-whitespace' into 'master'
trivial: Remove trailing whitespace from copyright notices

See merge request dbus/dbus!75

Reviewed-by: pwithnall
2018-12-17 12:13:12 +00:00
Simon McVittie
39ea37b587 trivial: Remove trailing whitespace from copyright notices
We don't usually mass-remove trailing whitespace from the actual source
code because it would complicate cherry-picking bug fixes to older
branches, but that reasoning doesn't really apply to the comments
containing copyright and licensing notices.

Removing trailing whitespace makes it much easier to move code around:
we have a commit hook that rejects commits containing trailing
whitespace, but that commit hook counts moving a file as a delete + add
pair, so it objects to moving code that contains trailing whitespace.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-17 11:22:39 +00:00
Simon McVittie
95797dc99a Merge branch 'remove-threads-init-debug' into 'master'
_dbus_threads_init_debug: Remove

See merge request dbus/dbus!72
2018-12-17 10:28:07 +00:00
Simon McVittie
83034f38be _dbus_threads_init_debug: Remove
libdbus has been thread-safe by default since 1.7.6 (2013):
dbus_threads_init_default() is called on a just-in-time basis
whenever needed, and _dbus_thread_init_debug() is equivalent to that.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-14 20:06:02 +00:00
Simon McVittie
c3f401a673 Merge branch 'gitignore' into 'master'
trivial: Clean up .gitignore files

See merge request dbus/dbus!70

Reviewed-by: pwithnall
2018-12-14 15:11:51 +00:00
Simon McVittie
fa63c16346 .gitignore: Ignore many more generated files
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-14 13:28:50 +00:00
Simon McVittie
5e66241c77 Merge branch 'reduce-test-refs-run-time' into 'master'
Decrease the runtime of test-refs under Windows

Closes #244

See merge request dbus/dbus!65
2018-12-14 13:08:01 +00:00
Simon McVittie
d3fffaa72f .gitignore: Normalize into LC_ALL=C sort order
If lists are in a completely arbitrary order, sorting them consistently
means that there is only one correct place to insert a new entry, avoiding
the merge conflicts that would occur if we always append new entries.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-14 12:53:08 +00:00
Simon McVittie
0c62a9a5f4 .gitignore: Make match patterns more specific
In subdirectories we mostly only want to match at the current level,
not in nested subdirectories.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-14 12:53:08 +00:00
Simon McVittie
dfd09355ef valid-config-files-system .gitignore: Don't ignore many-rules.conf
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-14 12:53:08 +00:00
Simon McVittie
2fd386245b .gitignore: Remove obsolete patterns
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-14 12:53:08 +00:00
Simon McVittie
c95873e537 .gitignore: Consolidate generic patterns at top level
Patterns in the top-level .gitignore match in all subdirectories, so
there's no need to repeat ourselves quite so much for generic
C, Autotools and gcov patterns.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-14 12:53:08 +00:00
Simon McVittie
d79986db28 Top level .gitignore: Sort anchored patterns in LC_ALL=C sort order
If lists are in a completely arbitrary order, sorting them consistently
means that there is only one correct place to insert a new entry, avoiding
the merge conflicts that would occur if we always append new entries.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-14 12:52:15 +00:00
Simon McVittie
9984e6ebed Top level .gitignore: Group anchored and unanchored patterns
The anchored patterns match only in the top directory; the unanchored
patterns match in any subdirectory. While I'm moving the unanchored
patterns around anyway, sort them in lexicographical (LC_ALL=C sort)
order.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-14 12:42:22 +00:00
Simon McVittie
27d69a8899 .gitignore: Anchor patterns for files that are only at top level
There shouldn't be an aclocal.m4 in any subdirectory, for instance,
so there's no need to ignore it.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-14 12:40:22 +00:00
Simon McVittie
932638b18d Top level .gitignore: Remove files that now live in build-aux/
We put these in build-aux/ since 15e6b4f5, and we ignore all of
build-aux/, so we don't need to ignore them separately.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-14 12:38:07 +00:00
Simon McVittie
78d1cf2e7f Merge branch 'all-helpers-in-test' into 'master'
test-privserver: Move helper executable out of name-test/

See merge request dbus/dbus!67
2018-12-14 12:17:14 +00:00
Ralf Habacker
48538357c6 Increase the number of references/threads to be tested under Windows by default to detect errors 2018-12-14 11:04:21 +01:00
Ralf Habacker
95171f4f1a Decrease the runtime of test refs under Windows by default
If the environment variable DBUS_TEST_SLOW is not set or is 0
fewer iterations are performed in test-refs enough to demonstrate
that it works, rather than seriously trying to reproduce race
conditions.

This solves the long runtime that Wine 3.x (4 times longer than
native Windows 7) or Windows 7 as a VirtualBox 5.22 guest (10
times longer) is to be seen.

Fixes #244
2018-12-14 10:54:52 +01:00
Simon McVittie
9490e954d0 test-privserver: Move helper executable out of name-test/
This means we don't need to distinguish between DBUS_NAME_TEST_EXEC and
DBUS_TEST_EXEC any more, because all test helper executables are in the
same place, both during build and when installed (we don't install
test-privserver since no installed test requires it yet, but in
principle we could).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-13 13:08:00 +00:00
Simon McVittie
0d79fa68c0 test-privserver: Add copyright and licensing information
I've assumed that trivial changes from Scott James Remnant (correcting
some bus names) and Marcus Brinkmann (adding a <config.h> include
tree-wide) are not significant here. All the other potential copyright
holders from the git log are listed, and all have given permission to
relicense their dbus contributions under the MIT/X11 license.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-13 13:07:20 +00:00
Simon McVittie
17e6b1484a test-privserver: Remove all trailing whitespace
Otherwise the commit hook would forbid commits that move it to a new
location.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-13 12:42:11 +00:00
Simon McVittie
e80ff14c2d Merge branch 'wip/asan' into 'master'
Add AddressSanitizer and UBSan support

See merge request dbus/dbus!57

Reviewed-by: pwithnall
2018-12-12 12:01:40 +00:00
Simon McVittie
9a5c750ae7 Merge branch 'basic-value-align' into 'master'
Don't cast user-supplied pointers to DBusBasicValue *

See merge request dbus/dbus!69

Reviewed-by: thiago
2018-12-12 12:00:03 +00:00
Simon McVittie
eb837e6fd7 ci: Apply AddressSanitizer to Linux "debug" builds
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-11 12:47:22 +00:00
Simon McVittie
0c9f943277 build: Add a way to set CFLAGS for AddressSanitizer etc.
We don't want to set these globally via the normal CFLAGS, because if
we did, AddressSanitizer would catch test-segfault deliberately
segfaulting, and "helpfully" turn it into exit status 1, which in turn
makes our test fail because it asserts that the segfault is reported
as a segfault.

A typical use with gcc as compiler, on a reasonably recent Debian,
would be:

    ./configure SANITIZE_CFLAGS="-fsanitize=address -fsanitize=undefined -fPIE -pie"

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-11 12:47:22 +00:00
Simon McVittie
64f94d3f5b Move _dbus_disable_crash_handling() back into test/ directory
It's only used in test code. We have to put it in its own translation
unit with no non-libc dependencies so that we can compile a copy of it
without AddressSanitizer support, because in a subsequent commit we will
special-case test-segfault to be compiled without using AddressSanitizer,
which would make linking to an AddressSanitizer-instrumented libdbus fail.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-11 12:47:22 +00:00
Simon McVittie
c3d15a9ead tests: Allow timeout to be multiplied by an arbitrary factor
Running tests under instrumentation (libasan) or emulation (qemu)
is not fast.

Inspired by the --timeout-factor option in
<https://salsa.debian.org/ci-team/autopkgtest>.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-11 12:47:22 +00:00
Simon McVittie
3cdabeb0ed Merge branch 'privserver-leak' into 'master'
test-privserver: Don't leak the DBusServer

See merge request dbus/dbus!68
2018-12-11 12:38:59 +00:00
Simon McVittie
26d5d97d5b Don't cast user-supplied pointers to DBusBasicValue *
If we cast a user-supplied pointer to DBusBasicValue *, that's like
promising that the pointer is to an object at least as strictly aligned
as a DBusBasicValue. In practice, it often isn't: for example, when
we marshal a dbus_uint32_t, a pointer to it is only guaranteed to be
32-bit-aligned, whereas DBusBasicValue typically requires 64-bit
alignment.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-11 12:23:06 +00:00
Simon McVittie
552ad905f4 test-privserver: Don't leak the DBusServer
This results in (harmless) leak reports when running under the
AddressSanitizer, which could make real leaks harder to find.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-11 12:21:49 +00:00
Ralf Habacker
d9de6ab213 Add build system variable DBUS_NAME_TEST_EXEC to cover differences in executable paths
Autotools creates executable applications in the respective
subdirectory of the build directory, while cmake creates
them in <build-root>/bin.

This leads to different paths in the file created
from org.freedesktop.DBus.TestSuite.PrivServer.service.in,
which are fixed by the new variable.

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/135
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-12-11 10:41:07 +00:00
Ralf Habacker
a7d1e275e7 Refer to correct bus in test-ids error message
The test tries to connect to the session bus, not system bus.

Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-12-11 10:39:26 +00:00
Ralf Habacker
5a3dd741fb run-session: Fix warning 'array subscript 3 is above array bounds of 'char *[3]' on Windows
After the merge request !22 was created, this bug was fixed in !23,
the associated branch was used for local tests, but the fix was not
transferred to !22. After merging !22 into the master branch and
rebasing !23 to the master, this fix was lost.

Reviewed-by: Simon McVittie <smcv@collabora.com>
2018-12-11 10:39:02 +00:00
Simon McVittie
4dac09a0e4 Merge branch 'skip-server-oom-test' into 'master'
Skip server oom wildcard test on Windows to avoid firewall exception request

See merge request dbus/dbus!64

Reviewed-by: smcv
2018-12-06 16:42:09 +00:00
Ralf Habacker
0f5f95ab6e Skip server oom wildcard test on Windows to avoid firewall exception request
After starting the test on Windows 10, whether the local user is an
administrator or not, a dialog box appears with a warning that some
features of the app have been blocked by the firewall and prompts for
credentials for an administrator account while the test continues to
run and pass.

If this request is aborted, the dialog disappears; no restrictions are
visible for the test case. When the test is restarted, the dialog is also
no longer displayed.

In the firewall configuration you can then see that test-server-oom.exe
has been added (but not enabled) for public networks, although no
confirmation has been received from an administrator account.
2018-12-06 17:08:29 +01:00
Simon McVittie
4a9a003904 Merge branch 'fix-cmake-wine-support' into 'master'
Fix cmake wine support

See merge request dbus/dbus!60

Reviewed-by: smcv
2018-12-06 12:24:37 +00:00
Ralf Habacker
56171457fb Add new cmake configure option DBUS_USE_WINE
If this variable is set, ctest uses wine to run cross compiled
test applications. Otherwise, they are assumed to run on a native
Windows operating system.

The new cmake variables Z_DRIVE_IF_WINE and TEST_WRAPPER have been
added to support this function.
2018-12-06 09:18:27 +01:00
Simon McVittie
533ec58c9a Merge branch 'fix-cmake-tests' into 'master'
Fix cmake tests

See merge request dbus/dbus!59

Reviewed-by: smcv
2018-12-05 16:06:05 +00:00
Simon McVittie
a688cee856 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-05 15:02:42 +00:00
Ralf Habacker
0c0e7361ae Adds uac manifest to all executable test files to prevent the Windows 740 error when running
The case occurred during test-pending-call-dispatch. To avoid further
applications being affected in the future, the manifest is added to
all test applications.

Windows Error 740 is defined as 'The Requested Operation Requires Elevation'
2018-12-05 15:58:48 +01:00
Ralf Habacker
ffcaede257 Drop cmake variable DBUS_WIN_FIXME 2018-12-05 15:58:48 +01:00
Ralf Habacker
02bb1c2cfa Avoid memory leaks on running check_shell_service_success_auto_start on Windows 2018-12-05 15:58:48 +01:00
Simon McVittie
78efbb6c0d CI: Install yelp-tools, for yelp-build, in recent distros
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-05 14:54:24 +00:00
Simon McVittie
52fcc82379 CI: Make adduser properly non-interactive
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-05 14:54:24 +00:00
Simon McVittie
cb6abc6391 CI: Don't install weak dependencies (Recommends)
In particular this avoids installing the TeX toolchain.

However, this also means we don't install dbus, which broke some tests
in minimal containers where dbus wasn't already installed, because the
messagebus user wouldn't have been created. Make sure that user exists,
using the same adduser call as the Debian dbus package.

CMake really wants to find a C++ compiler (even though we only use C++
when compiling for Windows), so explicitly install the default
version of the GNU C++ compiler, g++.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-05 14:54:24 +00:00
Ralf Habacker
6e16afd0c1 Merge branch 'sysdeps-test-wait' into 'master'
sysdeps test: Wait for spawned process to exit

Closes #238
See merge request dbus/dbus!61
Reviewed-by: rhabacker
2018-12-05 14:32:53 +00:00
Simon McVittie
7db891482f sysdeps test: Wait for spawned process to exit
On Windows, the "out" parameter for the process handle isn't set
unless we specify G_SPAWN_FLAGS_DO_NOT_REAP_CHILD. That means we
can't terminate it, and the child process is leaked. When running the
test individually, the leaked process is harmless apart from its
resource cost, but when running under CTest, it holds a file descriptor
open (or something) which causes CTest to not exit.

If we *do* specify G_SPAWN_FLAGS_DO_NOT_REAP_CHILD, we become
responsible for "reaping" the child process by waiting for its exit
status, which is an OS-specific action.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: https://gitlab.freedesktop.org/dbus/dbus/issues/238
2018-12-05 15:30:47 +01:00
Ralf Habacker
7f5eee6dca Merge branch 'syslog-test-newlines' into 'master'
syslog test: Don't assert that we see plain LF newlines

Closes #243

See merge request dbus/dbus!62
2018-12-05 14:28:36 +00:00