Bug 502687

Summary: Neochat crashes when opening notification window
Product: [Applications] NeoChat Reporter: Evan Maddock <maddock.evan>
Component: GeneralAssignee: Tobias Fella <fella>
Status: RESOLVED FIXED    
Severity: crash CC: carl, josh
Priority: NOR    
Version First Reported In: 24.12.3   
Target Milestone: ---   
Platform: Solus   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Evan Maddock 2025-04-11 18:14:57 UTC
SUMMARY

When clicking the "Open All Notifications" button at the top left of NeoChat, a window appears, and NeoChat crashes a few seconds later.

STEPS TO REPRODUCE
1. Open NeoChat
2. Click the Open All Notifications button

OBSERVED RESULT

A blank window appears for a few seconds, then NeoChat crashes.

EXPECTED RESULT

The window to populate with notifications.

SOFTWARE/OS VERSIONS
NeoChat: 24.12.3
Solus 4.7 Endurance (Wayland)
libQuotient: 0.9.3 (built against 0.9.1)
KDE Frameworks: 6.12.0
Qt: Using 6.8.3 and built against 6.8.1
Build ABI: x86_64-little_endian-lp64
Kernel: linux 6.12.21-316.current

ADDITIONAL INFORMATION

GDB backtrace:
#0  NotificationsModel::loadData()::$_0::operator()() const (this=<optimized out>) at /home/build/YPKG/root/neochat/build/neochat-24.12.3/src/models/notificationsmodel.cpp:127
#1  QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, NotificationsModel::loadData()::$_0>::call(NotificationsModel::loadData()::$_0&, void**)::{lambda()#1}::operator()() const
    (this=<optimized out>) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:141
#2  QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, NotificationsModel::loadData()::$_0>::call(NotificationsModel::loadData()::$_0&, v
#3  QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, NotificationsModel::loadData()::$_0>::call(NotificationsModel::loadData()::$_0&, void**) (f=<optimized out>, arg=<optimized out>)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:140
#4  QtPrivate::FunctorCallable<NotificationsModel::loadData()::$_0>::call<QtPrivate::List<>, void>(NotificationsModel::loadData()::$_0&, void*, void**) (f=<optimized out>, arg=<optimized out>)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:362
#5  QtPrivate::QCallableObject<NotificationsModel::loadData()::$_0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)
    (which=<optimized out>, this_=<optimized out>, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:572
#6  0x00007ffff493e354 in QtPrivate::QSlotObjectBase::call (this=0x55555deb3da0, r=0x55555d52eea0, a=0x7fffffffd0c0)
    at /home/build/YPKG/root/qt6-base/build/qtbase-everywhere-src-6.8.3/src/corelib/kernel/qobjectdefs_impl.h:486
#7  doActivate<false> (sender=0x55555e53a8c0, signal_index=8, argv=0x7fffffffd0c0) at /home/build/YPKG/root/qt6-base/build/qtbase-everywhere-src-6.8.3/src/corelib/kernel/qobject.cpp:4123
#8  0x00007ffff681186f in Quotient::BaseJob::finished (this=0x55555e53a8c0, _t1=0x55555e53a8c0) at QuotientQt6_autogen/T4CFEN5LXH/moc_basejob.cpp:523
#9  Quotient::BaseJob::finishJob (this=0x55555e53a8c0) at /home/build/YPKG/root/libquotient/build/libQuotient-0.9.3/Quotient/jobs/basejob.cpp:611
#10 0x00007ffff493e354 in QtPrivate::QSlotObjectBase::call (this=0x55555bda71c0, r=0x55555e53a8c0, a=0x7fffffffd198)
    at /home/build/YPKG/root/qt6-base/build/qtbase-everywhere-src-6.8.3/src/corelib/kernel/qobjectdefs_impl.h:486
#11 doActivate<false> (sender=0x55555d2b2ec0, signal_index=12, argv=0x7fffffffd198) at /home/build/YPKG/root/qt6-base/build/qtbase-everywhere-src-6.8.3/src/corelib/kernel/qobject.cpp:4123
#12 0x00007ffff4f9117c in QNetworkReply::finished (this=0x55555d2b2ec0) at src/network/Network_autogen/include/moc_qnetworkreply.cpp:438
#13 QNetworkReplyHttpImplPrivate::finished (this=0x55555d2b4d70) at /home/build/YPKG/root/qt6-base/build/qtbase-everywhere-src-6.8.3/src/network/access/qnetworkreplyhttpimpl.cpp:2158
#14 0x00007ffff4933d0a in QObject::event (this=0x55555d2b2ec0, e=0x7fff2c0562d0) at /home/build/YPKG/root/qt6-base/build/qtbase-everywhere-src-6.8.3/src/corelib/kernel/qobject.cpp:1418
#15 0x00007ffff5e4d310 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x55555d2b2ec0, e=0x7fff2c0562d0)
    at /home/build/YPKG/root/qt6-base/build/qtbase-everywhere-src-6.8.3/src/widgets/kernel/qapplication.cpp:3296
#16 0x00007ffff5e4e553 in QApplication::notify (this=<optimized out>, receiver=0x55555d2b2ec0, e=0x7fff2c0562d0)
    at /home/build/YPKG/root/qt6-base/build/qtbase-everywhere-src-6.8.3/src/widgets/kernel/qapplication.cpp:2689
#17 0x00007ffff48dc27f in QCoreApplication::notifyInternal2 (receiver=0x55555d2b2ec0, event=0x7fff2c0562d0)
    at /home/build/YPKG/root/qt6-base/build/qtbase-everywhere-src-6.8.3/src/corelib/kernel/qcoreapplication.cpp:1177
#18 0x00007ffff48dd593 in QCoreApplication::sendEvent (receiver=0x55555d2b2ec0, event=<optimized out>)
    at /home/build/YPKG/root/qt6-base/build/qtbase-everywhere-src-6.8.3/src/corelib/kernel/qcoreapplication.cpp:1617
#19 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x555555b75b30)
    at /home/build/YPKG/root/qt6-base/build/qtbase-everywhere-src-6.8.3/src/corelib/kernel/qcoreapplication.cpp:1951
#20 0x00007ffff4beadfb in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at /home/build/YPKG/root/qt6-base/build/qtbase-everywhere-src-6.8.3/src/corelib/kernel/qcoreapplication.cpp:1805
#21 postEventSourceDispatch (s=0x555555bec800) at /home/build/YPKG/root/qt6-base/build/qtbase-everywhere-src-6.8.3/src/corelib/kernel/qeventdispatcher_glib.cpp:246
#22 0x00007ffff3eee688 in g_main_dispatch (context=0x7fffe8000f00) at ../glib/gmain.c:3357
#23 0x00007ffff3f7a49d in g_main_context_dispatch_unlocked (context=0x7fffe8000f00) at ../glib/gmain.c:4208
#24 g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x7fffe8000f00, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4273
#25 0x00007ffff3eece74 in g_main_context_iteration (context=0x7fffe8000f00, may_block=1) at ../glib/gmain.c:4338
#26 0x00007ffff4bea6d6 in QEventDispatcherGlib::processEvents (this=0x555555bf09c0, flags=...)
    at /home/build/YPKG/root/qt6-base/build/qtbase-everywhere-src-6.8.3/src/corelib/kernel/qeventdispatcher_glib.cpp:399
#27 0x00007ffff48e7966 in QEventLoop::processEvents (this=0x7fffffffd7b0, flags=...) at /home/build/YPKG/root/qt6-base/build/qtbase-everywhere-src-6.8.3/src/corelib/kernel/qeventloop.cpp:103
#28 QEventLoop::exec (this=0x7fffffffd7b0, flags=...) at /home/build/YPKG/root/qt6-base/build/qtbase-everywhere-src-6.8.3/src/corelib/kernel/qeventloop.cpp:185
#29 0x00007ffff48dcace in QCoreApplication::exec () at /home/build/YPKG/root/qt6-base/build/qtbase-everywhere-src-6.8.3/src/corelib/kernel/qcoreapplication.cpp:1520
#30 0x00005555557dbb41 in main (argc=1, argv=<optimized out>) at /home/build/YPKG/root/neochat/build/neochat-24.12.3/src/main.cpp:309
Comment 1 Bug Janitor Service 2025-05-14 22:54:47 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/neochat/-/merge_requests/2273
Comment 2 Joshua Goins 2025-05-15 17:39:40 UTC
Git commit a1513b30cd3b7cf4d01d99facae9c8de9cccea97 by Joshua Goins.
Committed on 15/05/2025 at 17:39.
Pushed by redstrate into branch 'master'.

Check if RoomEvent is null before trying to insert a notification

As seen in the bug report, roomEvent could be null and then we get a
nice and simple null-access error. We should be careful before trying to
use it.

M  +4    -0    src/app/models/notificationsmodel.cpp

https://invent.kde.org/network/neochat/-/commit/a1513b30cd3b7cf4d01d99facae9c8de9cccea97
Comment 3 Joshua Goins 2025-05-15 17:56:43 UTC
Git commit 61bb1c5db11356f7ecf2c48686e44d1bea18d455 by Joshua Goins.
Committed on 15/05/2025 at 17:43.
Pushed by redstrate into branch 'release/25.04'.

Check if RoomEvent is null before trying to insert a notification

As seen in the bug report, roomEvent could be null and then we get a
nice and simple null-access error. We should be careful before trying to
use it.
(cherry picked from commit a1513b30cd3b7cf4d01d99facae9c8de9cccea97)

M  +4    -0    src/models/notificationsmodel.cpp

https://invent.kde.org/network/neochat/-/commit/61bb1c5db11356f7ecf2c48686e44d1bea18d455