All quiet on the dbus bus

Thiago Macieira thiago at kde.org
Mon Jan 11 05:43:12 PST 2010


Em Segunda-feira 11 Janeiro 2010, às 13:04:11, Simon Burton escreveu:
> On Mon, 11 Jan 2010 08:56:14 +0100
> 
> Thiago Macieira <thiago at kde.org> wrote:
> > Em Segunda-feira 11. Janeiro 2010, às 06.51.07, Simon Burton escreveu:
> > > I have my own select loop and put the unix_fd of the dbus connection in
> > > 
> > >  that. After a while (2 hours or so, at several messages per second)
> > > 
> > > my app stops getting any data back from the dbus-daemon, and
> > > the select loop goes into a spin.
> > 
> > What do you mean? There's nothing to be read from the socket?
> > 
> > Or the app stops writing?

Please answer these questions. You have found a symptom and you're trying to 
debug it, but I haven't understood the symptom yet. I don't think you're on 
the right track to debugging the issue in the first place.

> > > In the interests of debugging this I am considering taking over
> > > 
> > >  reading/writing the socket. I am using anonymous connections, but i
> > >  know nothing about the auth end of things. Maybe that will be too
> > >  hard to do manually.
> > > 
> > > How do I find out how much dbus data my application is
> > > sending/receiving ?
> > 
> > What for?
> 
> So i can answer your previous question, ie. debug my app.

There's no API for getting the amount of data being read or written.

If you need to know this, use a proxy socket or an external means of counting 
bytes on a socket (like via strace).

> > > It looks like dbus_message_marshal allocates some memory to store the
> > > 
> > >  marshal to. How do I free this memory ?
> > 
> > What for?
> 
> huh?

Why do you need to free the memory that dbus_message_unref caches?

Why do you think that's related to your issue?

> > The library caches DBusMessages that have been freed so that they can be
> > reused later. There's a way to disable this caching by modifying a
> > #define (I don't know which one) in the library and recompiling.
> > 
> > > Is there a way to specify where to marshal to ?
> > 
> > No. It marshals to memory. Where else would it marshal to?
> 
> Wtf ? What if i want to marshal into a buffer that i made ?

You can't.

DBusMessage allocates and manages its own memory. You can get the raw bytes 
from a DBusMessage if you want to, as well as set the raw bytes.

But the marshalling and demarshalling operations happen only on memory managed 
by DBusMessage.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freedesktop.org/archives/dbus/attachments/20100111/2a6ee881/attachment.pgp 


More information about the dbus mailing list