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 632544 - g_dbus_connection_send_message can not send a locked message with G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag
g_dbus_connection_send_message can not send a locked message with G_DBUS_SEN...
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gdbus
2.26.x
Other Linux
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-10-19 11:57 UTC by Peng Huang
Modified: 2010-12-13 18:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case for g_dbus_connection_send_message (1.96 KB, patch)
2010-10-19 11:57 UTC, Peng Huang
none Details | Review
Update the test case (1.99 KB, patch)
2010-10-20 00:57 UTC, Peng Huang
none Details | Review
Patch for fixing this problem (563 bytes, patch)
2010-10-20 01:03 UTC, Peng Huang
none Details | Review

Description Peng Huang 2010-10-19 11:57:02 UTC
Created attachment 172704 [details] [review]
Test case for g_dbus_connection_send_message

As description of API document. g_dbus_connection_send_message should support sending locked message with G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag. But it cannot.

The document is here:

http://library.gnome.org/devel/gio/stable/GDBusConnection.html#g-dbus-connection-send-message

Note that message must be unlocked, unless flags contain the G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.

Test case is in the attached patch
Comment 1 Colin Walters 2010-10-19 19:44:18 UTC
Review of attachment 172704 [details] [review]:

::: gio/tests/gdbus-connection.c
@@ +889,3 @@
+
+  while (data.num_handled == 2)
+

This looks like it's missing the g_thread_yield().  But (to davidz) as we discussed on IRC this is broken since there's no memory barrier.  You could lock/unlock a mutex around this check, or better use a condition variable.
Comment 2 Peng Huang 2010-10-20 00:57:29 UTC
Created attachment 172784 [details] [review]
Update the test case

Add g_thread_yield ().
Comment 3 Peng Huang 2010-10-20 01:03:02 UTC
Created attachment 172785 [details] [review]
Patch for fixing this problem
Comment 4 Peng Huang 2010-10-27 07:36:52 UTC
ping
Comment 5 Peng Huang 2010-11-16 05:22:49 UTC
Anyone can help to check this bug?
Comment 6 David Zeuthen (not reading bugmail) 2010-12-13 18:14:02 UTC
Sorry for the delay. Committed on master and glib-2-26. Thanks!

http://git.gnome.org/browse/glib/commit/?id=735fcf918e70035874b50785524d25eda557d51f

http://git.gnome.org/browse/glib/commit/?h=glib-2-26&id=62476cd0f7ca7d3becf81243fb7ac1b97cf7db51