[Kde-hardware-devel] ASSERT: "dev->backendObject()==0" in file /SVN/kdelibs/solid/solid/devicemanager.cpp, line 164

Christian Esken esken at kde.org
Sat Nov 17 01:20:06 CET 2007


Am Freitag, 16. November 2007 schrieb Kevin Ottens:
> Le vendredi 16 novembre 2007, Christian Esken a écrit :
> > Any ideas about this?
> 
> Very odd, any way to reproduce this? Bonus points if it's reproducible with

Kevin,

it is easily reproducable for me, as it happens frequently (nearly always). Just unplug and plug the USB sound stick. Depending on some magic, the hit rate is between 10% and 100%.
 
> the fake backend. Adding a backtrace might help.

How can I do use the Fake backend? And how can I plug/uplug OSS devices from the Fake backend?

Unfortunately there is no backtrace, as the "Q_ASSERT(dev->backendObject()==0);" just makes the application exit. For testing I commented the Q_ASSERT (see below), and then unplugging it works:


void Solid::DeviceManagerPrivate::_k_deviceAdded(const QString &udi)
{
    if (m_devicesMap.contains(udi)) {
        DevicePrivate *dev = m_devicesMap[udi];

        // Ok, this one was requested somewhere was invalid
        // and now becomes magically valid!
        // Q_ASSERT(dev->backendObject()==0);               # <<< Commented that line, and it works
        dev->setBackendObject(createBackendObject(udi));
        Q_ASSERT(dev->backendObject()!=0);
    }

    emit deviceAdded(udi);
}

Putting the Q_ASSERT in again leads to the same behaviour as before (assertion failure).

 Christian



More information about the Kde-hardware-devel mailing list