Commit Graph

6132 Commits

Author SHA1 Message Date
Patrick Ohly a8e39070d6 testing: relax SyncEvo::IcalTest::testTimezone
The test started to fail in 2015 because the VTIMEZONE generated by
the code copied from libical has a minor dependency on the current
time: it finds the transitions for the current year, then pretends
that the same rule applied since 1970. While doing that, it uses this
years transition date and just replaces the year. Because the exact
date varies between years, the result depends on the current year.

The test now simply ignores the day of the month, while still checking
year and month. Those should always be the same.
2015-03-03 10:15:44 +01:00
Patrick Ohly 4e60b67c27 testing: ignore dl error on Ubuntu Vivid 2015-03-03 10:14:19 +01:00
Patrick Ohly fa27793134 PlainGStr: fix incorrect destruction when using reset()
When storing a pointer with PlainGStr::reset(), the default delete []
was used to free the memory. Should have used g_free(), as in the
constructor. Affects the signon backend.
2015-03-03 10:14:19 +01:00
Patrick Ohly 0c5f9c5170 StringPrintfV: add missing va_end()
When returning prematurely, va_end() was not called. This is a
potential resource leak. Found with cppcheck 1.67.
2015-03-03 10:14:19 +01:00
Patrick Ohly 4bedb549b3 gdbus: add missing va_end()
When returning prematurely, va_end() was not called. This is a
potential resource leak. Found with cppcheck 1.67.
2015-03-03 10:14:19 +01:00
Patrick Ohly b74f7273fa PullParams: cleaner initialization
cppcheck warned about the non-portable initialization of a float
via memset. It is okay on all current architectures, but better
assign a real float 0 value anyway, while keeping the memset for
the rest of the elements.

The second memset() had already become redundant when adding the
PullParams constructor.
2015-03-03 10:14:19 +01:00
Patrick Ohly 08ba09df04 shutdown: fix memory allocation deadlock
When the SuspendFlags::handleSignal() signal handler got called while
the program was allocating memory in libc, a deadlock occurred when
the mutex locking code in RecMutex::lock() tried to allocate the guard
instance (see backtrace below).

This could be fixed with new mutex code which gives up the guard
concept, a guard concept using C11 mechanisms (copy semantic of a
stack-allocated guard) or not locking at all in getSuspendFlags().

This commit uses the latter. It is simpler and can still be done
correctly because locking is not necessary except when the singleton
has not been allocated yet. That part gets moved into the process
startup phase via SyncContext::initMain().

Thread 1 (Thread 0x7fec389e6840 (LWP 16592)):
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
   from /lib/x86_64-linux-gnu/libc.so.6
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    d=<optimized out>, p=0x7fec38196f60 <SyncEvo::suspendRecMutex>,
    this=<synthetic pointer>)
    at /usr/include/boost/smart_ptr/detail/shared_count.hpp:167
    p=0x7fec38196f60 <SyncEvo::suspendRecMutex>, this=<synthetic pointer>)
    at /usr/include/boost/smart_ptr/shared_ptr.hpp:363
    this=<synthetic pointer>)
    at /data/runtests/work/sources/syncevolution/src/syncevo/ThreadSupport.h:60
    at /data/runtests/work/sources/syncevolution/src/syncevo/ThreadSupport.h:81
    at /data/runtests/work/sources/syncevolution/src/syncevo/SuspendFlags.cpp:58
    at /data/runtests/work/sources/syncevolution/src/syncevo/SuspendFlags.cpp:280
    oldp=0x115b7d0, oldsize=80, nb=48) at malloc.c:4208
    at malloc.c:3029
    n_bytes=n_bytes@entry=32)
2015-03-03 10:14:19 +01:00
Patrick Ohly c61db46f8d syncevolution.org binaries: allow libical1a
Because of the confustion around the libical 1.0 ABI, Debian ended
up renaming the package for Debian Jessie while keeping the libical.so.1
soname. Pre-built binaries from older distros work, so just adapt
the package meta data.
2015-03-03 10:14:19 +01:00
Patrick Ohly 112c932432 glib: fix TrackGLib::ref()
The class is used for non-GObject types, so we must use a
type-specific method to increase the
ref-count. intrusive_ptr_add_ref() does that automatically for us.
Calling g_object_ref() was a cut-and-paste error.
2015-02-09 15:02:22 +01:00
Tino Mettler 89dbb2d223 Use TLS instead of SSLv3
This fixes a potential security risk and connection problems with clients
that don't support SSLv3 anymore.

Closes: #772040
2014-12-12 08:45:24 +01:00
Patrick Ohly 0511cb1dcf GDBus GIO: fix compilation on s390 32bit, II (Fedora Bug #1163188)
The previous commit for the problem caused a compilation error
in the PBAP backend, because Bluez uses a 64 bit type that no longer
had a type trait on 32 bit architectures.

Adding "[unsigned] long long" traits fixes that. It seems to work
also on 64 bit architectures, so I am not adding any ifdefs and just
enable it unconditionally.
2014-12-11 23:29:26 -08:00
Tino Mettler 8de548f123 1.4.99.4-3 package 2014-12-04 22:46:12 +01:00
Tino Mettler 2dc7a0ba47 Merge tag 'patches/1.4.99.4-3'
patches for 1.4.99.4-3
2014-12-04 22:44:33 +01:00
Tino Mettler 7d28023144 Use TLS instead of SSLv3 in SyncML server script
This fixes a potential security risk. It also avoids connection problems
with clients that don't support SSLv3 anymore, like the syncevolution SyncML
client itself.

Closes: #772040
2014-12-04 22:43:32 +01:00
Tino Mettler 8e9e1841aa 1.4.99.4-2 package 2014-12-04 22:40:35 +01:00
Patrick Ohly f4d91d4cef GDBus GIO: fix compilation on s390 32bit (Fedora Bug #1163188)
size_t is defined as unsigned long on s390 in 32bit mode, which is is not the
same type as uin32_t = unsigned int, which caused a compile failure due to the
missing type trait.

The solution is to define traits for all the standard language types instead
of the fixed-size types. This removes the 64 bit types on 32 bit platforms but
adds the types that were missing on s390.

All the types that we use in the D-Bus bindings are among these standard
types, so that is okay.
2014-11-17 23:33:41 -08:00
Patrick Ohly 97b2051c2d autotools, NEWS: SyncEvolution 1.5 2014-10-31 13:22:05 +01:00
Patrick Ohly 5e0680a448 signon: fix HashTable2Variant() ref counting (TC-1667)
This fixes a crash/memory corruption issue in the plain signon backend
as used in Tizen.

The real bug was that HashTable2Variant() creates a GHashTableCXX by
stealing a floating GVariant without actually acquiring the reference,
leading to various glib errors caused by double free and/or invalid
memory access.

The code in signon.cpp receiving the GHashTableCXX was correct, albeit
overly complicated (creating a new reference via g_variant_ref_sink()
explicitly instead of relying on GHashTableCXX semantic).
2014-10-31 13:22:04 +01:00
Patrick Ohly 37bd43cc20 autotools: bump libsynthesis requirement
We need a libsynthesis with RELAXEDCOMPARE().
2014-10-30 21:49:51 +01:00
Tino Mettler 7610b4d1f0 Merge tag 'patches/1.4.99.4-2'
Patches for 1.4.99.4-2
2014-10-26 14:09:51 +01:00
Tino Mettler 0a4e4b6575 Fix FTBFS on kfreebsd due to missing SOCK_CLOEXEC
Work around missing SOCK_CLOEXEC on kfreebsd by setting FD_CLOEXEC
afterwards.
2014-10-26 13:47:05 +01:00
Tino Mettler eed22f7ead 1.4.99.4-1 package 2014-10-25 22:34:46 +02:00
Tino Mettler f095ec0853 syncaddressbook.so vanished, as iOS addressbook support was removed
Upstream didn't support it anymore, so it was removed.
2014-10-25 22:19:15 +02:00
Tino Mettler f0a010bcf5 Build-depend on libsynthesis 3.4.0.47.4 2014-10-25 22:00:52 +02:00
Tino Mettler 87d467fcae New upstream release candidate 2014-10-25 21:34:52 +02:00
Tino Mettler 9f8d2a372b Merge branch 'patch-queue/upstream' 2014-10-25 21:33:41 +02:00
Patrick Ohly 0f41165500 sync: ignore unnecessary username property
A local sync or Bluetooth sync do not need the 'username' property.
When it is set despite that, issue a warning.

Previously, the value was checked even when not needed, which
caused such syncs to fail when set to something other than a plain
username.
2014-10-24 16:42:34 +02:00
Patrick Ohly f3e1e10916 wrappercheck: augment output of daemon with time stamps
Useful for correlating events in the daemon with events in testing.
We need to use a process group to deliver SIGINT/SIGTERM, otherwise
we cannot be sure that we catch all processes created by the daemon.

The return code of the daemon was not checked before (accidentally?!)
and this patch does not change that. Might be fixed in the future.
2014-10-24 07:13:33 -07:00
Patrick Ohly 7a046c1998 wrappercheck: fix repeated daemon startup
The daemon log gets reused when starting daemons multiple times.
When starting a second time, the simple grep used to find the
output of the previous and did not wait properly. We need to count
matching lines and continue once a new one appears.
2014-10-24 07:06:38 -07:00
Patrick Ohly 3d2b8841ea wrappercheck: augment output
Multiple different wrappercheck instances are running concurrently
in the nightly testing, so better include a prefix with unique PID
in the "set -x" output to identify where it came from.
2014-10-24 07:04:49 -07:00
Patrick Ohly 18d301b37c wrappercheck: configurable sleep after daemon launch
When output checking isn't possible, allow sleeping for a configurable
amount of time.
2014-10-24 07:02:17 -07:00
Patrick Ohly c2dd6033ed D-Bus server: fix unreliable shutdown handling
Occassionally, syncevo-dbus-server locked up after receiving
a CTRL-C. This primarily affected nightly testing, in particular (?)
on Ubuntu Lucid.

The reason was two-fold:
- indirectly allocating memory when getSuspendFlags() had to
  allocated the guard instance of the mutex
- glib mutex held by some other thread when trying to do
  g_main_loop_quit().

SuspendFlags already handles signals without these problems. So
instead of overriding that, let SuspendFlags signal the receival
of a signal by writing to its FD and monitor that in our main
event loop, then quit the main event loop from inside the main
thread itself.
2014-10-24 05:25:04 -07:00
Patrick Ohly efedc4d4f1 glib: add GIOChannelCXX
Will be needed by D-Bus server when watching SuspendFlags FD.
2014-10-24 05:21:21 -07:00
Patrick Ohly 5668542116 testing: include stack backtrace when killing stuck process
The issue with malloc being called in niam() in syncevo-dbus-server
and deadlocking was only found after adding gdb's output of the
syncevo-dbus-server stack backtrace.
2014-10-10 03:19:45 -07:00
Patrick Ohly 9f04119d32 testing: ignore some minor leaks 2014-10-10 03:19:45 -07:00
Patrick Ohly bce3ebdbf9 testing: Google testcases must work with and without libphonenumber support in EDS
"primary 80" ends up being recognized as phone number, adding the E.164
parameter if (and only if) EDS was compiled with libphonenumber support
(Debian Jessie!). Adding that breaks the comparison, so avoid the situation
by updating to a string which is not a phone number.
2014-10-10 03:19:44 -07:00
Patrick Ohly 86ef9e515f testing: ignore valid Akonadi vCard changes
Manipulating GEO and not storing X-EVOLUTION-UI-SLOT parameters
are acceptable changes, ignore them when testing.
2014-10-10 03:19:44 -07:00
Patrick Ohly 652c096cd3 testing: ignore Akonadi encodig issues
Akonadi uses different quoting for special characters. Probably would have to
be looked into and reported, but for now ignore it by not testing these
special cases.
2014-10-10 03:19:44 -07:00
Patrick Ohly 44c52bc9c6 testing: ignore Akonadi Client::Sync::file_event::testAddBothSides failures
When syncing Akonadi with file source, neither side recognizes duplicates
based on UID/RECURRENCE-ID. Should be added to Akonadi source. For now ignore
it.
2014-10-10 03:19:44 -07:00
Patrick Ohly 3f5e25ac31 testing: ignore Memotoo eds_memo update failures
Memotoo randomly decides to send back an unmodified iCalendar 2.0 memo.
This does not hurt, so don't check the exact sync result when testing
Memotoo.
2014-10-10 03:19:35 -07:00
Patrick Ohly d50e61db85 testing: give valgrind more time in SyncTests::testTimeout() 2014-10-10 03:19:31 -07:00
Patrick Ohly 470c3490e6 PIM testing: allow testSync to run longer udner valgrind 2014-10-10 03:19:29 -07:00
Patrick Ohly 50148ab580 scripting: prevent premature loop timeouts
The more complex "avoid data loss during merging" scripting ran for longer
than 5s limit under extreme conditions (full logging, busy system, running
under valgrind), which resulted in aborting the script and a 10500 "local
internal error" sync failure.

The endless loop prevention should only be necessary to detect programming
mistakes, so better disable it entirely.
2014-10-10 03:19:27 -07:00
Patrick Ohly b99e3bea06 testing: run one test per client-test instance
When client-test starts, it determines all tests that would get
run, then runs all of them one-by-one in new instances. A single
test gets run directly.

The output changes slightly: the CppUnit summary with number of
failures or errors is no longer available and there are additional
blank lines between tests.

The advantage is that each single test is properly isolated from the
other, which is closer to how real syncs run. It also helps when
running under valgrind, because a leak can be attributed exactly to
one test and because it avoids permanently growing memory consumption
in long-running client-test runs (seen in the nightly testing even
when there were no leaks, perhaps because of memory fragmentation).

A potential downside of this change is that unexpected and undesirable
side effects of modules might no longer show up in testing, only when
combining them in real syncs. This should still be covered by
Client::Sync tests involving multiple modules.
2014-10-10 03:17:47 -07:00
Patrick Ohly ba75dac798 PIM: always install examples
The PIM example Python scripts are useful also when testing is not
enabled; previously, they were not distributed at all.
2014-10-10 01:55:42 -07:00
Patrick Ohly a6061cd1d3 PIM: make examples work with recent Python GNOME
Try the traditional "import gobject" first, fall back to GIR
introspection. Needed for distros like Tizen.
2014-10-10 01:55:42 -07:00
Patrick Ohly 7f678583a9 signon: fix providersignon.so
The shared providersignon.so ended up being compiled with "gsso" as
prefix for the username. We need to check that this really works by also
testing for USE_ACCOUNTS.
2014-10-10 01:55:41 -07:00
Patrick Ohly 83d9d96be5 PIM testing: use file source similar to PBAP (part of FDO #84710)
Bug #84710 was not found by the automated testing because the file
source still sent re-encoded items. Switching it to raw items
triggered the bug and now helps to avoid regressions in the modified
merge script.
2014-10-09 21:32:03 +02:00
Patrick Ohly 2e2c9dca77 vcard: fix caching of PBAP contacts (FDO #84710)
After changing PBAP to send raw items, caching them led to unnecessary
disk writes and bogus "contacts changed" reports. That's because
the merge script relied on the exact order of properties, which was
only the same when doing the redundant decode/encode on the PBAP side.

Instead of reverting back to sending re-encoded items, better enhance
the contact merge script such that it detects contacts as unchanged
when just the order of entries in the property arrays is different.
This relies on an enhanced libsynthesis with the new RELAXEDCOMPARE()
and modified MERGEFIELDS().
2014-10-09 21:31:31 +02:00
Patrick Ohly 936ccc5df2 vcard: remove duplicate loops
Due to cut-and-paste, some arrays were checked multiple times. Only
caused unnecessary overhead.
2014-10-09 21:26:02 +02:00