Bug 29884 - Error handling improvements
Summary: Error handling improvements
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: GLib (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Simon McVittie
QA Contact: John (J5) Palmieri
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2010-08-30 04:00 UTC by Kristian Rietveld
Modified: 2011-06-16 10:16 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Watch server_set_data failure in dbus__server_setup_with_g_main (825 bytes, patch)
2010-08-30 04:01 UTC, Kristian Rietveld
Details | Splinter Review
Assert that marshalling in dbus_g_method_return succeeded (1.06 KB, patch)
2010-08-30 04:01 UTC, Kristian Rietveld
Details | Splinter Review
Verify call in dbus glib test (778 bytes, patch)
2010-08-30 04:02 UTC, Kristian Rietveld
Details | Splinter Review
Show warning if marshalling in dbus_g_method_return fails (896 bytes, patch)
2010-12-13 10:12 UTC, Christian Dywan
Details | Splinter Review
Verify Increment call in dbus-glib-test (513 bytes, patch)
2010-12-13 10:14 UTC, Christian Dywan
Details | Splinter Review
Get member name from the method call message, not the reply, for warnings (990 bytes, patch)
2011-01-04 07:30 UTC, Simon McVittie
Details | Splinter Review

Description Kristian Rietveld 2010-08-30 04:00:22 UTC
Patches courtesy of Christian Dywan (on CC).  The patches should
apply cleanly to git master (tested).
Comment 1 Kristian Rietveld 2010-08-30 04:01:16 UTC
Created attachment 38288 [details] [review]
Watch server_set_data failure in dbus__server_setup_with_g_main
Comment 2 Kristian Rietveld 2010-08-30 04:01:43 UTC
Created attachment 38289 [details] [review]
Assert that marshalling in dbus_g_method_return succeeded
Comment 3 Kristian Rietveld 2010-08-30 04:02:01 UTC
Created attachment 38290 [details] [review]
Verify call in dbus glib test
Comment 4 Will Thompson 2010-10-05 07:13:56 UTC
Review of attachment 38289 [details] [review]:

::: dbus/dbus-gobject.c
@@ +2713,3 @@
 	}
+      marshalled = _dbus_gvalue_marshal (&iter, &value);
+      g_assert (marshalled);

Maybe the call to _dbus_gvalue_marshal() should be in an else block; and we should have a g_critical() with some context rather than an assertion? c.f. emit_signal_for_registration()
Comment 5 Will Thompson 2010-10-05 07:13:59 UTC
Review of attachment 38289 [details] [review]:

::: dbus/dbus-gobject.c
@@ +2713,3 @@
 	}
+      marshalled = _dbus_gvalue_marshal (&iter, &value);
+      g_assert (marshalled);

Maybe the call to _dbus_gvalue_marshal() should be in an else block; and we should have a g_critical() with some context rather than an assertion? c.f. emit_signal_for_registration()
Comment 6 Will Thompson 2010-10-05 07:21:11 UTC
The other two patches look good.
Comment 7 Christian Dywan 2010-12-13 10:12:49 UTC
Created attachment 41068 [details] [review]
Show warning if marshalling in dbus_g_method_return fails

Updated patch for dbus_g_method_return, so it warns instead of asserting.
Comment 8 Christian Dywan 2010-12-13 10:14:57 UTC
Created attachment 41069 [details] [review]
Verify Increment call in dbus-glib-test

This patch actually uses 'lose' as used elsewhere in the test, instead of assert.
Comment 9 Simon McVittie 2011-01-04 06:15:51 UTC
Review of attachment 41069 [details] [review]:

Looks fine, r+ from me.
Comment 10 Simon McVittie 2011-01-04 06:16:19 UTC
Review of attachment 38288 [details] [review]:

Looks fine. r+ from wjt already, r+ from me too.
Comment 11 Simon McVittie 2011-01-04 06:20:31 UTC
Review of attachment 41068 [details] [review]:

::: dbus/dbus-gobject.c
@@ +2950,3 @@
+          if (!_dbus_gvalue_marshal (&iter, &value))
+            g_warning ("failed to marshal parameter %d for method %s",
+                       i, dbus_message_get_member (reply));

Looks good in principle, but replies don't have a member name. I think you want dbus_message_get_member (context->message), or just context->method.
Comment 12 Simon McVittie 2011-01-04 07:30:46 UTC
Created attachment 41622 [details] [review]
Get member name from the method call message, not the reply, for warnings

Attachment 41069 [details] and Attachment 38288 [details] pushed to master. I attach a patch to fix the warning for Attachment 41068 [details], to be applied after that one.
Comment 13 Simon McVittie 2011-06-16 10:16:05 UTC
Fixed in git for 0.96, based on IRC review from Cosimo Alfarano and no veto from reviewers.


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.