Products › lamco-dbus-tools › Docs

What a D-Bus monitor can't see: The toolkit's limits

What a D-Bus monitor can't see: Time in the bus against time in the service, a caller that gave up, private connections, and the other limits it states.

Describes version 0.4.1. The README lists every command and what it does.

A diagnostic tool is only as trustworthy as its account of its own limits. These are the toolkit's.

Time inside the bus against time inside the service

A monitor sees the bus pass on a call and pass on the reply. What happened between, in the bus's queue or in the service, is one interval. Only stamps taken in the kernel at each socket can split it, and the kernel part does: dbuskeep kernel with dbussee record --kernel and dbustell timing --split (the kernel part). Without it, the interval stays one. With it, a header split across two buffers of one write is skipped and counted, and a reader that takes a header in pieces reads its reply serial as 0, so an answer is joined to its call by the writing side's stamp.

A caller that gave up

Each program has its own time limit for a call, commonly 25 seconds, and enforces it locally. Nothing is sent when it expires. A call the toolkit lists as pending may have been abandoned long ago, and a reply that arrives later looks like any other. The output says this wherever pending calls are listed.

Why one call caused another

"B sent a call while A's call to B was outstanding" is what a recording shows. That B's call was made because of A's is likely, and isn't proven by the recording.

Inside a sandbox, from outside

A Flatpak application reaches the bus through a filtering proxy. From the host, the application's traffic is the proxy's connection. Calls the proxy hid or refused never reach the bus as themselves: On dbus-broker a stand-in message shows that something was hidden, and on dbus-daemon nothing shows. To see what the application sees, the tool has to run inside the sandbox, which the static build allows.

Connections that bypass the bus

Two programs can speak D-Bus to each other directly over a private socket. No monitor on any bus sees it, and neither does the kernel part, which reports only on the sockets of the buses it was told of. To see one program's own traffic, dbusdo relay runs it behind a recording relay.

Before the recording started

A stall has usually passed by the time anyone starts recording. The rolling record exists for this: It keeps the last minutes and writes them when asked, or when a condition it was given is met. dbuskeep keeps it all the time, so a recording can start from what happened before it was asked for. Nothing older than its window is kept anywhere.

A rule's destination, on dbus-broker

dbus-broker never applies the destination of a monitor's match rule, so a recording of one service through the bus takes every message on it. The recorder says so, and the capture carries BUS-004. Through dbuskeep, --rules-as-specified applies the rule as the specification reads it. Match rules lists the four places the two buses read rules differently.

Which service file was chosen, and which rule matched

Neither bus implementation says which of several service files it used for a name, or which policy rule decided a message. The toolkit works both out from the files by the daemons' own rules, checks its working against the real daemons, and says when a case is outside what it has checked.

Which permission a method asks for

A service decides in its own code which permission action to check for which method. Nothing declares the link. The audit lists the actions that exist around a service and doesn't claim to know which method uses which.

The system bus without privilege

Monitoring a system bus needs root, or on dbus-daemon a policy that grants it. On dbus-broker nothing in between exists. The toolkit keeps the privileged part to one small helper.

Varlink

New system services increasingly use Varlink beside or instead of D-Bus. The toolkit doesn't read it. systemd's own tools do.