system services' exit statuses are interpreted as if they were dbus-daemon-launch-helper exit statuses
@milanbv
Submitted by Milan Bouchet-Valat Assigned to D-Bus Maintainers
Description
If the process that should be started by D-Bus activation fails to start at a certain point of its initialization, out-of-memory error is returned instead of something more sensible.
I've observed this bug with the system-tools-backends. Modules are written in perl, and depending on the error, the message is different: if there's a compilation error, the message is "Cannot launch daemon, file not found or permissions invalid", which is fine. But if the error is about a missing perl dependency (e.g. you add a wrong "use stupid_thing;" line), then the message is OOM. Pretty misleading for debugging!
Now, I've looked at the code (dbus-spawn.c:679): else if (sitter->have_fork_errnum) { dbus_set_error (error, DBUS_ERROR_NO_MEMORY, "Failed to fork a new process %s: %s", sitter->executable, _dbus_strerror (sitter->errnum)); }
(See http://dbus.freedesktop.org/doc/api/html/dbus-spawn_8c-source.html#l00679)
So this means the /message/ is explicit, but the /error code/ can be plain wrong. (Maybe there's no way to be sure an OOM issue occurred, and this would be why this code is forced to assume that's the case.)
The problem is getting worse because it appears that the message itself is lost at some point, and the application only gets the message about OOM, without any details. (The error message from the bug title is dbus_error.message).
So can we either get the more generic error code, or a detailed error message, or even both? ;-)
Version: 1.5