Products › lamco-dbus-tools › Interfaces

org.freedesktop.DBus.Introspectable: Introspection XML and drift

org.freedesktop.DBus.Introspectable returns a service's D-Bus introspection XML, which lamco-dbus-tools reads without starting it and checks for breaks.

D-Bus interface org.freedesktop.DBus.Introspectable

org.freedesktop.DBus.Introspectable is the standard interface that lets anyone ask an object what it offers. Its one method, Introspect, returns an XML description of the object's interfaces, methods, signals and properties, and the objects below it. Code generators read that XML, so do graphical message viewers and busctl introspect, and many projects keep a copy of it in their source tree as the interface's contract. lamco-dbus-tools reads a running service's tree without starting it, and compares two descriptions to say which changes break an old client.

What it is

The specification defines one method, Introspect, with no arguments and one STRING out: The XML. The document lists:

  • <interface> elements, each with <method>, <signal> and <property> children.
  • <arg> elements, each with a type signature, a direction of in or out for methods, and an optional name.
  • A property's type and access: read, write or readwrite.
  • <annotation> elements, such as org.freedesktop.DBus.Property.EmitsChangedSignal, org.freedesktop.DBus.Method.NoReply and org.freedesktop.DBus.Deprecated.
  • <node> children naming the objects below, which is how a whole tree is walked, one Introspect at each path.

A service answers for itself. The bus answers for /org/freedesktop/DBus. A call to a service that isn't running starts it, unless the caller sets the flag that forbids starting a service. That's why reading a service's interfaces can change the machine without anyone meaning to.

Three things the XML can't say: Whether a method's behavior changed while its signature stayed the same, an interface the service adds after it was read, and a well-known name that moved to another program.

Errors you'll meet

  • org.freedesktop.DBus.Error.InvalidArgs: A call's arguments don't match the signature the service expects. After a changed signature, GLib prints, as recorded: Error: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: Type of message, “(s)”, does not match expected type “(su)”.
  • org.freedesktop.DBus.Error.UnknownMethod: The object has no such method, for example one removed in a new version.

How lamco-dbus-tools reads it

dbussee introspect calls Introspect at each object, from --path down through the children each names, with the flag that forbids starting a service. A service that isn't running is left so, and the command exits 1. It prints each object with its interfaces and counts, and the capture holds them whole. dbusdo has no command of its own here. dbustell drift compares two descriptions, each an XML file or a capture, and sorts every change as breaking, for new clients only, or information. It exits 1 on a break, and --junit writes a report for CI. The four standard interfaces every library adds, Introspectable itself among them, are left out.

dbussee introspect org.freedesktop.login1 --bus system --out login1.json   # the running tree, nothing started
dbustell drift interfaces/com.example.Catalog.xml live.json                 # the kept XML against what runs
dbustell drift before.json after.json --objects --junit drift.xml           # objects too, as a JUnit report

Where it has been run

The README's run record lists interface drift of systemd's services across releases, systemd 257 on Debian 13 to 262 on Fedora 45: hostname1, timedate1, locale1 and login1, 14 changes, none breaking, the same 14 an independent reading found, on 2026-11-30. The use case "A client broken by a changed signature" was run from its own recording, among the use cases run between 2026-11-30 and 2026-12-02.

Findings

  • DRIFT-001: An interface was removed.
  • DRIFT-002: A method was removed.
  • DRIFT-003: A signal was removed.
  • DRIFT-005: A method's or signal's arguments changed.
  • DRIFT-008: Whether a method replies changed.
  • DRIFT-010: An object was removed.
  • DRIFT-011: Added or widened: Old clients are unaffected, new ones need the new version.
  • DRIFT-012: Renamed, deprecated or annotated: Nothing on the wire changed.

Related