<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>514512</bug_id>
          
          <creation_ts>2026-01-12 20:38:06 +0000</creation_ts>
          <short_desc>KSystemClipboard crashes in WaylandClipboard::~WaylandClipboard</short_desc>
          <delta_ts>2026-01-13 22:45:53 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Frameworks and Libraries</classification>
          <product>frameworks-kguiaddons</product>
          <component>general</component>
          <version>6.22.0</version>
          <rep_platform>Arch Linux</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>crash</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Peter Kaplan">peter</reporter>
          <assigned_to name="kdelibs bugs">kdelibs-bugs-null</assigned_to>
          <cc>kde</cc>
    
    <cc>m.kurz</cc>
    
    <cc>nicolas.fella</cc>
          
          <cf_commitlink>https://invent.kde.org/frameworks/kguiaddons/-/commit/3ce4f13705b6d5c0381d7cf156580327597fd65b</cf_commitlink>
          <cf_versionfixedin>6.22.1</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2484165</commentid>
    <comment_count>0</comment_count>
    <who name="Peter Kaplan">peter</who>
    <bug_when>2026-01-12 20:38:06 +0000</bug_when>
    <thetext>* 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&apos;.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007245f5c8668c in QScopedPointer&lt;QObjectData, QScopedPointerDeleter&lt;QObjectData&gt; &gt;::get (this=&lt;optimized out&gt;, this=&lt;optimized out&gt;)
    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&lt;QObjectData, QScopedPointerDeleter&lt;QObjectData&gt; &gt;::get (this=&lt;optimized out&gt;, 
    this=&lt;optimized out&gt;) at /usr/src/debug/qt6-base/qtbase/src/corelib/tools/qscopedpointer.h:112
#1  qGetPtrHelper&lt;QScopedPointer&lt;QObjectData, QScopedPointerDeleter&lt;QObjectData&gt; &gt; const&gt; (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=&lt;optimized out&gt;, this=&lt;optimized out&gt;)
    at /usr/src/debug/kguiaddons/kguiaddons-6.22.0/src/systemclipboard/waylandclipboard.cpp:622
#5  0x00007245f74e1964 in WaylandClipboard::~WaylandClipboard (this=&lt;optimized out&gt;, this=&lt;optimized out&gt;)
    at /usr/src/debug/kguiaddons/kguiaddons-6.22.0/src/systemclipboard/waylandclipboard.cpp:620
#6  WaylandClipboard::create (parent=&lt;optimized out&gt;)
    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=&lt;optimized out&gt;, data=...)
    at /usr/src/debug/flameshot/flameshot-13.3.0/src/core/flameshotdbusadapter.cpp:15
#14 FlameshotDBusAdapter::qt_static_metacall (_o=&lt;optimized out&gt;, _c=&lt;optimized out&gt;, _id=&lt;optimized out&gt;, _a=&lt;optimized out&gt;)
    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=&lt;optimized out&gt;)
    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=&lt;optimized out&gt;, e=&lt;optimized out&gt;)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:1413
#21 0x00007245f6d021c0 in QApplicationPrivate::notify_helper (this=&lt;optimized out&gt;, 
    receiver=0x61998c1c90e0 &lt;Flameshot::instance()::c&gt;, e=0x7245ec0045c0)
    at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:3305
--Type &lt;RET&gt; for more, q to quit, c to continue without paging--
#22 0x00007245f5b6a958 in QCoreApplication::notifyInternal2 (receiver=0x61998c1c90e0 &lt;Flameshot::instance()::c&gt;, 
    event=event@entry=0x7245ec0045c0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1109
#23 0x00007245f5b6ad30 in QCoreApplication::sendEvent (receiver=&lt;optimized out&gt;, 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=&lt;optimized out&gt;) 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=&lt;optimized out&gt;, argv=0x7ffc42c3a418)
    at /usr/src/debug/flameshot/flameshot-13.3.0/src/main.cpp:255</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2484372</commentid>
    <comment_count>1</comment_count>
    <who name="Nicolas Fella">nicolas.fella</who>
    <bug_when>2026-01-13 12:53:02 +0000</bug_when>
    <thetext>I don&apos;t see how this would be related to wlroots</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2484373</commentid>
    <comment_count>2</comment_count>
    <who name="Peter Kaplan">peter</who>
    <bug_when>2026-01-13 12:56:20 +0000</bug_when>
    <thetext>(In reply to Nicolas Fella from comment #1)
&gt; I don&apos;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).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2484398</commentid>
    <comment_count>3</comment_count>
    <who name="Nicolas Fella">nicolas.fella</who>
    <bug_when>2026-01-13 13:50:51 +0000</bug_when>
    <thetext>See also https://crash-reports.kde.org/organizations/kde/issues/346900 and https://crash-reports.kde.org/organizations/kde/issues/347310</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2484402</commentid>
    <comment_count>4</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2026-01-13 13:56:00 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kguiaddons/-/merge_requests/197</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2484403</commentid>
    <comment_count>5</comment_count>
    <who name="David Edmundson">kde</who>
    <bug_when>2026-01-13 14:01:49 +0000</bug_when>
    <thetext>&gt;I don&apos;t see how this would be related to wlroots

It&apos;s related to not having ext_data_control</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2484406</commentid>
    <comment_count>6</comment_count>
    <who name="Nicolas Fella">nicolas.fella</who>
    <bug_when>2026-01-13 14:08:04 +0000</bug_when>
    <thetext>Git commit 9cf68eef2543afebc74d2a87aee1d49ef392c11c by Nicolas Fella.
Committed on 13/01/2026 at 13:53.
Pushed by nicolasfella into branch &apos;master&apos;.

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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2484407</commentid>
    <comment_count>7</comment_count>
    <who name="Nicolas Fella">nicolas.fella</who>
    <bug_when>2026-01-13 14:12:57 +0000</bug_when>
    <thetext>Git commit 3ce4f13705b6d5c0381d7cf156580327597fd65b by Nicolas Fella.
Committed on 13/01/2026 at 14:12.
Pushed by nicolasfella into branch &apos;Frameworks/6.22&apos;.

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</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>