Bug 478230 - Kate snippets: crash when editing a snippet repository
Summary: Kate snippets: crash when editing a snippet repository
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: plugin-snippets (show other bugs)
Version: 23.08.3
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2023-12-07 21:54 UTC by Lassi Väätämöinen
Modified: 2024-01-20 21:38 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 24.02.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lassi Väätämöinen 2023-12-07 21:54:43 UTC
Application: kate (23.08.3)

Qt Version: 5.15.11
Frameworks Version: 5.112.0
Operating System: Linux 6.6.3-1-default x86_64
Windowing System: X11
Distribution: "openSUSE Tumbleweed"
DrKonqi: 5.27.9 [KCrashBackend]

-- Information about the crash:
STEPS TO REPRODUCE
1. Use a snippet by selecting it from the right-hand side Snippets panel
2. Press Edit Repository button at the top of the snippets view while being at a snippet field

EXPECTED BEHAVIOR
Snippet repository information could be changed

ACTUAL BEHAVIOR
Kate closes (crash)

SYSTEM INFO

Operating System: openSUSE Tumbleweed 20231203
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.112.0
Qt Version: 5.15.11
Kernel Version: 6.6.3-1-default (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 15,5 GiB of RAM
Graphics Processor: AMD Radeon RX 580 Series
Manufacturer: Micro-Star International Co., Ltd.
Product Name: MS-7B79
System Version: 4.0

The crash can be reproduced every time.

-- Backtrace:
Application: Kate (kate), signal: Segmentation fault

[KCrash Handler]
#4  std::__atomic_base<int>::load(std::memory_order) const (__m=std::memory_order_relaxed, this=0x31) at /usr/include/c++/13/bits/atomic_base.h:503
#5  QAtomicOps<int>::loadRelaxed<int>(std::atomic<int> const&) (_q_value=<error reading variable: Cannot access memory at address 0x31>) at /usr/include/qt5/QtCore/qatomic_cxx11.h:239
#6  QBasicAtomicInteger<int>::loadRelaxed() const (this=0x31) at /usr/include/qt5/QtCore/qbasicatomic.h:107
#7  QtPrivate::RefCount::ref() (this=0x31) at /usr/include/qt5/QtCore/qrefcount.h:55
#8  QList<QString>::QList(QList<QString> const&) (l=..., this=0x7ffd8a0e00e0) at /usr/include/qt5/QtCore/qlist.h:856
#9  QStringList::QStringList(QStringList const&) (this=0x7ffd8a0e00e0, this=<optimized out>) at /usr/include/qt5/QtCore/qstringlist.h:111
#10 SnippetRepository::fileTypes() const (this=0x55c97c4539b0) at /usr/src/debug/kate-23.08.3/addons/snippets/snippetrepository.cpp:115
#11 EditSnippet::EditSnippet(SnippetRepository*, Snippet*, QWidget*) (this=0x7ffd8a0e0140, repository=<optimized out>, snippet=<optimized out>, parent=<optimized out>, this=<optimized out>, repository=<optimized out>, snippet=<optimized out>, parent=<optimized out>) at /usr/src/debug/kate-23.08.3/addons/snippets/editsnippet.cpp:68
#12 0x00007f3398aa921f in SnippetView::slotAddSnippet() (this=0x55c97c3a19a0) at /usr/src/debug/kate-23.08.3/addons/snippets/snippetview.cpp:266
#13 0x00007f33ccf25442 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffd8a0e02c0, r=0x55c97c3a19a0, this=0x55c97c3b4350) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#14 doActivate<false>(QObject*, int, void**) (sender=0x55c97c3b4330, signal_index=4, argv=0x7ffd8a0e02c0) at kernel/qobject.cpp:3925
#15 0x00007f33ccf1e0af in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x55c97c3b4330, m=m@entry=0x7f33ce0bacc0 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffd8a0e02c0) at kernel/qobject.cpp:3985
#16 0x00007f33cdb9e8b2 in QAction::triggered(bool) (this=this@entry=0x55c97c3b4330, _t1=<optimized out>) at .moc/moc_qaction.cpp:376
#17 0x00007f33cdba142f in QAction::activate(QAction::ActionEvent) (this=0x55c97c3b4330, event=<optimized out>) at kernel/qaction.cpp:1161
#18 0x00007f33cdc9864a in QAbstractButtonPrivate::click() (this=0x55c97c3b9aa0) at widgets/qabstractbutton.cpp:399
#19 0x00007f33cdc98797 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) (this=0x55c97c3b9660, e=0x7ffd8a0e0850) at widgets/qabstractbutton.cpp:1045
#20 0x00007f33cdd9104a in QToolButton::mouseReleaseEvent(QMouseEvent*) (this=<optimized out>, e=<optimized out>) at widgets/qtoolbutton.cpp:622
#21 0x00007f33cdbe6d58 in QWidget::event(QEvent*) (this=0x55c97c3b9660, event=0x7ffd8a0e0850) at kernel/qwidget.cpp:9045
#22 0x00007f33cdba519e in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=this@entry=0x55c97b61f8a0, receiver=receiver@entry=0x55c97c3b9660, e=e@entry=0x7ffd8a0e0850) at kernel/qapplication.cpp:3640
#23 0x00007f33cdbad5cf in QApplication::notify(QObject*, QEvent*) (this=<optimized out>, receiver=<optimized out>, e=0x7ffd8a0e0850) at kernel/qapplication.cpp:3084
#24 0x00007f33cceed198 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55c97c3b9660, event=0x7ffd8a0e0850) at kernel/qcoreapplication.cpp:1064
#25 0x00007f33cceed36e in QCoreApplication::sendSpontaneousEvent(QObject*, QEvent*) (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1474
#26 0x00007f33cdbab92e in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) (receiver=receiver@entry=0x55c97c3b9660, event=event@entry=0x7ffd8a0e0850, alienWidget=<optimized out>, nativeWidget=0x55c97bba3460, buttonDown=buttonDown@entry=0x7f33ce0f2330 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at kernel/qapplication.cpp:2622
#27 0x00007f33cdbff7ed in QWidgetWindow::handleMouseEvent(QMouseEvent*) (this=this@entry=0x55c97c3d90a0, event=event@entry=0x7ffd8a0e0b00) at kernel/qwidgetwindow.cpp:684
#28 0x00007f33cdc02d0f in QWidgetWindow::event(QEvent*) (this=0x55c97c3d90a0, event=0x7ffd8a0e0b00) at kernel/qwidgetwindow.cpp:300
#29 0x00007f33cdba519e in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x55c97c3d90a0, e=0x7ffd8a0e0b00) at kernel/qapplication.cpp:3640
#30 0x00007f33cceed198 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55c97c3d90a0, event=0x7ffd8a0e0b00) at kernel/qcoreapplication.cpp:1064
#31 0x00007f33cceed36e in QCoreApplication::sendSpontaneousEvent(QObject*, QEvent*) (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1474
#32 0x00007f33cd37d0db in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) (e=0x55c97d52f2e0) at kernel/qguiapplication.cpp:2285
#33 0x00007f33cd35038c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) (flags=flags@entry=...) at kernel/qwindowsysteminterface.cpp:1169
#34 0x00007f33c68f954a in xcbSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>) at qxcbeventdispatcher.cpp:105
#35 0x00007f33ca913f30 in g_main_dispatch (context=0x7f33c0000ec0) at ../glib/gmain.c:3476
#36 g_main_context_dispatch_unlocked (context=context@entry=0x7f33c0000ec0) at ../glib/gmain.c:4284
#37 0x00007f33ca915b58 in g_main_context_iterate_unlocked (context=context@entry=0x7f33c0000ec0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4349
#38 0x00007f33ca91620c in g_main_context_iteration (context=0x7f33c0000ec0, may_block=1) at ../glib/gmain.c:4414
#39 0x00007f33ccf460d6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x55c97b709700, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#40 0x00007f33cceebc2b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffd8a0e0e30, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#41 0x00007f33ccef40c0 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#42 0x00007f33cd37057c in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1870
#43 0x00007f33cdba5115 in QApplication::exec() () at kernel/qapplication.cpp:2832
#44 0x000055c97a060478 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kate-23.08.3/apps/kate/main.cpp:609
[Inferior 1 (process 20505) detached]

Reported using DrKonqi
Comment 1 Lassi Väätämöinen 2023-12-07 23:03:47 UTC
Looks like it is easier to crash when a snippet is selected in the snippet side panel, and then clicking "Add snippet".
Comment 2 Christoph Cullmann 2024-01-20 21:37:15 UTC
Git commit e2db4cef84f5e8e7e0c00fe069966cdf48f363e0 by Christoph Cullmann.
Committed on 20/01/2024 at 22:37.
Pushed by cullmann into branch 'master'.

fix Kate snippets: crash when editing a snippet repository

M  +1    -1    addons/snippets/snippet.h

https://invent.kde.org/utilities/kate/-/commit/e2db4cef84f5e8e7e0c00fe069966cdf48f363e0
Comment 3 Christoph Cullmann 2024-01-20 21:37:50 UTC
Git commit a6bc7ac3883fd7e1dd6b9486e0f0278f7ac2894c by Christoph Cullmann.
Committed on 20/01/2024 at 22:37.
Pushed by cullmann into branch 'release/24.02'.

fix Kate snippets: crash when editing a snippet repository


(cherry picked from commit e2db4cef84f5e8e7e0c00fe069966cdf48f363e0)

M  +1    -1    addons/snippets/snippet.h

https://invent.kde.org/utilities/kate/-/commit/a6bc7ac3883fd7e1dd6b9486e0f0278f7ac2894c