Bug 466045

Summary: NeoChat crashed at Quotient::Room::connection() when entering a room
Product: [Applications] NeoChat Reporter: Fushan Wen <qydwhotmail>
Component: GeneralAssignee: Tobias Fella <fella>
Status: RESOLVED FIXED    
Severity: crash CC: carl
Priority: NOR Keywords: drkonqi
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Fushan Wen 2023-02-19 02:23:42 UTC
Application: neochat (23.03.70)

Qt Version: 5.15.8
Frameworks Version: 5.104.0
Operating System: Linux 6.1.10-1-default x86_64
Windowing System: X11
Distribution: "openSUSE Tumbleweed"
DrKonqi: 5.27.80 [KCrashBackend]

-- Information about the crash:
When I clicked a room in the list, NeoChat crashed.

The crash can be reproduced sometimes.

-- Backtrace:
Application: NeoChat (neochat), signal: Segmentation fault
Content of s_kcrashErrorMessage: std::unique_ptr<char []> = {get() = <optimized out>}
[KCrash Handler]
#6  Quotient::Room::connection() const (this=0x0) at /usr/src/debug/libQuotient-0.6.11/lib/room.cpp:2263
#7  0x00007f7588142589 in Quotient::Room::user(QString const&) const (this=<optimized out>, userId=...) at /usr/src/debug/libQuotient-0.6.11/lib/room.cpp:619
#8  0x00007f7588149777 in Quotient::Room::roomMembername(QString const&) const (this=this@entry=0x0, userId=...) at /usr/src/debug/libQuotient-0.6.11/lib/room.cpp:1520
#9  0x00007f75881497e4 in Quotient::Room::safeMemberName(QString const&) const (this=this@entry=0x0, userId=...) at /usr/src/debug/libQuotient-0.6.11/lib/room.cpp:1527
#10 0x00005607bed473fb in UserListModel::findUserPos(Quotient::User*) const (this=this@entry=0x5607c31c6ff0, user=user@entry=0x5607c514eb00) at /usr/src/debug/neochat-1.0.80git.20230215T182251~f186be7/src/models/userlistmodel.cpp:215
#11 0x00005607bed49d0d in UserListModel::refresh(Quotient::User*, QVector<int> const&) (this=this@entry=0x5607c31c6ff0, user=user@entry=0x5607c514eb00, roles=...) at /usr/src/debug/neochat-1.0.80git.20230215T182251~f186be7/src/models/userlistmodel.cpp:170
#12 0x00005607bed49f25 in UserListModel::avatarChanged(Quotient::User*, Quotient::Room const*) (context=<optimized out>, user=0x5607c514eb00, this=0x5607c31c6ff0) at /usr/src/debug/neochat-1.0.80git.20230215T182251~f186be7/src/models/userlistmodel.cpp:209
#13 UserListModel::avatarChanged(Quotient::User*, Quotient::Room const*) (this=0x5607c31c6ff0, user=0x5607c514eb00, context=<optimized out>) at /usr/src/debug/neochat-1.0.80git.20230215T182251~f186be7/src/models/userlistmodel.cpp:206
#14 0x00007f758611338d in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffcb66f9730, r=0x5607c31c6ff0, this=0x5607c792c570) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#15 doActivate<false>(QObject*, int, void**) (sender=0x5607c514eb00, signal_index=5, argv=0x7ffcb66f9730) at kernel/qobject.cpp:3923
#16 0x00007f758610c80f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=<optimized out>, m=m@entry=0x7f75881f4140, local_signal_index=local_signal_index@entry=2, argv=argv@entry=0x7ffcb66f9730) at kernel/qobject.cpp:3983
#17 0x00007f7588118997 in Quotient::User::avatarChanged(Quotient::User*, Quotient::Room const*) (this=<optimized out>, _t1=<optimized out>, _t2=<optimized out>) at /usr/src/debug/libQuotient-0.6.11/build/Quotient_autogen/ZJOKMXDKB7/moc_user.cpp:361
#18 0x00007f758611338d in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffcb66f9830, r=0x5607c514eb00, this=0x5607cee55c70) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#19 doActivate<false>(QObject*, int, void**) (sender=0x5607ceb31780, signal_index=10, argv=0x7ffcb66f9830) at kernel/qobject.cpp:3923
#20 0x00007f758610c80f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=<optimized out>, m=m@entry=0x7f75881f4340, local_signal_index=local_signal_index@entry=7, argv=argv@entry=0x7ffcb66f9830) at kernel/qobject.cpp:3983
#21 0x00007f7588117522 in Quotient::BaseJob::success(Quotient::BaseJob*) (this=<optimized out>, _t1=<optimized out>) at /usr/src/debug/libQuotient-0.6.11/build/Quotient_autogen/3INUWTIJ2C/moc_basejob.cpp:542
#22 0x00007f758817ff49 in Quotient::BaseJob::finishJob() (this=0x5607ceb31780) at /usr/src/debug/libQuotient-0.6.11/lib/jobs/basejob.cpp:646
#23 0x00007f758611338d in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffcb66f9970, r=0x5607ceb31780, this=0x5607ca780c00) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#24 doActivate<false>(QObject*, int, void**) (sender=0x5607cadffa20, signal_index=10, argv=0x7ffcb66f9970) at kernel/qobject.cpp:3923
#25 0x00007f758610c80f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x5607cadffa20, m=m@entry=0x7f7587730320 <QNetworkReply::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x0) at kernel/qobject.cpp:3983
#26 0x00007f75876cfd73 in QNetworkReply::finished() (this=this@entry=0x5607cadffa20) at .moc/moc_qnetworkreply.cpp:404
#27 0x00007f7587644358 in QNetworkReplyHttpImplPrivate::finished() (this=0x5607ce6558e0) at access/qnetworkreplyhttpimpl.cpp:2280
#28 0x00007f7586107d00 in QObject::event(QEvent*) (this=0x5607cadffa20, e=0x7f7500726c70) at kernel/qobject.cpp:1347
#29 0x00007f7586da544e in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x5607cadffa20, e=0x7f7500726c70) at kernel/qapplication.cpp:3640
#30 0x00007f75860dc1e8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x5607cadffa20, event=0x7f7500726c70) at kernel/qcoreapplication.cpp:1064
#31 0x00007f75860df181 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x5607c0c28f50) at kernel/qcoreapplication.cpp:1821
#32 0x00007f7586134413 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x5607c0d9b2e0) at kernel/qeventdispatcher_glib.cpp:277
#33 0x00007f7585576a90 in g_main_dispatch (context=0x7f757c005010) at ../glib/gmain.c:3454
#34 g_main_context_dispatch (context=context@entry=0x7f757c005010) at ../glib/gmain.c:4172
#35 0x00007f7585576e48 in g_main_context_iterate (context=context@entry=0x7f757c005010, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4248
#36 0x00007f7585576edc in g_main_context_iteration (context=0x7f757c005010, may_block=1) at ../glib/gmain.c:4313
#37 0x00007f7586133c16 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x5607c0d9c2d0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#38 0x00007f75860dac5b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffcb66f9df0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#39 0x00007f75860e2dc6 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#40 0x00007f758656ed3c in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1870
#41 0x00007f7586da53c5 in QApplication::exec() () at kernel/qapplication.cpp:2832
#42 0x00005607bec2d7ef in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/neochat-1.0.80git.20230215T182251~f186be7/src/main.cpp:336
[Inferior 1 (process 22067) detached]

Reported using DrKonqi
Comment 1 Tobias Fella 2023-03-22 19:45:44 UTC
Bot seems to be slow, so: https://invent.kde.org/network/neochat/-/merge_requests/855
Comment 2 Tobias Fella 2023-03-28 12:06:54 UTC
Git commit 34ad743e9859c59c1482d45aa43f636143d09449 by Tobias Fella.
Committed on 28/03/2023 at 11:47.
Pushed by tfella into branch 'master'.

Don't crash in UserListModel when there is no room

M  +3    -0    src/models/userlistmodel.cpp

https://invent.kde.org/network/neochat/commit/34ad743e9859c59c1482d45aa43f636143d09449