SUMMARY I am using the kdesrc-build version (so master build) of neochat and it seems if message contains this snippet in a room, it crashes Neochat when trying to open that room. ```html <main> <data value="2"></data> <!-- push 2 onto the stack --> <data value="3"></data> <!-- push 3 onto the stack --> <dd></dd> <!-- add the top two values on the stack --> <output></output> <!-- print the sum now on the top of the stack --> </main> ``` The raw json part of the message is like following: { "content": { "body": "```html\n<main>\n <data value=\"2\"></data> <!-- push 2 onto the stack -->\n <data value=\"3\"></data> <!-- push 3 onto the stack -->\n <dd></dd> <!-- add the top two values on the stack -->\n <output></output> <!-- print the sum now on the top of the stack -->\n</main>\n```", "format": "org.matrix.custom.html", "formatted_body": "<pre data-md=\"```\"><code class=\"language-html\"><main>\n <data value="2"></data> <!-- push 2 onto the stack -->\n <data value="3"></data> <!-- push 3 onto the stack -->\n <dd></dd> <!-- add the top two values on the stack -->\n <output></output> <!-- print the sum now on the top of the stack -->\n</main>\n</code></pre>", "msgtype": "m.text" }, STEPS TO REPRODUCE 1. Open a room 2. Send the html snippet from above in that room (from any other client) 3. Close and open the room with the message that has the html snippet OBSERVED RESULT Crash EXPECTED RESULT Pretty colors SOFTWARE/OS VERSIONS Operating System: Fedora Linux 39 KDE Plasma Version: 6.0.80 KDE Frameworks Version: 6.0.0 Qt Version: 6.6.2 Kernel Version: 6.7.6-200.fc39.x86_64 (64-bit) Graphics Platform: Wayland Processors: 12 × AMD Ryzen 5 3600 6-Core Processor Memory: 15.5 GiB of RAM Graphics Processor: AMD Radeon RX 6600 BACKTRACE Core was generated by `/home/akseli/Repositories/kde/usr/bin/neochat'. Program terminated with signal SIGABRT, Aborted. #0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44 44 return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0; [Current thread is 1 (Thread 0x7fad0843eb00 (LWP 79171))] (gdb) c The program is not being run. (gdb) bt #0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44 #1 0x00007fad0caae8a3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78 #2 0x00007fad0ca5c8ee in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 #3 0x00007fad0ca448ff in __GI_abort () at abort.c:79 #4 0x00007fad0d0e3523 in qAbort () at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/global/qglobal.cpp:161 #5 0x00007fad0d128bf0 in qt_message_fatal<QString&> (message=..., context=<optimized out>) at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/global/qlogging.cpp:2003 #6 qt_message(QtMsgType, const QMessageLogContext &, const char *, typedef __va_list_tag __va_list_tag *) (msgType=msgType@entry=QtFatalMsg, context=..., msg=msg@entry=0x7fad0d4a5db8 "ASSERT: \"%s\" in file %s, line %d", ap=ap@entry=0x7ffd88e06300) at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/global/qlogging.cpp:378 #7 0x00007fad0d0e44b3 in QMessageLogger::fatal (this=this@entry=0x7ffd88e063e8, msg=msg@entry=0x7fad0d4a5db8 "ASSERT: \"%s\" in file %s, line %d") at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/global/qlogging.cpp:901 #8 0x00007fad0d0e3478 in qt_assert (assertion=<optimized out>, file=<optimized out>, line=<optimized out>) at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/global/qassert.cpp:68 #9 0x00000000004ec59f in QString::first (this=0x7ffd88e06a10, n=471) at /usr/include/qt6/QtCore/qstring.h:338 #10 0x00000000004e486c in TextHandler::nextBlock (this=0x7ffd88e069b0, string=..., nextBlockPos=471, inputFormat=Qt::RichText, room=0x34cd600, event=0x3ff7dc0, isEdited=false) at /home/akseli/Repositories/kde/src/neochat/src/texthandler.cpp:339 #11 0x00000000004e7198 in TextHandler::textComponents (this=0x7ffd88e069b0, string=..., inputFormat=Qt::RichText, room=0x34cd600, event=0x3ff7dc0, isEdited=false) at /home/akseli/Repositories/kde/src/neochat/src/texthandler.cpp:550 #12 0x000000000085511d in MessageContentModel::updateComponents (this=0x5333be0, isEditing=false) at /home/akseli/Repositories/kde/src/neochat/src/models/messagecontentmodel.cpp:249 #13 0x00000000008540f1 in MessageContentModel::MessageContentModel (this=0x5333be0, event=0x3ff7dc0, room=0x34cd600) at /home/akseli/Repositories/kde/src/neochat/src/models/messagecontentmodel.cpp:100 #14 0x000000000077c953 in MessageEventModel::data (this=0x1fe3c80, idx=..., role=268) at /home/akseli/Repositories/kde/src/neochat/src/models/messageeventmodel.cpp:473 #15 0x00007fad0d427bcb in QModelIndex::data (arole=268, this=0x7ffd88e073b0) --Type <RET> for more, q to quit, c to continue without paging--c at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/itemmodels/qabstractitemmodel.h:493 #16 QConcatenateTablesProxyModel::data (this=<optimized out>, index=<optimized out>, role=268) at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp:160 #17 0x00007fad0d438ef9 in QSortFilterProxyModel::data (this=<optimized out>, index=<optimized out>, role=268) at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/itemmodels/qsortfilterproxymodel.cpp:2211 #18 0x000000000078b704 in MessageFilterModel::data (this=0x1fe4280, index=..., role=268) at /home/akseli/Repositories/kde/src/neochat/src/models/messagefiltermodel.cpp:100 #19 0x00007fad111bfde8 in QModelIndex::data (arole=268, this=0x7ffd88e07830) at /usr/include/qt6/QtCore/qabstractitemmodel.h:493 #20 QQmlDMAbstractItemModelData::value (this=this@entry=0x4b2d160, role=268) at /usr/src/debug/qt6-qtdeclarative-6.6.2-1.fc39.x86_64/src/qmlmodels/qqmldmabstractitemmodeldata.cpp:229 #21 0x00007fad111c0416 in QQmlDMAbstractItemModelData::metaCall (this=0x4b2d160, call=<optimized out>, id=<optimized out>, arguments=0x7ffd88e07980) at /usr/src/debug/qt6-qtdeclarative-6.6.2-1.fc39.x86_64/src/qmlmodels/qqmldmabstractitemmodeldata.cpp:30 #22 0x00007fad0d1b1797 in QMetaProperty::read (this=this@entry=0x7ffd88e07ad0, object=0x4b2d160) at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/kernel/qmetaobject.cpp:3645 #23 0x00007fad10e08cae in QQmlPropertyToPropertyBinding::update (this=0x5408900, flags=...) at /usr/src/debug/qt6-qtdeclarative-6.6.2-1.fc39.x86_64/src/qml/qml/qqmlpropertytopropertybinding.cpp:112 #24 0x00007fad111aa026 in QQDMIncubationTask::initializeRequiredProperties (this=<optimized out>, modelItemToIncubate=<optimized out>, object=<optimized out>) at /usr/src/debug/qt6-qtdeclarative-6.6.2-1.fc39.x86_64/src/qmlmodels/qqmldelegatemodel.cpp:984 #25 0x00007fad111aa2d7 in QQmlDelegateModelPrivate::setInitialState (this=0x2578ca0, incubationTask=0x5a0e590, o=0x4b3b0e0) at /usr/src/debug/qt6-qtdeclarative-6.6.2-1.fc39.x86_64/src/qmlmodels/qqmldelegatemodel.cpp:1160 #26 0x00007fad10d956c5 in QQmlIncubatorPrivate::incubate (this=this@entry=0x4b27280, i=...) at /usr/src/debug/qt6-qtdeclarative-6.6.2-1.fc39.x86_64/src/qml/qml/qqmlincubator.cpp:321 #27 0x00007fad10d959ef in QQmlEnginePrivate::incubate (this=0x1baf530, i=<optimized out>, forContext=<optimized out>) at /usr/src/debug/qt6-qtdeclarative-6.6.2-1.fc39.x86_64/src/qml/qml/qqmlincubator.cpp:53 #28 0x00007fad111ae12c in QQmlDelegateModelPrivate::object (this=0x2578ca0, group=QQmlListCompositor::Default, index=6, incubationMode=<optimized out>) at /usr/src/debug/qt6-qtdeclarative-6.6.2-1.fc39.x86_64/src/qmlmodels/qqmldelegatemodel.cpp:1284 #29 0x00007fad116fb5bb in QQuickItemViewPrivate::createItem (this=this@entry=0x47b4410, modelIndex=6, incubationMode=incubationMode@entry=QQmlIncubator::Synchronous) at /usr/src/debug/qt6-qtdeclarative-6.6.2-1.fc39.x86_64/src/quick/items/qquickitemview.cpp:2368 #30 0x00007fad11714cc8 in QQuickListViewPrivate::applyInsertionChange (this=<optimized out>, change=..., insertResult=0x7ffd88e081f0, addedItems=0x7ffd88e081b0, movingIntoView=0x7ffd88e081d0) at /usr/src/debug/qt6-qtdeclarative-6.6.2-1.fc39.x86_64/src/quick/items/qquicklistview.cpp:3773 #31 0x00007fad116fd1e2 in QQuickItemViewPrivate::applyModelChanges (this=this@entry=0x47b4410, totalInsertionResult=totalInsertionResult@entry=0x7ffd88e082f0, totalRemovalResult=totalRemovalResult@entry=0x7ffd88e08320) at /usr/src/debug/qt6-qtdeclarative-6.6.2-1.fc39.x86_64/src/quick/items/qquickitemview.cpp:2066 #32 0x00007fad116fdd60 in QQuickItemViewPrivate::layout (this=0x47b4410) at /usr/src/debug/qt6-qtdeclarative-6.6.2-1.fc39.x86_64/src/quick/items/qquickitemview.cpp:1887 #33 0x00007fad114e74fd in QQuickWindowPrivate::polishItems (this=0x1d63ca0) at /usr/src/debug/qt6-qtdeclarative-6.6.2-1.fc39.x86_64/src/quick/items/qquickwindow.cpp:347 #34 0x00007fad116c51a3 in QSGThreadedRenderLoop::polishAndSync (this=0x1fe1e60, w=0x20bf7e0, inExpose=false) at /usr/src/debug/qt6-qtdeclarative-6.6.2-1.fc39.x86_64/src/quick/scenegraph/qsgthreadedrenderloop.cpp:1588 #35 0x00007fad114e9cb4 in QQuickWindow::event (this=<optimized out>, event=<optimized out>) at /usr/src/debug/qt6-qtdeclarative-6.6.2-1.fc39.x86_64/src/quick/items/qquickwindow.cpp:1544 #36 0x00007fad0e3c3228 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x1ff1e30, e=0x7ffd88e08940) at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/widgets/kernel/qapplication.cpp:3296 #37 0x00007fad0d1a0948 in QCoreApplication::notifyInternal2 (receiver=0x1ff1e30, event=0x7ffd88e08940) at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/kernel/qcoreapplication.cpp:1121 #38 0x00007fad0d1a0b4d in QCoreApplication::sendEvent (receiver=<optimized out>, event=<optimized out>) at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/kernel/qcoreapplication.cpp:1539 #39 0x00007fad0da4b191 in QPlatformWindow::deliverUpdateRequest (this=<optimized out>) at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/gui/kernel/qplatformwindow.cpp:783 #40 0x00007fad0d1f2f87 in QObject::event (this=0x2637460, e=0x7facec00e9b0) at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/kernel/qobject.cpp:1437 #41 0x00007fad0e3c3228 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x2637460, e=0x7facec00e9b0) at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/widgets/kernel/qapplication.cpp:3296 #42 0x00007fad0d1a0948 in QCoreApplication::notifyInternal2 (receiver=0x2637460, event=0x7facec00e9b0) at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/kernel/qcoreapplication.cpp:1121 #43 0x00007fad0d1a0b4d in QCoreApplication::sendEvent (receiver=<optimized out>, event=<optimized out>) at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/kernel/qcoreapplication.cpp:1539 #44 0x00007fad0d1a4845 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x193f5a0) at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/kernel/qcoreapplication.cpp:1901 #45 0x00007fad0d1a4bbd in QCoreApplication::sendPostedEvents (receiver=<optimized out>, event_type=<optimized out>) at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/kernel/qcoreapplication.cpp:1760 #46 0x00007fad0d46c86f in postEventSourceDispatch (s=0x1a8e7d0) at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/kernel/qeventdispatcher_glib.cpp:243 #47 0x00007fad0c92fe5c in g_main_dispatch (context=0x7facf4000ef0) at ../glib/gmain.c:3476 #48 g_main_context_dispatch_unlocked (context=0x7facf4000ef0) at ../glib/gmain.c:4284 #49 0x00007fad0c98af18 in g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x7facf4000ef0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4349 #50 0x00007fad0c92dad3 in g_main_context_iteration (context=0x7facf4000ef0, may_block=1) at ../glib/gmain.c:4414 #51 0x00007fad0d46c11f in QEventDispatcherGlib::processEvents (this=0x1a03420, flags=...) at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/kernel/qeventdispatcher_glib.cpp:393 #52 0x00007fad0d1ad70b in QEventLoop::exec (this=this@entry=0x7ffd88e08df0, flags=..., flags@entry=...) at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/global/qflags.h:34 #53 0x00007fad0d1a950d in QCoreApplication::exec () at /usr/src/debug/qt6-qtbase-6.6.2-1.fc39.x86_64/src/corelib/global/qflags.h:74 #54 0x0000000000435a0a in main (argc=1, argv=0x7ffd88e09c18) at /home/akseli/Repositories/kde/src/neochat/src/main.cpp:272
Forgot to mention, I removed the extra bits of that json bit since it was just the channel/user info etc.
I think this should fix it can you give it a whirl https://invent.kde.org/network/neochat/-/merge_requests/1635
Git commit 1dcfd9432870b54c6003eb8e0978ccfe817fb9f7 by James Graham. Committed on 24/03/2024 at 10:01. Pushed by nvrwhere into branch 'master'. Fix Message Components for Tags with Attributes Don't assume that the close tag is the length of the start tag +1 M +13 -0 autotests/texthandlertest.cpp M +3 -2 src/texthandler.cpp https://invent.kde.org/network/neochat/-/commit/1dcfd9432870b54c6003eb8e0978ccfe817fb9f7