Bug 39183 - dbus/account-channel-request test fails consistently on Ubuntu/oneiric
Summary: dbus/account-channel-request test fails consistently on Ubuntu/oneiric
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium normal
Assignee: Simon McVittie
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2011-07-13 00:50 UTC by Adam Conrad
Modified: 2011-07-18 06:35 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Link a second static library for libtp-glib-tests, against libtelepathy-glib-internal.la (4.21 KB, patch)
2011-07-18 03:45 UTC, Simon McVittie
Details | Splinter Review

Description Adam Conrad 2011-07-13 00:50:23 UTC
With the latest tp-glib, unmodified from the Debian packaging except for an unrelated timeout extension for another test, the account-channel-request test fails consistently on all Ubuntu arches with the following:

/account-channels/request-handle/create-success: 
GLib-GObject-WARNING **: cannot register existing type `TpDBusDaemon'
Trace/breakpoint trap
FAIL: test-account-channel-request

Reproducible locally as well, so not a launchpad or buildd-specific issue, but clearly Ubuntu-related (perhaps because we're shipping a newer DBus?), as this failure didn't occur in Debian/unstable.
Comment 1 Adam Conrad 2011-07-13 00:51:26 UTC
Build logs can be found at:

https://launchpad.net/ubuntu/+source/telepathy-glib/0.15.4-1ubuntu1
Comment 2 Guillaume Desmottes 2011-07-14 06:24:39 UTC
Interesting bits:

/account-channels/request-handle/create-success: 
GLib-GObject-WARNING **: cannot register existing type `TpDBusDaemon'
aborting...
Aborted

That's weird, it works fine for me here on Natty.
Comment 3 Simon McVittie 2011-07-14 06:41:01 UTC
libtool: link: gcc -std=gnu99 -Wall -Wextra -Wdeclaration-after-statement -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wsign-compare -Wnested-externs -Wpointer-arith -Wformat-security -Winit-self -Wno-missing-field-initializers -Wno-unused-parameter -g -O2 -Wl,-Bsymbolic-functions -Wl,-O1 -o .libs/test-account-channel-request account-channel-request.o -pthread -pthread  ../../tests/lib/.libs/libtp-glib-tests.a /build/buildd/telepathy-glib-0.15.4/telepathy-glib/.libs/libtelepathy-glib.so ../../telepathy-glib/.libs/libtelepathy-glib-internal.a -ldbus-glib-1 -ldbus-1 -lpthread /usr/lib/x86_64-linux-gnu/libgio-2.0.so /usr/lib/x86_64-linux-gnu/libgobject-2.0.so /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so /usr/lib/x86_64-linux-gnu/libgthread-2.0.so -lrt /usr/lib/x86_64-linux-gnu/libglib-2.0.so -pthread

Notice that account-channel-request is being linked against the shared libtelepathy-glib.la, and also the static libtelepathy-glib-internal.la with the same contents. So yes, you really do have two TpDBusDaemon types, with different addresses - kaboom.

If it's possible to avoid having any tests that link both libtelepathy-glib-internal.la (to access _tp symbols) and libtp-glib-tests.la (to access miscellaneous test goo), that would be a good solution.

If not, then libtp-glib-tests.la will have to become an incomplete library, which requires anything linking libtp-glib-tests.la to also link either libtelepathy-glib-internal.la or libtelepathy-glib.la. This makes me a bit sad, 

This might be an Ubuntu-specific problem because Ubuntu's build environment seems to be using -Wl,-Bsymbolic-functions by default?
Comment 4 Guillaume Desmottes 2011-07-14 06:58:03 UTC
I think you're right, this test wasn't linking on those before:
http://cgit.freedesktop.org/telepathy/telepathy-glib/diff/tests/dbus/Makefile.am?id=ed21d5b431b6e8fa3ba78b0f638653fc13b4c5ac
Comment 5 Guillaume Desmottes 2011-07-14 07:27:00 UTC
(In reply to comment #3)
> If it's possible to avoid having any tests that link both
> libtelepathy-glib-internal.la (to access _tp symbols) and libtp-glib-tests.la
> (to access miscellaneous test goo), that would be a good solution.

Not really here. We do need both in this test.
Comment 6 Simon McVittie 2011-07-18 03:44:27 UTC
I've been able to reproduce this failure on Debian by using -Bsymbolic. Patch to follow.
Comment 7 Simon McVittie 2011-07-18 03:45:06 UTC
Created attachment 49243 [details] [review]
Link a second static library for libtp-glib-tests, against libtelepathy-glib-internal.la

Linking with -Bsymbolic (as done by default on recent Ubuntu) ends up
linking different parts of the executable against the copy of
libtelepathy-glib-internal in the shared library, and the copy in the
static library. This leads to mysterious GLib assertion failures.

Tests that need to access internal symbols (and thus link against
libtelepathy-glib-internal.la) must now use libtp-glib-tests-internal.la
instead of libtp-glib-tests.la.

There's currently no difference between the two except their dependencies,
but in principle, we could add test glue that also requires internal
symbols to libtp-glib-tests-internal while avoiding including it in
libtp-glib-tests.
Comment 8 Will Thompson 2011-07-18 06:06:35 UTC
Review of attachment 49243 [details] [review]:

Ugh. It kind of offends me that tests need internal symbols … but I guess it offends you too ;)

This change looks fine, ship it.
Comment 9 Simon McVittie 2011-07-18 06:35:18 UTC
(In reply to comment #8)
> Ugh. It kind of offends me that tests need internal symbols … but I guess it
> offends you too ;)

In the cases I'm aware of where they're using internal symbols, it offends me less than it would if the shared library exposed the same things :-)

> This change looks fine, ship it.

Shipped it, only to master for the moment (it should be easy to backport if anyone wants it).


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.