After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 667774 - telepathy-glib unit test fails since glib 2.31.x
telepathy-glib unit test fails since glib 2.31.x
Status: RESOLVED NOTGNOME
Product: glib
Classification: Platform
Component: gio
2.31.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-01-12 14:08 UTC by Xavier Claessens
Modified: 2012-01-13 09:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Xavier Claessens 2012-01-12 14:08:17 UTC
I have glib 2.31.8 and a unit test of telepathy-glib (stream-tube) fails. That unit test is working fine with glib 2.30.x and was still working fine with previous glib 2.31.x version (I'm not sure which version it regressed).

The problem is a g_socket_client_connect_async() call that never finish and then the unit test timeout.

The test code:
http://cgit.freedesktop.org/telepathy/telepathy-glib/tree/tests/dbus/stream-tube.c#n805
Comment 1 Xavier Claessens 2012-01-12 14:24:59 UTC
Backtrace of where it is stuck:

  • #0 __GI___poll
    at ../sysdeps/unix/sysv/linux/poll.c line 87
  • #1 g_socket_condition_wait
    at /build/buildd/glib2.0-2.31.8/./gio/gsocket.c line 2840
  • #2 g_socket_condition_wait
    at /build/buildd/glib2.0-2.31.8/./gio/gsocket.c line 2750
  • #3 g_socket_receive_message
    at /build/buildd/glib2.0-2.31.8/./gio/gsocket.c line 3341
  • #4 _tp_unix_connection_receive_credentials_with_byte
    at gnio-util.c line 463
  • #5 tp_unix_connection_receive_credentials_with_byte
    at gnio-util.c line 570
  • #6 service_incoming_cb
    at stream-tube-channel.c line 1287
  • #7 ffi_call_unix64
    from /usr/lib/x86_64-linux-gnu/libffi.so.6
  • #8 ffi_call
    from /usr/lib/x86_64-linux-gnu/libffi.so.6
  • #9 g_cclosure_marshal_generic
    at /build/buildd/glib2.0-2.31.8/./gobject/gclosure.c line 1189
  • #10 g_closure_invoke
    at /build/buildd/glib2.0-2.31.8/./gobject/gclosure.c line 774
  • #11 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.31.8/./gobject/gsignal.c line 3302
  • #12 g_signal_emit_valist
    at /build/buildd/glib2.0-2.31.8/./gobject/gsignal.c line 3043
  • #13 g_signal_emit
    at /build/buildd/glib2.0-2.31.8/./gobject/gsignal.c line 3090
  • #14 g_socket_service_incoming
    at /build/buildd/glib2.0-2.31.8/./gio/gsocketservice.c line 236
  • #15 g_socket_service_ready
    at /build/buildd/glib2.0-2.31.8/./gio/gsocketservice.c line 299
  • #16 g_simple_async_result_complete
    at /build/buildd/glib2.0-2.31.8/./gio/gsimpleasyncresult.c line 744
  • #17 complete_in_idle_cb
    at /build/buildd/glib2.0-2.31.8/./gio/gsimpleasyncresult.c line 756
  • #18 g_main_dispatch
    at /build/buildd/glib2.0-2.31.8/./glib/gmain.c line 2513
  • #19 g_main_context_dispatch
    at /build/buildd/glib2.0-2.31.8/./glib/gmain.c line 3050
  • #20 g_main_context_iterate
    at /build/buildd/glib2.0-2.31.8/./glib/gmain.c line 3121
  • #21 g_main_context_iterate
    at /build/buildd/glib2.0-2.31.8/./glib/gmain.c line 3058
  • #22 g_main_loop_run
    at /build/buildd/glib2.0-2.31.8/./glib/gmain.c line 3315
  • #23 test_offer_race
    at stream-tube.c line 811
  • #24 test_case_run
    at /build/buildd/glib2.0-2.31.8/./glib/gtestutils.c line 1662
  • #25 g_test_run_suite_internal
    at /build/buildd/glib2.0-2.31.8/./glib/gtestutils.c line 1715
  • #26 g_test_run_suite_internal
    at /build/buildd/glib2.0-2.31.8/./glib/gtestutils.c line 1726
  • #27 g_test_run_suite_internal
    at /build/buildd/glib2.0-2.31.8/./glib/gtestutils.c line 1726
  • #28 g_test_run_suite_internal
    at /build/buildd/glib2.0-2.31.8/./glib/gtestutils.c line 1726
  • #29 g_test_run_suite_internal
    at /build/buildd/glib2.0-2.31.8/./glib/gtestutils.c line 1726
  • #30 g_test_run_suite_internal
    at /build/buildd/glib2.0-2.31.8/./glib/gtestutils.c line 1726
  • #31 g_test_run_suite
    at /build/buildd/glib2.0-2.31.8/./glib/gtestutils.c line 1771
  • #32 main
    at stream-tube.c line 1082

Comment 2 Dan Winship 2012-01-12 18:47:32 UTC
You are running the client and server in the same main loop, so once the socket connection succeeds at the kernel level, there is a race as to whether g_socket_client_connected_callback() on the client side or g_socket_service_ready() on the server side gets called first. If the client side runs first, then the test will work, but if the server side runs first, then it will end up in stream-tube-channel.c:service_incoming_cb() doing a blocking read and thus preventing the client side callback from ever running.

I guess this means you'll have to fix bug 629503, as suggested in service_incoming_cb(). :-)

(Or run the server in its own thread+context.)
Comment 3 Xavier Claessens 2012-01-12 20:17:11 UTC
Guillaume, you reported bug 629503, so you're probably the best to fix this :D
Comment 4 Guillaume Desmottes 2012-01-13 09:38:19 UTC
If I was about to fix it I would have done it since a while. :p
Comment 5 Xavier Claessens 2012-01-13 09:44:02 UTC
But now you have a motivation for that: our unit test fails !!