Bug 351051

Summary: Assertion failed in devicesmodel.cpp after resume from suspend.
Product: [Frameworks and Libraries] frameworks-bluez-qt Reporter: Weng Xuetian <wengxt>
Component: generalAssignee: David Rosca <nowrep>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Weng Xuetian 2015-08-07 04:08:47 UTC
Here's the backtrace for it, I wonder if that assertion is valid.


#0  0x00007f63b9b7684d in nanosleep () from /usr/lib/libc.so.6
#1  0x00007f63b9b766e4 in sleep () from /usr/lib/libc.so.6
#2  0x00007f63be7408aa in ?? () from /usr/lib/libKF5Crash.so.5
#3  0x00007f63be740cd4 in KCrash::defaultCrashHandler(int) ()
   from /usr/lib/libKF5Crash.so.5
#4  <signal handler called>
#5  0x00007f63b9af2a17 in raise () from /usr/lib/libc.so.6
#6  0x00007f63b9af3dea in abort () from /usr/lib/libc.so.6
#7  0x00007f63ba205a91 in qt_message_fatal (context=..., 
    message=<synthetic pointer>) at global/qlogging.cpp:1575
#8  QMessageLogger::fatal (this=this@entry=0x7ffcf92b7b90, 
    msg=msg@entry=0x7f63ba4d1ac0 "ASSERT: \"%s\" in file %s, line %d")
    at global/qlogging.cpp:777
#9  0x00007f63ba200bae in qt_assert (assertion=<optimized out>, 
    file=<optimized out>, line=<optimized out>) at global/qglobal.cpp:2970
#10 0x00007f62cabd13e9 in BluezQt::DevicesModelPrivate::deviceChanged (
    this=0x5bd1680, device=...)
    at /home/saber/Develop/build/bluez-qt/src/devicesmodel.cpp:85
#11 0x00007f62cabd4123 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QSharedPointer<BluezQt::Device> >, void, void (BluezQt::DevicesModelPrivate::*)(QSharedPointer<BluezQt::Device>)>::call (f=
    (void (BluezQt::DevicesModelPrivate::*)(BluezQt::DevicesModelPrivate * const, QSharedPointer<BluezQt::Device>)) 0x7f62cabd139c <BluezQt::DevicesModelPrivate::deviceChanged(QSharedPointer<BluezQt::Device>)>, o=0x5bd1680, arg=0x7ffcf92b7e10)
    at /usr/include/qt5/QtCore/qobjectdefs_impl.h:501
#12 0x00007f62cabd3fdf in QtPrivate::FunctionPointer<void (BluezQt::DevicesModelPrivate::*)(QSharedPointer<BluezQt::Device>)>::call<QtPrivate::List<QSharedPointer<BluezQt::Device> >, void> (f=
    (void (BluezQt::DevicesModelPrivate::*)(BluezQt::DevicesModelPrivate * const, QSharedPointer<BluezQt::Device>)) 0x7f62cabd139c <BluezQt::DevicesModelPrivate::deviceChanged(QSharedPointer<BluezQt::Device>)>, o=0x5bd1680, arg=0x7ffcf92b7e10)
    at /usr/include/qt5/QtCore/qobjectdefs_impl.h:520
#13 0x00007f62cabd3cc9 in QtPrivate::QSlotObject<void (BluezQt::DevicesModelPrivate::*)(QSharedPointer<BluezQt::Device>), QtPrivate::List<QSharedPointer<BluezQt::Device> >, void>::impl (which=1, this_=0x5bd1810, r=0x5bd1680, a=0x7ffcf92b7e10, 
    ret=0x0) at /usr/include/qt5/QtCore/qobject_impl.h:143
#14 0x00007f63ba43164a in call (a=0x7ffcf92b7e10, r=0x5bd1680, this=0x5bd1810)
    at ../../include/QtCore/../../src/corelib/kernel/qobject_impl.h:124
#15 QMetaObject::activate (sender=0x40d2860, signalOffset=<optimized out>, 
    local_signal_index=<optimized out>, argv=0x7ffcf92b7e10)
    at kernel/qobject.cpp:3703
#16 0x00007f62cabf4253 in BluezQt::Manager::deviceChanged (this=0x40d2860, 
    _t1=...) at /home/saber/Develop/build/bluez-qt/build/src/moc_manager.cpp:366
#17 0x00007f62cabc08b5 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QSharedPointer<BluezQt::Device> >, void, void (BluezQt::Manager::*)(QSharedPointer<BluezQt::Device>)>::call (f=
    (void (BluezQt::Manager::*)(BluezQt::Manager * const, QSharedPointer<BluezQt::Device>)) 0x7f62cabf420c <BluezQt::Manager::deviceChanged(QSharedPointer<BluezQt::Device>)>, o=0x40d2860, arg=0x7ffcf92b8020)
    at /usr/include/qt5/QtCore/qobjectdefs_impl.h:501
#18 0x00007f62cabbf89e in QtPrivate::FunctionPointer<void (BluezQt::Manager::*)(QSharedPointer<BluezQt::Device>)>::call<QtPrivate::List<QSharedPointer<BluezQt::Device> >, void> (f=
    (void (BluezQt::Manager::*)(BluezQt::Manager * const, QSharedPointer<BluezQt::Device>)) 0x7f62cabf420c <BluezQt::Manager::deviceChanged(QSharedPointer<BluezQt::Device>)>, o=0x40d2860, arg=0x7ffcf92b8020)
    at /usr/include/qt5/QtCore/qobjectdefs_impl.h:520
#19 0x00007f62cabbe5a1 in QtPrivate::QSlotObject<void (BluezQt::Manager::*)(QSharedPointer<BluezQt::Device>), QtPrivate::List<QSharedPointer<BluezQt::Device> >, void>::impl (which=1, this_=0x44c4030, r=0x40d2860, a=0x7ffcf92b8020, ret=0x0)
    at /usr/include/qt5/QtCore/qobject_impl.h:143
#20 0x00007f63ba43164a in call (a=0x7ffcf92b8020, r=0x40d2860, this=0x44c4030)
    at ../../include/QtCore/../../src/corelib/kernel/qobject_impl.h:124
#21 QMetaObject::activate (sender=0x44c2230, signalOffset=<optimized out>, 
    local_signal_index=<optimized out>, argv=0x7ffcf92b8020)
    at kernel/qobject.cpp:3703
#22 0x00007f62cabf23a9 in BluezQt::Device::deviceChanged (this=0x44c2230, 
    _t1=...) at /home/saber/Develop/build/bluez-qt/build/src/moc_device.cpp:539
#23 0x00007f62cabc9eeb in BluezQt::DevicePrivate::propertiesChanged (
    this=0x44c2270, interface=..., changed=..., invalidated=...)
    at /home/saber/Develop/build/bluez-qt/src/device_p.cpp:195
#24 0x00007f62cabcafa7 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<QString const&, QMap<QString, QVariant> const&, QStringList const&>, void, void (BluezQt::DevicePrivate::*)(QString const&, QMap<QString, QVariant> const&, QStringList const&)>::call (f=
    (void (BluezQt::DevicePrivate::*)(BluezQt::DevicePrivate * const, const QString &, const QMap<QString, QVariant> &, const QStringList &)) 0x7f62cabc8fe6 <BluezQt::DevicePrivate::propertiesChanged(QString const&, QMap<QString, QVariant> const&, QStringList const&)>, o=0x44c2270, arg=0x40ddfa0)
    at /usr/include/qt5/QtCore/qobjectdefs_impl.h:501
#25 0x00007f62cabcae30 in QtPrivate::FunctionPointer<void (BluezQt::DevicePrivate::*)(QString const&, QMap<QString, QVariant> const&, QStringList const&)>::call<QtPrivate::List<QString const&, QMap<QString, QVariant> const&, QStringList const&>, void> (f=
    (void (BluezQt::DevicePrivate::*)(BluezQt::DevicePrivate * const, const QString &, const QMap<QString, QVariant> &, const QStringList &)) 0x7f62cabc8fe6 <BluezQt::DevicePrivate::propertiesChanged(QString const&, QMap<QString, QVariant> const&, QStringList const&)>, o=0x44c2270, arg=0x40ddfa0)
    at /usr/include/qt5/QtCore/qobjectdefs_impl.h:520
#26 0x00007f62cabcab11 in QtPrivate::QSlotObject<void (BluezQt::DevicePrivate::*)(QString const&, QMap<QString, QVariant> const&, QStringList const&), QtPrivate::List<QString const&, QMap<QString, QVariant> const&, QStringList const&>, void>::impl (which=1, this_=0x44c2150, r=0x44c2270, a=0x40ddfa0, ret=0x0)
    at /usr/include/qt5/QtCore/qobject_impl.h:143
#27 0x00007f63ba432e4a in QObject::event (this=0x44c2270, e=<optimized out>)
    at kernel/qobject.cpp:1246
#28 0x00007f63bad0f4ec in QApplicationPrivate::notify_helper (this=0xb64660, 
    receiver=0x44c2270, e=0x59d7940) at kernel/qapplication.cpp:3717
#29 0x00007f63bad14930 in QApplication::notify (this=0x7ffcf92b8a90, 
    receiver=0x44c2270, e=0x59d7940) at kernel/qapplication.cpp:3500
#30 0x00007f63ba4026bb in QCoreApplication::notifyInternal (this=0x7ffcf92b8a90, 
    receiver=0x44c2270, event=event@entry=0x59d7940)
    at kernel/qcoreapplication.cpp:965
#31 0x00007f63ba4049e3 in sendEvent (event=0x59d7940, receiver=<optimized out>)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:224
#32 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, 
    event_type=event_type@entry=0, data=0xb5af90)
    at kernel/qcoreapplication.cpp:1593
#33 0x00007f63ba404f98 in QCoreApplication::sendPostedEvents (
    receiver=receiver@entry=0x0, event_type=event_type@entry=0)
    at kernel/qcoreapplication.cpp:1451
#34 0x00007f63ba45a893 in postEventSourceDispatch (s=0xb97140)
    at kernel/qeventdispatcher_glib.cpp:271
#35 0x00007f63b55e8a1d in g_main_context_dispatch ()
   from /usr/lib/libglib-2.0.so.0
#36 0x00007f63b55e8d08 in ?? () from /usr/lib/libglib-2.0.so.0
#37 0x00007f63b55e8dbc in g_main_context_iteration ()
   from /usr/lib/libglib-2.0.so.0
#38 0x00007f63ba45ac87 in QEventDispatcherGlib::processEvents (this=0xb9d560, 
    flags=...) at kernel/qeventdispatcher_glib.cpp:418
#39 0x00007f63ba4000f2 in QEventLoop::exec (this=this@entry=0x7ffcf92b8910, 
    flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#40 0x00007f63ba407fdc in QCoreApplication::exec ()
    at kernel/qcoreapplication.cpp:1229
#41 0x00000000004309a3 in main ()


Reproducible: Always

Steps to Reproduce:
1. having some bluetooth device added and suspend 
2. resume

Actual Results:  
crash with assertion failed.

Expected Results:  
no crash
Comment 1 David Rosca 2015-08-11 07:15:56 UTC
What version of bluez-qt do you have?
And the backtrace is from plasmashell crash?
Comment 2 Weng Xuetian 2015-08-14 08:37:29 UTC
I was using git version bluez-qt, and yes it was from plasmashell since it loaded bluedevil plasmoid and thus loaded bluez-qt.
Comment 3 David Rosca 2015-08-20 17:26:22 UTC
Git commit 5771f4256095ac5f295d2b439214d21c5c045ce2 by David Rosca.
Committed on 20/08/2015 at 17:25.
Pushed by drosca into branch 'master'.

Don't forward deviceChanged signal after device was removed

This was hitting assert in DevicesModel.

M  +2    -0    src/adapter_p.cpp
M  +5    -0    src/manager_p.cpp

http://commits.kde.org/bluez-qt/5771f4256095ac5f295d2b439214d21c5c045ce2