Summary: | KDE Connect crashes when opening a message | ||
---|---|---|---|
Product: | [Applications] kdeconnect | Reporter: | Ray Leon <maxwellleon55243> |
Component: | messaging-application | Assignee: | Simon Redman <simon> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | 2gd4who |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/network/kdeconnect-kde/commit/3ee78eadd7647748ae220402c01a062d3f56b4ef | Version Fixed In: | |
Attachments: | Video of the aforementioned crash. |
Description
Ray Leon
2022-02-06 21:47:54 UTC
Actual backtrace: Thread 1 "kdeconnect-sms" received signal SIGSEGV, Segmentation fault. ConversationModel::createRowFromMessage(ConversationMessage const&, int) [clone .constprop.0] (this=this@entry=0x7fffe0003f20, message=..., pos=0) at /usr/src/debug/kdeconnect-kde-21.12.2/smsapp/conversationmodel.cpp:145 145 ConversationAddress sender = message.addresses().first(); (gdb) backtrace #0 ConversationModel::createRowFromMessage(ConversationMessage const&, int) [clone .constprop.0] ( this=this@entry=0x7fffe0003f20, message=..., pos=0) at /usr/src/debug/kdeconnect-kde-21.12.2/smsapp/conversationmodel.cpp:145 #1 0x00005555555699f5 in ConversationModel::handleConversationUpdate (msg=..., this=0x7fffe0003f20) at /usr/src/debug/kdeconnect-kde-21.12.2/smsapp/conversationmodel.cpp:189 #2 ConversationModel::qt_static_metacall (_o=0x7fffe0003f20, _c=<optimized out>, _id=<optimized out>, _a=0x7fffffffdaf0) at /usr/src/debug/build/smsapp/kdeconnect-sms_autogen/EWIEGA46WW/moc_conversationmodel.cpp:161 #3 0x00007ffff6484ddf in ?? () from /usr/lib/libQt5Core.so.5 #4 0x00007ffff7f6e481 in OrgKdeKdeconnectDeviceConversationsInterface::conversationUpdated (_t1=..., this=<optimized out>) at /usr/src/debug/build/interfaces/conversationsinterface.moc:265 #5 OrgKdeKdeconnectDeviceConversationsInterface::qt_static_metacall (_o=0x5555567a7510, _c=<optimized out>, _id=<optimized out>, _a=0x7fffffffdc40) at /usr/src/debug/build/interfaces/conversationsinterface.moc:138 #6 0x00007ffff7f5b873 in OrgKdeKdeconnectDeviceConversationsInterface::qt_metacall (_a=0x7fffffffdc40, _id=4, _c=QMetaObject::InvokeMetaMethod, this=0x5555567a7510) at /usr/src/debug/build/interfaces/conversationsinterface.moc:223 #7 DeviceConversationsDbusInterface::qt_metacall (this=0x5555567a7510, _c=QMetaObject::InvokeMetaMethod, _id=<optimized out>, _a=0x7fffffffdc40) at /usr/src/debug/build/interfaces/kdeconnectinterfaces_autogen/EWIEGA46WW/moc_dbusinterfaces.cpp:958 #8 0x00007ffff746afae in ?? () from /usr/lib/libQt5DBus.so.5 #9 0x00007ffff6477e76 in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5 #10 0x00007ffff6ec61a6 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5 #11 0x00007ffff645416a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5 #12 0x00007ffff6454c69 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQt5Core.so.5 #13 0x00007ffff649b548 in ?? () from /usr/lib/libQt5Core.so.5 #14 0x00007ffff4d64f13 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 #15 0x00007ffff4dbb0d9 in ?? () from /usr/lib/libglib-2.0.so.0 #16 0x00007ffff4d62485 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0 #17 0x00007ffff649f44a in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5 #18 0x00007ffff644c44b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5 #19 0x00007ffff6457b97 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5 #20 0x00005555555603ef in main (argc=<optimized out>, argv=0x7fffffffe218) at /usr/src/debug/kdeconnect-kde-21.12.2/smsapp/main.cpp:87 I have this issue all the time, and right now I need it more than ever as I dropped my phone last weekend which smashed the display. Now KDE Connect is the only way I can access the data on my old phone but because of this major bug I am unable to access the sms conversations. I have noticed that this issue seems to 'build up'. For example if I open a small length conversation, they will display fine but will segfault opening a second. If I open a large one it will immediately segfault (In reply to Nathan from comment #2) > I have this issue all the time, and right now I need it more than ever as I > dropped my phone last weekend which smashed the display. Now KDE Connect is > the only way I can access the data on my old phone but because of this major > bug I am unable to access the sms conversations. I have noticed that this > issue seems to 'build up'. For example if I open a small length > conversation, they will display fine but will segfault opening a second. If > I open a large one it will immediately segfault This mirrors what I've been experiencing Looks like no one is even reading these bug reports (In reply to Nathan from comment #4) > Looks like no one is even reading these bug reports I read every bug report which is assigned to me and I'm sorry you get the impression that bug reports don't get read. I have an old house and a taxing job, so I don't have time or energy to act on most of them. The problem described in this bug looks like it might be pretty simple. In ConversationModel::createRowFromMessage, it seems to be trying to take the .first() of the list of message address and failing, presumably because the list is empty. I don't know why a conversation would exist with no addresses (that's probably the more interesting thing to investigate), but a quick fix would be to just have the app check that there is at least one entry before trying to take the first. Since I can't reproduce this, it's hard for me to work on, but if someone who can reproduce wants to try I'd be happy to support them. Thanks, I think that fixed it!
Changing "ConversationAddress sender = message.addresses().first();" in conversationmodel.cpp to
`
>ConversationAddress sender;
>if (!message.addresses().isEmpty()) {
> sender = message.addresses().first();
>}
`
seems to prevent the crashing.
I don't really know how to commit the changes though, would you mind doing that?
P.S. how do you
make code blocks? A possibly relevant merge request was started @ https://invent.kde.org/network/kdeconnect-kde/-/merge_requests/458 Git commit 3ee78eadd7647748ae220402c01a062d3f56b4ef by Simon Redman. Committed on 06/03/2022 at 22:56. Pushed by sredman into branch 'master'. [SMS App] Prevent crash if a conversation doesn't have any messages ## Summary Fix crash in kdeconnect-sms if a conversation contains a message which has no addresses. I am not sure why this would happen and there's probably something which should be fixed on the Android side to ensure that every message has addresses, but this is an easy fix to prevent user-reported crashes. ## Test Plan ### Before: kdeconnect-sms crashes upon selecting a conversation with a message with no addresses ### After: kdeconnect-sms does not crash M +9 -1 smsapp/conversationmodel.cpp https://invent.kde.org/network/kdeconnect-kde/commit/3ee78eadd7647748ae220402c01a062d3f56b4ef The commit mentioned above should resolve the issue. I expect you'll see some messages which are missing senders but at least the app won't crash. (In reply to Ray Leon from comment #7) > make code blocks? I don't know if it's possible in the version of Bugzilla we're using. I can see from other Bugzilla documentation that there should be a setting in your user preferences to enable Markdown rendering, but I don't see that option on my account. |