Bug 514512 - KSystemClipboard crashes in WaylandClipboard::~WaylandClipboard
Summary: KSystemClipboard crashes in WaylandClipboard::~WaylandClipboard
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kguiaddons
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 6.22.0
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-12 20:38 UTC by Peter Kaplan
Modified: 2026-01-13 22:45 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.22.1
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Kaplan 2026-01-12 20:38:06 UTC
* wlroots master with the new wayland protocols ext-image-copy-capture-v1 and ext-image-capture-sourcev1
* Copy to clipboard with flameshot 13.3.0 causes segfault

Core was generated by `/usr/bin/flameshot'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007245f5c8668c in QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::get (this=<optimized out>, this=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/tools/qscopedpointer.h:112
112	        return d;
[Current thread is 1 (Thread 0x7245f54144c0 (LWP 6681))]
(gdb) bt
#0  0x00007245f5c8668c in QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::get (this=<optimized out>, 
    this=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/tools/qscopedpointer.h:112
#1  qGetPtrHelper<QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> > const> (ptr=..., ptr=...)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qtclasshelpermacros.h:137
#2  QThread::d_func (this=0x0) at /usr/src/debug/qt6-base/qtbase/src/corelib/thread/qthread.h:122
#3  QThread::isRunning (this=0x0) at /usr/src/debug/qt6-base/qtbase/src/corelib/thread/qthread.cpp:515
#4  0x00007245f74df5a8 in WaylandClipboard::~WaylandClipboard (this=<optimized out>, this=<optimized out>)
    at /usr/src/debug/kguiaddons/kguiaddons-6.22.0/src/systemclipboard/waylandclipboard.cpp:622
#5  0x00007245f74e1964 in WaylandClipboard::~WaylandClipboard (this=<optimized out>, this=<optimized out>)
    at /usr/src/debug/kguiaddons/kguiaddons-6.22.0/src/systemclipboard/waylandclipboard.cpp:620
#6  WaylandClipboard::create (parent=<optimized out>)
    at /usr/src/debug/kguiaddons/kguiaddons-6.22.0/src/systemclipboard/waylandclipboard.cpp:634
#7  KSystemClipboard::instance () at /usr/src/debug/kguiaddons/kguiaddons-6.22.0/src/systemclipboard/ksystemclipboard.cpp:30
#8  KSystemClipboard::instance () at /usr/src/debug/kguiaddons/kguiaddons-6.22.0/src/systemclipboard/ksystemclipboard.cpp:18
#9  0x000061998c12a5de in saveToClipboardMime (capture=..., imageType=...)
    at /usr/src/debug/flameshot/flameshot-13.3.0/src/utils/screenshotsaver.cpp:176
#10 0x000061998c12bdc9 in saveToClipboard (capture=...) at /usr/src/debug/flameshot/flameshot-13.3.0/src/utils/screenshotsaver.cpp:213
#11 0x000061998c0d97bd in FlameshotDaemon::attachScreenshotToClipboard (this=0x6199ab4a77b0, pixmap=...)
    at /usr/src/debug/flameshot/flameshot-13.3.0/src/core/flameshotdaemon.cpp:310
#12 FlameshotDaemon::attachScreenshotToClipboard (this=0x6199ab4a77b0, screenshot=...)
    at /usr/src/debug/flameshot/flameshot-13.3.0/src/core/flameshotdaemon.cpp:334
#13 FlameshotDBusAdapter::attachScreenshotToClipboard (this=<optimized out>, data=...)
    at /usr/src/debug/flameshot/flameshot-13.3.0/src/core/flameshotdbusadapter.cpp:15
#14 FlameshotDBusAdapter::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>)
    at /usr/src/debug/flameshot/build/src/flameshot_autogen/TAC5DWH4SE/moc_flameshotdbusadapter.cpp:93
#15 0x000061998c0df002 in FlameshotDBusAdapter::qt_metacall (this=0x6199ab318cb0, _c=QMetaObject::InvokeMetaMethod, _id=0, 
    _a=0x7ffc42c38018) at /usr/src/debug/flameshot/build/src/flameshot_autogen/TAC5DWH4SE/moc_flameshotdbusadapter.cpp:121
#16 0x00007245f7430b71 in QDBusConnectionPrivate::deliverCall (this=this@entry=0x7245ec0016e0, object=object@entry=0x6199ab318cb0, 
    msg=..., metaTypes=..., slotIdx=4) at /usr/src/debug/qt6-base/qtbase/src/dbus/qdbusintegrator.cpp:1008
#17 0x00007245f7431a63 in QDBusConnectionPrivate::activateCall (this=this@entry=0x7245ec0016e0, object=0x6199ab318cb0, flags=..., 
    flags@entry=..., msg=...) at /usr/src/debug/qt6-base/qtbase/src/dbus/qdbusintegrator.cpp:910
#18 0x00007245f7434613 in QDBusConnectionPrivate::activateObject (this=0x7245ec0016e0, node=..., msg=..., pathStartPos=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/dbus/qdbusintegrator.cpp:1476
#19 0x00007245f7435f8a in QDBusActivateObjectEvent::placeMetaCall (this=0x7245ec0045c0)
    at /usr/src/debug/qt6-base/qtbase/src/dbus/qdbusintegrator.cpp:1605
#20 0x00007245f5bc4994 in QObject::event (this=<optimized out>, e=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:1413
#21 0x00007245f6d021c0 in QApplicationPrivate::notify_helper (this=<optimized out>, 
    receiver=0x61998c1c90e0 <Flameshot::instance()::c>, e=0x7245ec0045c0)
    at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:3305
--Type <RET> for more, q to quit, c to continue without paging--
#22 0x00007245f5b6a958 in QCoreApplication::notifyInternal2 (receiver=0x61998c1c90e0 <Flameshot::instance()::c>, 
    event=event@entry=0x7245ec0045c0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1109
#23 0x00007245f5b6ad30 in QCoreApplication::sendEvent (receiver=<optimized out>, event=0x7245ec0045c0)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1549
#24 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x6199ab03ae10)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1904
#25 0x00007245f5e4ae18 in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1757
#26 postEventSourceDispatch (s=0x6199ab054080) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:246
#27 0x00007245f5106f8d in g_main_dispatch (context=0x7245ec000f60) at ../glib/glib/gmain.c:3565
#28 0x00007245f5108657 in g_main_context_dispatch_unlocked (context=0x7245ec000f60) at ../glib/glib/gmain.c:4425
#29 g_main_context_iterate_unlocked (context=context@entry=0x7245ec000f60, block=block@entry=1, dispatch=dispatch@entry=1, 
    self=<optimized out>) at ../glib/glib/gmain.c:4490
#30 0x00007245f5108865 in g_main_context_iteration (context=0x7245ec000f60, may_block=1) at ../glib/glib/gmain.c:4556
#31 0x00007245f5e48152 in QEventDispatcherGlib::processEvents (this=0x6199ab040910, flags=...)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:399
#32 0x00007245f5b75786 in QEventLoop::processEvents (this=0x7ffc42c38910, flags=...)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:104

#33 QEventLoop::exec (this=0x7ffc42c38910, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:186
#34 0x00007245f5b6f3f1 in QCoreApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1452
#35 0x00007245f6cfd32a in QApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:2575
#36 0x000061998c0d05bb in main (argc=<optimized out>, argv=0x7ffc42c3a418)
    at /usr/src/debug/flameshot/flameshot-13.3.0/src/main.cpp:255
Comment 1 Nicolas Fella 2026-01-13 12:53:02 UTC
I don't see how this would be related to wlroots
Comment 2 Peter Kaplan 2026-01-13 12:56:20 UTC
(In reply to Nicolas Fella from comment #1)
> I don't see how this would be related to wlroots

Maybe not but this happens with flameshot on wlroots (which is different for screen capture and clipboard stuff).
Comment 4 Bug Janitor Service 2026-01-13 13:56:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kguiaddons/-/merge_requests/197
Comment 5 David Edmundson 2026-01-13 14:01:49 UTC
>I don't see how this would be related to wlroots

It's related to not having ext_data_control
Comment 6 Nicolas Fella 2026-01-13 14:08:04 UTC
Git commit 9cf68eef2543afebc74d2a87aee1d49ef392c11c by Nicolas Fella.
Committed on 13/01/2026 at 13:53.
Pushed by nicolasfella into branch 'master'.

ksystemclipboard: Check m_thread in destructor

The thread might be null

M  +1    -1    src/systemclipboard/waylandclipboard.cpp

https://invent.kde.org/frameworks/kguiaddons/-/commit/9cf68eef2543afebc74d2a87aee1d49ef392c11c
Comment 7 Nicolas Fella 2026-01-13 14:12:57 UTC
Git commit 3ce4f13705b6d5c0381d7cf156580327597fd65b by Nicolas Fella.
Committed on 13/01/2026 at 14:12.
Pushed by nicolasfella into branch 'Frameworks/6.22'.

ksystemclipboard: Check m_thread in destructor

The thread might be null
(cherry picked from commit 9cf68eef2543afebc74d2a87aee1d49ef392c11c)

M  +1    -1    src/systemclipboard/waylandclipboard.cpp

https://invent.kde.org/frameworks/kguiaddons/-/commit/3ce4f13705b6d5c0381d7cf156580327597fd65b