Bug 300600 - Crash when filtering contacts
Summary: Crash when filtering contacts
Status: RESOLVED FIXED
Alias: None
Product: telepathy
Classification: Frameworks and Libraries
Component: contactlist (show other bugs)
Version: 0.5.80
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: Future
Assignee: Telepathy Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-25 11:19 UTC by Alex Fiestas
Modified: 2013-03-29 12:47 UTC (History)
4 users (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 Alex Fiestas 2012-05-25 11:19:15 UTC
Application: ktp-contactlist (0.3)
KDE Platform Version: 4.8.3 (4.8.3) (Compiled from sources)
Qt Version: 4.8.2
Operating System: Linux 3.4.0-1-ARCH x86_64

-- Information about the crash:
I was filtering contacts using the "find contact" filter, after the very first characters it crashed.

Happened to me a few more times.

The crash can be reproduced some of the time.

-- Backtrace:
Application: KDE Telepathy Contact List (ktp-contactlist), signal: Segmentation fault
Using host libthread_db library "/lib/libthread_db.so.1".
[KCrash Handler]
#6  0x00007ff7dc77658e in ?? () from /usr/lib/libQtGui.so.4
#7  0x00007ff7dc7766a1 in QSortFilterProxyModel::invalidateFilter() () from /usr/lib/libQtGui.so.4
#8  0x00007ff7df2fa50d in AccountsFilterModel::setDisplayNameFilterString (this=0x1a3ee30, displayNameFilterString=...) at /home/afiestas/cod3s/cpp/kde/source/ktp-common-internals/KTp/Models/accounts-filter-model.cpp:480
#9  0x0000000000421b3f in ContactListWidget::setFilterString (this=<optimized out>, string=...) at /home/afiestas/cod3s/cpp/kde/source/ktp-contact-list/contact-list-widget.cpp:563
#10 0x00007ff7ddf8ddcf in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#11 0x0000000000432ae0 in FilterBar::filterChanged (this=<optimized out>, _t1=...) at /home/afiestas/cod3s/cpp/kde/build/ktp-contact-list/filter-bar.moc:105
#12 0x00007ff7ddf8ddcf in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#13 0x00007ff7dc5f26b5 in QLineEdit::textEdited(QString const&) () from /usr/lib/libQtGui.so.4
#14 0x00007ff7dc5ed75d in ?? () from /usr/lib/libQtGui.so.4
#15 0x00007ff7dc5f2a1d in ?? () from /usr/lib/libQtGui.so.4
#16 0x00007ff7ddf8ddcf in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#17 0x00007ff7dc8511c5 in QLineControl::textEdited(QString const&) () from /usr/lib/libQtGui.so.4
#18 0x00007ff7dc5f71cb in QLineControl::finishChange(int, bool, bool) () from /usr/lib/libQtGui.so.4
#19 0x00007ff7dc5f9738 in QLineControl::processKeyEvent(QKeyEvent*) () from /usr/lib/libQtGui.so.4
#20 0x00007ff7dc5ee7d9 in QLineEdit::keyPressEvent(QKeyEvent*) () from /usr/lib/libQtGui.so.4
#21 0x00007ff7decf328d in KLineEdit::keyPressEvent (this=0x1aa3d50, e=0x7fff09fcc380) at /home/afiestas/cod3s/cpp/kde/source/kdelibs/kdeui/widgets/klineedit.cpp:970
#22 0x00007ff7dc23871b in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#23 0x00007ff7dc5f0c87 in QLineEdit::event(QEvent*) () from /usr/lib/libQtGui.so.4
#24 0x00007ff7decf271b in KLineEdit::event (this=0x1aa3d50, ev=0x7fff09fcc380) at /home/afiestas/cod3s/cpp/kde/source/kdelibs/kdeui/widgets/klineedit.cpp:1403
#25 0x00007ff7dc1e8f7c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#26 0x00007ff7dc1edf74 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#27 0x00007ff7dec416ae in KApplication::notify (this=0x7fff09fcd2a0, receiver=0x1aa3d50, event=0x7fff09fcc380) at /home/afiestas/cod3s/cpp/kde/source/kdelibs/kdeui/kernel/kapplication.cpp:311
#28 0x00007ff7ddf788ee in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#29 0x00007ff7dc28555a in ?? () from /usr/lib/libQtGui.so.4
#30 0x00007ff7dc285991 in ?? () from /usr/lib/libQtGui.so.4
#31 0x00007ff7dc263368 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4
#32 0x00007ff7dc289682 in ?? () from /usr/lib/libQtGui.so.4
#33 0x00007ff7d721d4a5 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#34 0x00007ff7d721d7d8 in ?? () from /usr/lib/libglib-2.0.so.0
#35 0x00007ff7d721d894 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#36 0x00007ff7ddfa6ae6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#37 0x00007ff7dc2892fe in ?? () from /usr/lib/libQtGui.so.4
#38 0x00007ff7ddf7763f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#39 0x00007ff7ddf778c8 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#40 0x00007ff7ddf7c568 in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#41 0x000000000041d295 in main (argc=1, argv=0x7fff09fcd3e8) at /home/afiestas/cod3s/cpp/kde/source/ktp-contact-list/main.cpp:62

Reported using DrKonqi
Comment 1 Rohan Garg 2012-09-18 20:05:27 UTC
Hi!
Could you please try and reproduce this on the 0.5 release? 0.3 is no longer supported.
Comment 2 Martin Klapetek 2013-01-04 15:39:53 UTC
4 months no response, closing. Reopen if still happens, thanks.
Comment 3 Lamarque V. Souza 2013-03-18 03:52:18 UTC
I can reproduce this problem with ktp-contact-list-0.5.80 :

Application: KDE Telepathy Contact List (ktp-contactlist), signal: Aborted
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f0baabf3780 (LWP 12998))]

Thread 2 (Thread 0x7f0ba6540700 (LWP 12999)):
#0  0x0000003f00ee1bd3 in poll () from /lib64/libc.so.6
#1  0x0000003f04a3f4b3 in g_main_context_iterate.clone.5 () from /usr/lib64/libglib-2.0.so.0
#2  0x0000003f04a3f85a in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
#3  0x0000003f0fab6893 in gdbus_shared_thread_func () from /usr/lib64/libgio-2.0.so.0
#4  0x0000003f04a57eb5 in g_thread_proxy () from /usr/lib64/libglib-2.0.so.0
#5  0x0000003f01608ec6 in start_thread () from /lib64/libpthread.so.0
#6  0x0000003f00eea86d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f0baabf3780 (LWP 12998)):
[KCrash Handler]
#6  0x0000003f00e37b95 in raise () from /lib64/libc.so.6
#7  0x0000003f00e3900b in abort () from /lib64/libc.so.6
#8  0x000000347cc716ba in qt_message_output(QtMsgType, char const*) () from /usr/lib64/qt4/libQtCore.so.4
#9  0x000000347cc717a5 in qt_message(QtMsgType, char const*, __va_list_tag*) () from /usr/lib64/qt4/libQtCore.so.4
#10 0x000000347cc718bd in qFatal(char const*, ...) () from /usr/lib64/qt4/libQtCore.so.4
#11 0x00000034f959de9d in QIdentityProxyModel::index(int, int, QModelIndex const&) const () from /usr/lib64/qt4/libQtGui.so.4
#12 0x00000034f95e81b3 in QSortFilterProxyModelPrivate::proxy_to_source(QModelIndex const&) const () from /usr/lib64/qt4/libQtGui.so.4
#13 0x00000034f95e81d3 in QSortFilterProxyModel::mapToSource(QModelIndex const&) const () from /usr/lib64/qt4/libQtGui.so.4
#14 0x00000034f95e950f in QSortFilterProxyModelPrivate::store_persistent_indexes() () from /usr/lib64/qt4/libQtGui.so.4
#15 0x00000034f95ea8d1 in QSortFilterProxyModelPrivate::_q_clearMapping() () from /usr/lib64/qt4/libQtGui.so.4
#16 0x00000034f95eb20e in QSortFilterProxyModel::setSourceModel(QAbstractItemModel*) () from /usr/lib64/qt4/libQtGui.so.4
#17 0x0000003e4fa1c4e1 in KTp::ContactsFilterModel::setSourceModel(QAbstractItemModel*) () from /usr/lib64/libktpmodelsprivate.so.5
#18 0x0000003e4fa1ff49 in KTp::ContactsModel::updateGroupProxyModels() () from /usr/lib64/libktpmodelsprivate.so.5
#19 0x0000003e4fa200cb in KTp::ContactsModel::setGroupMode(KTp::ContactsModel::GroupMode) () from /usr/lib64/libktpmodelsprivate.so.5
#20 0x000000000041f709 in ContactListWidget::setFilterString(QString const&) ()
#21 0x000000347cd2eda4 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#22 0x0000000000431058 in FilterBar::filterChanged(QString const&) ()
#23 0x000000347cd2eda4 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#24 0x00000034f94cb621 in QLineEdit::textEdited(QString const&) () from /usr/lib64/qt4/libQtGui.so.4
#25 0x00000034f94c7f43 in QLineEditPrivate::_q_textEdited(QString const&) () from /usr/lib64/qt4/libQtGui.so.4
#26 0x00000034f94cb81f in QLineEdit::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib64/qt4/libQtGui.so.4
#27 0x000000347cd2eda4 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#28 0x00000034f9687817 in QLineControl::textEdited(QString const&) () from /usr/lib64/qt4/libQtGui.so.4
#29 0x00000034f94cf6fa in QLineControl::finishChange(int, bool, bool) () from /usr/lib64/qt4/libQtGui.so.4
#30 0x00000034f94d0a5a in QLineControl::processKeyEvent(QKeyEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#31 0x00000034f94c8f06 in QLineEdit::keyPressEvent(QKeyEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#32 0x0000003c194953bf in KLineEdit::keyPressEvent(QKeyEvent*) () from /usr/lib64/libkdeui.so.5
#33 0x00000034f92163f3 in QWidget::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#34 0x00000034f94ca689 in QLineEdit::event(QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#35 0x0000003c194962dd in KLineEdit::event(QEvent*) () from /usr/lib64/libkdeui.so.5
#36 0x00000034f91daf4a in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#37 0x00000034f91e0791 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#38 0x0000003c1941496b in KApplication::notify(QObject*, QEvent*) () from /usr/lib64/libkdeui.so.5
#39 0x000000347cd1f3cc in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#40 0x00000034f925371b in QKeyMapper::sendKeyEvent(QWidget*, bool, QEvent::Type, int, QFlags<Qt::KeyboardModifier>, QString const&, bool, int, unsigned int, unsigned int, unsigned int, bool*) () from /usr/lib64/qt4/libQtGui.so.4
#41 0x00000034f9253dab in QKeyMapperPrivate::translateKeyEvent(QWidget*, _XEvent const*, bool) () from /usr/lib64/qt4/libQtGui.so.4
#42 0x00000034f9236b90 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#43 0x00000034f9256c21 in x11EventSourceDispatch(_GSource*, int (*)(void*), void*) () from /usr/lib64/qt4/libQtGui.so.4
#44 0x0000003f04a3f26f in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#45 0x0000003f04a3f506 in g_main_context_iterate.clone.5 () from /usr/lib64/libglib-2.0.so.0
#46 0x0000003f04a3f59f in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#47 0x000000347cd40dd7 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#48 0x00000034f925691d in QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtGui.so.4
#49 0x000000347cd1dfb1 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#50 0x000000347cd1e1c5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#51 0x000000347cd218a9 in QCoreApplication::exec() () from /usr/lib64/qt4/libQtCore.so.4
#52 0x000000000041e507 in main ()
Comment 4 David Edmundson 2013-03-18 04:25:01 UTC
Thanks, as it's a qFatal() could you paste the final output when you ktp-contactlist from the command line.
Comment 5 Lamarque V. Souza 2013-03-18 04:38:45 UTC
[lamarque@evolucao ~/]$ ktp-contactlist
KGlobal::locale::Warning your global KLocale is being recreated with a valid main component instead of a fake component, this usually means you tried to call i18n related functions before your main component was created. You should not do that since it most likely will not work 
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
ktp-contactlist(28662) KPixmapSequence::Private::loadSequence: Invalid framesize. 
KPixmapSequence::Private::loadSequence: Invalid framesize. 
ktp-contactlist(28662) KPixmapSequence::Private::loadSequence: Invalid framesize. 
ktp-contactlist(28662) KTp::GlobalPresence::onCurrentPresenceChanged: Current presence changed
tp-qt4-tpl DEBUG:  static Tpl::Utils* Tpl::Utils::instance()  :  Created Utils instance 
ASSERT: "parent.isValid() ? parent.model() == this : true" in file itemviews/qidentityproxymodel.cpp, line 163
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = ktp-contactlist path = /usr/bin pid = 28662
KCrash: Arguments: /usr/bin/ktp-contactlist --nocrashhandler 
KCrash: Attempting to start /usr/lib64/kde4/libexec/drkonqi from kdeinit
sock_file=/home/lamarque/.kde4/socket-evolucao.localdomain/kdeinit4__0
Comment 6 Martin Klapetek 2013-03-18 09:15:30 UTC
David - this is the same crash Alex is experiencing.
Comment 7 David Edmundson 2013-03-26 18:05:02 UTC
Git commit 8c2c7498ed9b064ab6d9da27d250ecde9ae55c97 by David Edmundson.
Committed on 26/03/2013 at 16:41.
Pushed by davidedmundson into branch 'master'.

Fix crashes when using debug versions of Qt

Rewrite the logic of sourceDataChanged which was fundamentally broken
This was potentially emitting onDataChanged on the invalid QModelIndex,
especially now we use a flat model in the filtered view

REVIEW: 109726

M  +30   -26   KTp/Models/contacts-filter-model.cpp
M  +2    -1    KTp/Models/contacts-filter-model.h
M  +5    -0    KTp/Models/contacts-model.cpp

http://commits.kde.org/telepathy-common-internals/8c2c7498ed9b064ab6d9da27d250ecde9ae55c97
Comment 8 David Edmundson 2013-03-29 01:50:49 UTC
That didn't fix it, we were missing some crucial information when testing.

The crash only occurs if a contact is selected otherwise it works.
Comment 9 David Edmundson 2013-03-29 12:47:46 UTC
Git commit ad75d44da148f7c2cdd6412e44823a8981f017b2 by David Edmundson.
Committed on 29/03/2013 at 02:47.
Pushed by davidedmundson into branch 'kde-telepathy-0.6'.

Re-fix crash in debug versions of Qt in contacts model

REVIEW: 109788

M  +5    -5    KTp/Models/contacts-model.cpp

http://commits.kde.org/telepathy-common-internals/ad75d44da148f7c2cdd6412e44823a8981f017b2
Comment 10 David Edmundson 2013-03-29 12:47:46 UTC
Git commit 97dc73527aecaad4c5ac6337cb0affc599c6d1ad by David Edmundson.
Committed on 26/03/2013 at 16:41.
Pushed by davidedmundson into branch 'kde-telepathy-0.6'.

Fix crashes when using debug versions of Qt

Rewrite the logic of sourceDataChanged which was fundamentally broken
This was potentially emitting onDataChanged on the invalid QModelIndex,
especially now we use a flat model in the filtered view

REVIEW: 109726

M  +30   -26   KTp/Models/contacts-filter-model.cpp
M  +2    -1    KTp/Models/contacts-filter-model.h
M  +5    -0    KTp/Models/contacts-model.cpp

http://commits.kde.org/telepathy-common-internals/97dc73527aecaad4c5ac6337cb0affc599c6d1ad