Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

PSA: `dbus::ExportedObject` will CHECK crash if ResponseSender does not run

61 views
Skip to first unread message

Xiyuan Xia

unread,
Mar 6, 2025, 11:20:52 AMMar 6
to chromium-dev, Chromium OS dev, Achuith Bhandarkar, Ryo Hashimoto, oshima

If you don't use `dbus::ExportedObject` to implement DBus service, you can stop reading.


When implementing exported DBus methods via `dbus::ExportedObject`, a common error is to forget to run `ResponeSender`. When that happens, the pending reply state in dbus-daemon would not be cleared. In addition to wasting memory, there is also a per DBusConnection `max_replies_per_connection` limit. When the number of pending replies goes beyond that limit, no new calls are allowed for that DBusConnection.


This is especially important for ChromeOS where DBus plays a critical role. For example, if ash chrome has a bad DBusConnection, it would not be able to authenticate users (i.e. unable to do offline login or unlock the device). 


To mitigate this, https://crrev.com/c/6325811 adds a new CHECK to enforce `ResponseSender` being invoked. Methods that forget to run `ResponseSender` will get a crash after the CL lands.


More details can be found in this one pager.

Thanks
Xiyuan
Reply all
Reply to author
Forward
0 new messages