Updated patch
Tim Moloney
t.moloney at verizon.net
Mon Apr 17 12:50:11 PDT 2006
On Mon 2005-12-05 at 13:56:07 PST, Havoc Pennington wrote:
> On Mon, 2005-12-05 at 13:33 +0000, Matthew Johnson wrote:
>>
>> 8853: assertion failed "(*(const char*)_DBUS_FUNCTION_NAME) != '_'"
file "dbus-connection.c" line 2877 function
_dbus_connection_read_write_dispatch
>>
>> Which appears to enforce that _dbus_return_val_if_fail can only be
>> called from functions that don't start with an underscore. I have no
>> idea why this is, but have accordingly moved the calls to that into the
>> wrapper functions.
>
> The underscore functions are internal/private, and return_if_fail should
> only be used to check correctness of arguments to public API. For
> private API, just use dbus_assert() (and be sure public API that calls
> the private API has return_if_fail so we don't hit the assert when
> checks are enabled)
I found the above in the list archive.
If I understand it correctly, then the asserts are incorrect in
dbus_connection_read_write, dbus_connection_read_write_dispatch, and
_dbus_connection_read_write_dispatch. I've attached a patch that I
believe corrects the problem. I think this is what Matthew Johnson said
he did to get these functions working. This patch works on my FC5
system but should be tested more thoroughly.
On a related note, the FC5 spec file is producing code with the asserts
enabled although the spec file appears to be only enabling the asserts
for a 'make check' run. I mention this in case anyone here has
influence over the FC5 spec file (and can figure out why it's enabling
asserts).
Tim Moloney
-------------- next part --------------
--- dbus-0.61/dbus/dbus-connection.c.~1.116~ 2006-04-17 15:17:04.000000000 -0400
+++ dbus-0.61/dbus/dbus-connection.c 2006-04-17 15:19:20.000000000 -0400
@@ -2874,8 +2874,6 @@
DBusDispatchStatus dstatus;
dbus_bool_t dispatched_disconnected;
- _dbus_return_val_if_fail (connection != NULL, FALSE);
- _dbus_return_val_if_fail (timeout_milliseconds >= 0 || timeout_milliseconds == -1, FALSE);
dstatus = dbus_connection_get_dispatch_status (connection);
if (dispatch && dstatus == DBUS_DISPATCH_DATA_REMAINS)
@@ -2947,6 +2945,8 @@
dbus_connection_read_write_dispatch (DBusConnection *connection,
int timeout_milliseconds)
{
+ _dbus_return_val_if_fail (connection != NULL, FALSE);
+ _dbus_return_val_if_fail (timeout_milliseconds >= 0 || timeout_milliseconds == -1, FALSE);
return _dbus_connection_read_write_dispatch(connection, timeout_milliseconds, TRUE);
}
@@ -2970,6 +2970,8 @@
dbus_connection_read_write (DBusConnection *connection,
int timeout_milliseconds)
{
+ _dbus_return_val_if_fail (connection != NULL, FALSE);
+ _dbus_return_val_if_fail (timeout_milliseconds >= 0 || timeout_milliseconds == -1, FALSE);
return _dbus_connection_read_write_dispatch(connection, timeout_milliseconds, FALSE);
}
More information about the dbus
mailing list