Summary: | Plasma (and ktp-contact-list) crashed when I block new contact invitation on jabber (telepathy-gabble) | ||
---|---|---|---|
Product: | [Unmaintained] telepathy | Reporter: | Lukáš Karas <lukas.karas> |
Component: | general | Assignee: | Telepathy Bugs <kde-telepathy-bugs> |
Status: | RESOLVED WORKSFORME | ||
Severity: | crash | CC: | bhush94, cpigat242, mklapetek, plasma-bugs |
Priority: | NOR | Keywords: | drkonqi |
Version: | unspecified | ||
Target Milestone: | Future | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | patch that avoids access to list with negative index |
Description
Lukáš Karas
2016-02-19 12:05:01 UTC
I recompiled kpeople today and this bug still exists... kpeople head: a72809761419457b803e13ab91c1a1950b5f9ac8 I created simple patch that avoids `metacontacts[personRow]` access when `personRow` is < 0. diff --git a/src/personsmodel.cpp b/src/personsmodel.cpp index 0c9fa13..13bdb50 100644 --- a/src/personsmodel.cpp +++ b/src/personsmodel.cpp @@ -343,6 +343,11 @@ void PersonsModelPrivate::onContactRemoved(const QString &contactUri) int personRow = personIndex[personUri].row(); + if(personRow < 0){ + qDebug() << "personRow: " << personRow << ", contactUri: " << contactUri << ", personUri: " << personUri; + removePerson(personUri); + return; + } MetaContact &mc = metacontacts[personRow]; int contactPosition = mc.contactUris().indexOf(contactUri); q->beginRemoveRows(q->index(personRow, 0), contactPosition, contactPosition); Console output when I remove spam contact: personRow: -1 , contactUri: "ktp://gabble/jabber/ktp_2djabber_2dim_12?doofyntv6@swissjabber.org" , personUri: "ktp://gabble/jabber/ktp_2djabber_2dim_12?doofyntv6@swissjabber.org" It fixes these crashes but I don't know if this is correct place where it should be fixed... Created attachment 98130 [details]
patch that avoids access to list with negative index
Another similar case in method PersonsModelPrivate::onContactAdded: stacktrace: Thread 1 (Thread 0x7fb0af99d8c0 (LWP 3044)): [KCrash Handler] #6 0x00007fb0a9cf3518 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54 #7 0x00007fb0a9cf50ea in __GI_abort () at abort.c:89 #8 0x00007fb0aa49cfb1 in qt_message_fatal (context=..., message=<synthetic pointer>) at global/qlogging.cpp:1578 #9 QMessageLogger::fatal (this=this@entry=0x7ffe47e02600, msg=msg@entry=0x7fb0aa75a028 "ASSERT failure in %s: \"%s\", file %s, line %d") at global/qlogging.cpp:781 #10 0x00007fb0aa498181 in qt_assert_x (where=<optimized out>, what=<optimized out>, file=<optimized out>, line=<optimized out>) at global/qglobal.cpp:2974 #11 0x00007faff143d617 in QList<KPeople::MetaContact>::operator[] (this=0x5cd3c28, i=-1) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:518 #12 0x00007faff143a7da in KPeople::PersonsModelPrivate::onContactAdded (this=0x5cd3c00, contactUri=..., contact=...) at /media/karry/data/src/kpeople/src/personsmodel.cpp:305 #13 0x00007faff14406da in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1>, QtPrivate::List<QString const&, QExplicitlySharedDataPointer<KPeople::AbstractContact> const&>, void, void (KPeople::PersonsModelPrivate::*)(QString const&, QExplicitlySharedDataPointer<KPeople::AbstractContact> const&)>::call (f=(void (KPeople::PersonsModelPrivate::*)(KPeople::PersonsModelPrivate * const, const QString &, const QExplicitlySharedDataPointer<KPeople::AbstractContact> &)) 0x7faff143a6fa <KPeople::PersonsModelPrivate::onContactAdded(QString const&, QExplicitlySharedDataPointer<KPeople::AbstractContact> const&)>, o=0x5cd3c00, arg=0x7ffe47e02910) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:501 #14 0x00007faff144021d in QtPrivate::FunctionPointer<void (KPeople::PersonsModelPrivate::*)(QString const&, QExplicitlySharedDataPointer<KPeople::AbstractContact> const&)>::call<QtPrivate::List<QString const&, QExplicitlySharedDataPointer<KPeople::AbstractContact> const&>, void> (f=(void (KPeople::PersonsModelPrivate::*)(KPeople::PersonsModelPrivate * const, const QString &, const QExplicitlySharedDataPointer<KPeople::AbstractContact> &)) 0x7faff143a6fa <KPeople::PersonsModelPrivate::onContactAdded(QString const&, QExplicitlySharedDataPointer<KPeople::AbstractContact> const&)>, o=0x5cd3c00, arg=0x7ffe47e02910) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:520 #15 0x00007faff143fcff in QtPrivate::QSlotObject<void (KPeople::PersonsModelPrivate::*)(QString const&, QExplicitlySharedDataPointer<KPeople::AbstractContact> const&), QtPrivate::List<QString const&, QExplicitlySharedDataPointer<KPeople::AbstractContact> const&>, void>::impl (which=1, this_=0x5ed76f0, r=0x5cd3c00, a=0x7ffe47e02910, ret=0x0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject_impl.h:143 #16 0x00007fb0aa6bee1f in QtPrivate::QSlotObjectBase::call (a=0x7ffe47e02910, r=0x5cd3c00, this=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobject_impl.h:124 #17 QMetaObject::activate (sender=0x71206c0, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3698 #18 0x00007faff0f9eed0 in KPeople::AllContactsMonitor::contactAdded (this=0x71206c0, _t1=..., _t2=...) at /media/karry/data/src/kpeople/myBuild/src/backends/moc_allcontactsmonitor.cpp:177 #19 0x00007fafcc3ddf0b in KTpAllContacts::onAllKnownContactsChanged (this=0x71206c0, contactsAdded=..., contactsRemoved=...) at /media/karry/data/src/ktp-common-internals/kpeople/datasourceplugin/im-persons-data-source.cpp:302 #20 0x00007fafcc3de872 in KTpAllContacts::qt_static_metacall (_o=0x71206c0, _c=QMetaObject::InvokeMetaMethod, _id=5, _a=0x7ffe47e02bc0) at /media/karry/data/src/ktp-common-internals/myBuild/kpeople/datasourceplugin/im-persons-data-source.moc:105 #21 0x00007fb0aa6bef9a in QMetaObject::activate (sender=0x69e6c80, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3713 #22 0x00007fafda571a08 in KTp::GlobalContactManager::allKnownContactsChanged (this=0x69e6c80, _t1=..., _t2=...) at /media/karry/data/src/ktp-common-internals/myBuild/KTp/moc_global-contact-manager.cpp:178 #23 0x00007fafda554226 in KTp::GlobalContactManager::onContactManagerStateChanged (this=0x69e6c80, contactManager=..., state=Tp::ContactListStateSuccess) at /media/karry/data/src/ktp-common-internals/KTp/global-contact-manager.cpp:138 #24 0x00007fafda554046 in KTp::GlobalContactManager::onConnectionReady (this=0x69e6c80, op=0x818ecb0) at /media/karry/data/src/ktp-common-internals/KTp/global-contact-manager.cpp:119 #25 0x00007fafda5717b6 in KTp::GlobalContactManager::qt_static_metacall (_o=0x69e6c80, _c=QMetaObject::InvokeMetaMethod, _id=5, _a=0x7ffe47e02e30) at /media/karry/data/src/ktp-common-internals/myBuild/KTp/moc_global-contact-manager.cpp:116 #26 0x00007fb0aa6bef9a in QMetaObject::activate (sender=0x818ecb0, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3713 #27 0x00007fafda12dd0f in Tp::PendingOperation::finished(Tp::PendingOperation*) () from /usr/lib/x86_64-linux-gnu/libtelepathy-qt5.so.0 #28 0x00007fafda12f430 in ?? () from /usr/lib/x86_64-linux-gnu/libtelepathy-qt5.so.0 #29 0x00007fb0aa6bfe71 in QObject::event (this=0x818ecb0, e=<optimized out>) at kernel/qobject.cpp:1239 #30 0x00007fb0aaf8305c in QApplicationPrivate::notify_helper (this=this@entry=0x249d5a0, receiver=receiver@entry=0x818ecb0, e=e@entry=0x71e8c50) at kernel/qapplication.cpp:3716 #31 0x00007fb0aaf88516 in QApplication::notify (this=0x7ffe47e03540, receiver=0x818ecb0, e=0x71e8c50) at kernel/qapplication.cpp:3499 #32 0x00007fb0aa6905bb in QCoreApplication::notifyInternal (this=0x7ffe47e03540, receiver=0x818ecb0, event=event@entry=0x71e8c50) at kernel/qcoreapplication.cpp:965 #33 0x00007fb0aa6929b6 in QCoreApplication::sendEvent (event=0x71e8c50, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:224 #34 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x2493600) at kernel/qcoreapplication.cpp:1593 #35 0x00007fb0aa692e98 in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1451 #36 0x00007fb0aa6e6643 in postEventSourceDispatch (s=0x24d7c10) at kernel/qeventdispatcher_glib.cpp:271 #37 0x00007fb0a6a35127 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #38 0x00007fb0a6a35380 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #39 0x00007fb0a6a3542c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #40 0x00007fb0aa6e6a4f in QEventDispatcherGlib::processEvents (this=0x24d4c10, flags=...) at kernel/qeventdispatcher_glib.cpp:418 #41 0x00007fb0aa68dd7a in QEventLoop::exec (this=this@entry=0x7ffe47e033c0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204 #42 0x00007fb0aa695e1c in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1229 #43 0x0000000000473899 in main (argc=2, argv=0x7ffe47e03688) at /media/karry/data/src/plasma-workspace/shell/main.cpp:139 Thanks for the report Please post all patches to git.reviewboard.kde.org for review, review group add "kdepim" and "telepathy". Thanks! Ok, I created review request: https://git.reviewboard.kde.org/r/127532/ Dear Bug Submitter, This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond. Thank you for helping us make KDE software even better for everyone! Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone! This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging Thank you for helping us make KDE software even better for everyone! |