Bug 240358 - Invalid D-BUS interface name 'org.kde.plasma-desktop.PlasmaApp' found while parsing introspection
Summary: Invalid D-BUS interface name 'org.kde.plasma-desktop.PlasmaApp' found while p...
Status: RESOLVED UPSTREAM
Alias: None
Product: plasma4
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR minor
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-01 15:44 UTC by Richard
Modified: 2010-06-08 03:43 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard 2010-06-01 15:44:16 UTC
Version:           unspecified (using KDE 4.4.3) 
OS:                Linux

The DBus specification makes the use of '-' in interface names invalid in any name except for a bus name:

http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names

I was not sure if this was an interface name or a bus name, so I filed a bug related to this with Nokia. According to them, this is not an instance of a bus name, which makes this an invalid name and they refused to modify their code to be compatible with it. The result is that org.kde.plasma-desktop.PlasmaApp is not registered with QtDBus when KDE starts, which can cause problems elsewhere.

Reproducible: Always

Steps to Reproduce:
1. Start KDE
2. grep "Invalid D-BUS" < ~/.xsession-errors

Actual Results:  
$ grep "Invalid D-BUS" < ~/.xsession-errors
Invalid D-BUS member name 'idle-hint' found in interface 'org.freedesktop.ConsoleKit.Session' while parsing introspection
Invalid D-BUS member name 'is-local' found in interface 'org.freedesktop.ConsoleKit.Session' while parsing introspection
Invalid D-BUS member name 'x11-display-device' found in interface 'org.freedesktop.ConsoleKit.Session' while parsing introspection
Invalid D-BUS member name 'x11-display' found in interface 'org.freedesktop.ConsoleKit.Session' while parsing introspection
Invalid D-BUS member name 'display-device' found in interface 'org.freedesktop.ConsoleKit.Session' while parsing introspection
Invalid D-BUS member name 'remote-host-name' found in interface 'org.freedesktop.ConsoleKit.Session' while parsing introspection
Invalid D-BUS member name 'session-type' found in interface 'org.freedesktop.ConsoleKit.Session' while parsing introspection
Invalid D-BUS member name 'unix-user' found in interface 'org.freedesktop.ConsoleKit.Session' while parsing introspection
Invalid D-BUS interface name 'org.kde.plasma-desktop.PlasmaApp' found while parsing introspection

Expected Results:  
$ grep "Invalid D-BUS" < ~/.xsession-errors

The ConsoleKit messages in ~/.xsession-errors are because ConsoleKit is not obeying the D-BUS specification either. Those are not a KDE issue. The following, however, is:

Invalid D-BUS interface name 'org.kde.plasma-desktop.PlasmaApp' found while parsing introspection
Comment 1 Aaron J. Seigo 2010-06-02 01:15:01 UTC
"The result is that org.kde.plasma-desktop.PlasmaApp is
not registered with QtDBus when KDE starts, which can cause problems elsewhere."

the problem is in libdkeui, actually, and affects all KDE apps that have app names that don't match the dbus spec. moreover, it does appear on the bus as dbus-daemon doesn't enforce this and QtDBus can reach it just fine as well.

it's a thus-far harmless warning. i'm working up a patch against libkdeui in any case to hopefully get rid of these warnings because it only causes undue panic and bug reports. we'll see :)
Comment 2 Richard 2010-06-02 03:06:21 UTC
"the problem is in libdkeui, actually, and affects all KDE apps that have app
names that don't match the dbus spec. moreover, it does appear on the bus as
dbus-daemon doesn't enforce this and QtDBus can reach it just fine as well."

QtDBus is generating those messages because it is refusing to process invalid D-Bus names. I have a bug report with Nokia where I proposed a patch to make QtDBus accept the names for compatibility purposes and it was rejected:

http://bugreports.qt.nokia.com/browse/QTBUG-10927

If you look at the source code of QtDBus, you will see that it is refusing to register the invalid names, so this is not necessarily as harmless as it seems.
Comment 3 Aaron J. Seigo 2010-06-08 01:50:45 UTC
this is not about properties (which is the br you note in Qt) and obviously it works with Qt otherwise plasma-desktop would not be reachable by other apps. it's a cosmetic issue currently and having talked with thiago about this particular issue on kde-core-devel it's actually a problem with qt itself (since it is generating this particular name before putting it on the bus)
Comment 4 Richard 2010-06-08 02:34:45 UTC
Nokia's developers said in the upstream bug report that when this happens, it means there is a problem in other people's software, not theirs. The D-Bus specification explicitly disallows the use of '-' in interface names, which means that KDE is non-compliant.

Here is the source code in question from ./src/dbus/qdbusxmlparser.cpp in QtDBus 4.6.2 that deals with this:

        // parse methods
        QDomNodeList list = iface.elementsByTagName(QLatin1String("method"));
        for (int j = 0; j < list.count(); ++j)
        {
            QDomElement method = list.item(j).toElement();
            QString methodName = method.attribute(QLatin1String("name"));
            if (method.isNull())
                continue;
            if (!QDBusUtil::isValidMemberName(methodName)) {
                qWarning("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection",
                         qPrintable(methodName), qPrintable(ifaceName));
                continue;
            }

            QDBusIntrospection::Method methodData;
            methodData.name = methodName;

            // parse arguments
            methodData.inputArgs = parseArgs(method, QLatin1String("in"), true);
            methodData.outputArgs = parseArgs(method, QLatin1String("out"), false);
            methodData.annotations = parseAnnotations(method);

            // add it
            ifaceData->methods.insert(methodName, methodData);
        }

The code clearly refuses to register anything it deems to be an invalid interface name. If that is not the case, then something is causing the continue statement to be ignored and I do not see how that can happen here.

Perhaps things work inspite of Qt-DBus's rejection of the interface names because D-Bus accepts the names and QtDBus is just a wrapper for that, in which case the names are still broadcast to the outside world, but anything that asks QtDBus for them won't receive them. I don't write code that interacts with either Qt or DBus, so I cannot verify this, although I assume that is why plasma-desktop appears to work fine with other applications. It would depend on how QtDBus is designed, but I expect that anything that asks QtDBus if plasma desktop is present would break because QtDBus would say no (and would possibly produce an error message because it was asked a question about an invalid interface name).
Comment 5 Aaron J. Seigo 2010-06-08 03:43:49 UTC
Richard, please do not reopen this report. I've discussed this with Thiago, maintainer of QtDBus and the conclusions are:

* in this case, it works just fine even if it is technically a violation of dbus. Yes, that includes with QtDBus (obvious proof: not only does plasma-desktop appear on the dbus, but other Qt/KDE apps talk to it over dbus)

* the problem in this case is in Qt, according to Thiago.

the problem you are describing and this one are slightly different. this is not about dbus properties.