Disconnected on every attempt to reply

P. Durante shackan at gmail.com
Tue Aug 9 21:05:26 EST 2005


Hi again,

On 8/9/05, Havoc Pennington <hp at redhat.com> wrote:
> On Mon, 2005-08-08 at 19:44 +0200, P. Durante wrote:
> > 27141: Field 5 was invalid
> 
> Field 5 is the reply serial (see dbus-protocol.h)
> 
> > 27141: Failed to load header for new message code 16
> 
> and code 16 is DBUS_INVALID_BAD_SERIAL (see dbus-marshal-validate.h)

righty, I found out this myself tonight reversing the code :), what
about printing the actual symbol name instead of a cryptic '16' next
time ?

> 
> Sorry, the verbose output isn't very user-friendly ;-)
> 
> The only invalid serial is 0, so somehow we're getting that.
> 
> I see your source code is printing the serial on the client side - is it
> 0 at that point?
> 
> > 27141:   32     0x80b46b0: 0x05 0x01  'u' 0x00 BE: 83981568 LE: 7667973
> > 27141:   36     0x80b46b4: 0x00 0x00 0x00 0x00 BE: 0 LE: 0 u64:
> > 0x750105 dbl: 3.78848e-317
> 
> This looks like field code 5, length of signature 1, signature 'u', nul
> termination, uint32 value of 0.
> 
> dbus_message_new_method_return() should be setting the serial to
> whatever the serial of the method call was, so not sure what happened.
> 

I caught the problem yesterday, and I feel  sooo dumb right now,
basically, this was the constructor of the DBus::Message class

Message::Message( DBusMessage* m )
{
	_message = dbus_message_copy(m._message);
}

you will immediately spot that this resets the message serial to 0 (I
found this out only after re-reading the whole documentation :-( ) so,
when I created the reply with

ReturnMessage::ReturnMessage( const CallMessage& callee )
{
	_message = dbus_message_new_method_return(callee._message);
}

it ended up having (of course) a null serial !

now I've corrected with

Message::Message( DBusMessage* m )
{
	_message = m;
	ref();
}

just two crappy lines fixed the whole thing, sorry for bothering you
for such a stupid error,

thanks again,
Paul

> Havoc
> 
> 
>


More information about the dbus mailing list