<?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>437364</bug_id>
          
          <creation_ts>2021-05-19 14:11:20 +0000</creation_ts>
          <short_desc>krunner shortcuts stopped working (upgrade to plasma-5.21.90)</short_desc>
          <delta_ts>2023-07-21 07:16:58 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Plasma</classification>
          <product>krunner</product>
          <component>general</component>
          <version>5.25.4</version>
          <rep_platform>Other</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>regression</keywords>
          <priority>VHI</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Rex Dieter">rdieter</reporter>
          <assigned_to name="Alexander Lohnau">alexander.lohnau</assigned_to>
          <cc>6yearold</cc>
    
    <cc>a.samirh78</cc>
    
    <cc>alexander.lohnau</cc>
    
    <cc>andy-kde</cc>
    
    <cc>bugs.kde.org</cc>
    
    <cc>fabian</cc>
    
    <cc>gene</cc>
    
    <cc>kde</cc>
    
    <cc>kde</cc>
    
    <cc>m.kurz</cc>
    
    <cc>nate</cc>
    
    <cc>plasma-bugs-null</cc>
    
    <cc>ricardo</cc>
    
    <cc>samjnaa</cc>
    
    <cc>sampingu02</cc>
    
    <cc>svckd</cc>
    
    <cc>thunderbirdtr</cc>
    
    <cc>vkrevs</cc>
          
          <cf_commitlink>https://invent.kde.org/plasma/plasma-workspace/commit/42b1039ed32c62e1d1750135cc5509caea6fe6b8</cf_commitlink>
          <cf_versionfixedin>5.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>2034029</commentid>
    <comment_count>0</comment_count>
    <who name="Rex Dieter">rdieter</who>
    <bug_when>2021-05-19 14:11:20 +0000</bug_when>
    <thetext>After upgrading to plasma-5.21.90, all krunner shortcuts stopped working.

Some users report seeing duplicates in systemsettings, and removing the dups fixes the issue... I&apos;ll try that and report back.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2034030</commentid>
    <comment_count>1</comment_count>
    <who name="Rex Dieter">rdieter</who>
    <bug_when>2021-05-19 14:17:35 +0000</bug_when>
    <thetext>Confirmed, I saw 2 entries in systemsettings-&gt;shortcuts for krunner, one with an icon one without

I deleted the one without, and reset defaults for the other, and things work again.

Fwiw, here&apos;s the diff of my ~/.config/kglobalshortcutsrc before and after the change:

--- kglobalshortcutsrc.BAK      2021-05-19 09:13:52.814201471 -0500
+++ kglobalshortcutsrc  2021-05-19 09:15:32.288743607 -0500
@@ -62,11 +62,6 @@
 next_active_tab=none,none,Next Active Tab
 toggle_mainwindow_visibility=none,none,Show/Hide Konversation
 
-[krunner.desktop]
-RunClipboard=Alt+Shift+F2,Alt+Shift+F2,Run command on clipboard contents
-_k_friendly_name=KRunner
-_launch=Alt+Space\tAlt+F2\tSearch,Alt+Space\tAlt+F2\tSearch,KRunner
-
 [ksmserver]
 Halt Without Confirmation=none,none,Halt Without Confirmation
 Lock Session=Meta+L\tCtrl+Alt+L\tScreensaver,Meta+L\tCtrl+Alt+L\tScreensaver,Lock Session
@@ -238,9 +233,9 @@
 _launch=Meta+E,Meta+E,Dolphin
 
 [org.kde.krunner.desktop]
-RunClipboard=,Alt+Shift+F2,Run command on clipboard contents
+RunClipboard=Alt+Shift+F2,Alt+Shift+F2,Run command on clipboard contents
 _k_friendly_name=KRunner
-_launch=\t\t,Alt+Space\tAlt+F2\tSearch,KRunner
+_launch=Alt+F2\tAlt+Space\tSearch,Alt+Space\tAlt+F2\tSearch,KRunner
 
 [org.kde.plasma.emojier.desktop]
 _k_friendly_name=Emoji Selector</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2034031</commentid>
    <comment_count>2</comment_count>
    <who name="Rex Dieter">rdieter</who>
    <bug_when>2021-05-19 14:23:15 +0000</bug_when>
    <thetext>I suspect part of this was due to krunner.desktop being renamed to org.kde.krunner.desktop... in this commit ?

https://invent.kde.org/plasma/plasma-workspace/-/commit/10d647c47a0d0cf14727679a0638a4055908c107</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2034042</commentid>
    <comment_count>3</comment_count>
    <who name="David Redondo">kde</who>
    <bug_when>2021-05-19 15:17:17 +0000</bug_when>
    <thetext>There is an update script that should fix this
https://invent.kde.org/plasma/plasma-workspace/-/blob/master/krunner/update/krunnerglobalshortcuts.cpp


Do you have an entry like 

[krunnerglobalshortcuts.upd]
ctime=1621407975
done=5.17KRunnerGlobalShortcuts,5.22KRunnerGlobalShortcuts
mtime=1621393778

in .config/kconf_udpaterc and is /usr/share/kconf_update/krunnerglobalshortcuts.upd on your system?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2034053</commentid>
    <comment_count>4</comment_count>
    <who name="Rex Dieter">rdieter</who>
    <bug_when>2021-05-19 15:36:19 +0000</bug_when>
    <thetext>
~/.config/kconf_udpaterc contains:
[krunnerglobalshortcuts.upd]
ctime=1621260782
mtime=1620912182


$ cat /usr/share/kconf_update/krunnerglobalshortcuts.upd 
Version=5
Id=5.22KRunnerGlobalShortcuts
Script=krunnerglobalshortcuts</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2034254</commentid>
    <comment_count>5</comment_count>
    <who name="David Redondo">kde</who>
    <bug_when>2021-05-20 06:37:43 +0000</bug_when>
    <thetext>That means the update ẃas not run. Could you provide the times of creation and when krunnerglobalshortcuts.upd  was last modified?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2034257</commentid>
    <comment_count>6</comment_count>
    <who name="David Redondo">kde</who>
    <bug_when>2021-05-20 07:17:21 +0000</bug_when>
    <thetext>(In reply to David Redondo from comment #5)
&gt; That means the update ẃas not run. Could you provide the times of creation
&gt; and when krunnerglobalshortcuts.upd  was last modified?

I think at least, not sure why we have the times but not the &quot;done&quot; entry tbh.

What happens if you run 

kconf_update --debug /usr/share/kconf_update/krunnerglobalshortcuts.upd

kconf_update should be in the libexec dir on your system in a kf5 subfolder</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2034442</commentid>
    <comment_count>7</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2021-05-20 18:35:38 +0000</bug_when>
    <thetext>FWIW I can reproduce this in the Wayland session but not the X11 session.

$  cat /usr/share/kconf_update/krunnerglobalshortcuts.upd
Version=5
Id=5.17KRunnerGlobalShortcuts
Script=krunnerglobalshortcuts


$ grep &quot;krunnerglobalshortcuts.upd&quot; -A 3 ~/.config/kconf_updaterc
156:[krunnerglobalshortcuts.upd]
157-ctime=1621259590
158-done=5.17KRunnerGlobalShortcuts,5.22KRunnerGlobalShortcuts
159-mtime=1620132570</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2034537</commentid>
    <comment_count>8</comment_count>
    <who name="David Redondo">kde</who>
    <bug_when>2021-05-21 06:50:01 +0000</bug_when>
    <thetext>(In reply to Nate Graham from comment #7)
&gt; FWIW I can reproduce this in the Wayland session but not the X11 session.

This should make absolutely no difference.

&gt; $  cat /usr/share/kconf_update/krunnerglobalshortcuts.upd
&gt; Version=5
&gt; Id=5.17KRunnerGlobalShortcuts
&gt; Script=krunnerglobalshortcuts

This file is out of date but you probably have a newer one in your prefix? 

&gt; $ grep &quot;krunnerglobalshortcuts.upd&quot; -A 3 ~/.config/kconf_updaterc
&gt; 156:[krunnerglobalshortcuts.upd]
&gt; 157-ctime=1621259590
&gt; 158-done=5.17KRunnerGlobalShortcuts,5.22KRunnerGlobalShortcuts
&gt; 159-mtime=1620132570
Shows the update script run from your</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2034654</commentid>
    <comment_count>9</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2021-05-21 13:56:15 +0000</bug_when>
    <thetext>Ah yeah, oops.

cat ~/kde/usr/share/kconf_update/krunnerglobalshortcuts.upd
Version=5
Id=5.22KRunnerGlobalShortcuts
Script=krunnerglobalshortcuts</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2034692</commentid>
    <comment_count>10</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2021-05-21 15:24:22 +0000</bug_when>
    <thetext>Hmm, now they are working for me again. I guess it&apos;s not this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2038719</commentid>
    <comment_count>11</comment_count>
    <who name="Fabian Vogt">fabian</who>
    <bug_when>2021-06-08 20:55:38 +0000</bug_when>
    <thetext>openQA sees a similar issue (X11. Wayland upgrades not tested): https://openqa.opensuse.org/tests/1774482#step/updates_packagekit_kde/1

The journal shows &quot;No desktop file found for service krunner.desktop&quot;, so this is most likely related to this migration. Restarting kglobalaccel5 helped. Does the upgrade script maybe not apply to an already running kglobalaccel5?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2038721</commentid>
    <comment_count>12</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2021-06-08 21:00:44 +0000</bug_when>
    <thetext>Urgh</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2038879</commentid>
    <comment_count>13</comment_count>
    <who name="David Redondo">kde</who>
    <bug_when>2021-06-09 07:27:58 +0000</bug_when>
    <thetext>&gt;oes the upgrade script maybe not apply to an already running kglobalaccel5

It needs kglobalaccel5 running, we are instructing it do the changes insted of changing the config file under its feet.

What I find interesting that I saw no 
&quot;Disabling desktop file&quot; https://invent.kde.org/frameworks/kglobalaccel/-/blob/master/src/runtime/kserviceactioncomponent.cpp#L133
in the log which we should hit when we call 
  KGlobalAccel::self()-&gt;cleanComponent
(or do we not see debugs in openqa configuration?)

Which I thought maybe KGlobalAccel::isComponentActive(oldDesktopFile) is maybe false if the file is not longer present but I could confirm that to be not the case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2038881</commentid>
    <comment_count>14</comment_count>
    <who name="David Redondo">kde</who>
    <bug_when>2021-06-09 07:40:37 +0000</bug_when>
    <thetext>A manual test:
 - move /usr/share/kglobalaccel/org.kde.krunner.desktop to /usr/share/kglobalaccel/krunner.desktop
 - qdbus org.kde.kglobalaccel /component/org_kde_krunner_desktop org.kde.kglobalaccel.Component.cleanUp (should return true)
 - restart kglobalaccel5

We are now in the initial situation when you are running plasma 5.21

- undo the move from the first step, to simulate the update to 5.22
- run [...]/kconf_update_bin/krunnerglobalshortcuts (kded should  have run this in case of the upgrade)

For me this transfers the shortcuts to the new correct org.kde.krunner.desktop component</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2038914</commentid>
    <comment_count>15</comment_count>
    <who name="David Redondo">kde</who>
    <bug_when>2021-06-09 10:23:33 +0000</bug_when>
    <thetext>(In reply to David Redondo from comment #14)
&gt; For me this transfers the shortcuts to the new correct
&gt; org.kde.krunner.desktop component

but do not work indeed...
They are marked as inactive when the QActions are destroyed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2038940</commentid>
    <comment_count>16</comment_count>
    <who name="David Redondo">kde</who>
    <bug_when>2021-06-09 11:51:37 +0000</bug_when>
    <thetext>Fix for them being set to inactive https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/921</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2039020</commentid>
    <comment_count>17</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2021-06-09 15:46:01 +0000</bug_when>
    <thetext>Git commit 6502f798fe64bd31f043fe2f273587e166ffcb52 by Nate Graham, on behalf of David Redondo.
Committed on 09/06/2021 at 15:40.
Pushed by ngraham into branch &apos;master&apos;.

krunnerglobalshortcuts: Prevent actions from becoming inactive

If a QAction is destroyed, KGlobalAccel will automaticaly set it
to inactive. To prevent this put them on the heap and intentionally
leak them as it did before.

M  +13   -11   krunner/update/krunnerglobalshortcuts.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/6502f798fe64bd31f043fe2f273587e166ffcb52</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2039021</commentid>
    <comment_count>18</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2021-06-09 15:46:58 +0000</bug_when>
    <thetext>Git commit 42b1039ed32c62e1d1750135cc5509caea6fe6b8 by Nate Graham, on behalf of David Redondo.
Committed on 09/06/2021 at 15:46.
Pushed by ngraham into branch &apos;Plasma/5.22&apos;.

krunnerglobalshortcuts: Prevent actions from becoming inactive

If a QAction is destroyed, KGlobalAccel will automaticaly set it
to inactive. To prevent this put them on the heap and intentionally
leak them as it did before.


(cherry picked from commit 6502f798fe64bd31f043fe2f273587e166ffcb52)

M  +13   -11   krunner/update/krunnerglobalshortcuts.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/42b1039ed32c62e1d1750135cc5509caea6fe6b8</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2039035</commentid>
    <comment_count>19</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2021-06-09 16:15:43 +0000</bug_when>
    <thetext>Should be fully fixed with that. Please re-open if your KRunner shortcuts are still broken after upgrading to Plasma 5.22.1 and rebooting. Don&apos;t forget the reboot. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2042503</commentid>
    <comment_count>20</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2021-06-20 13:28:45 +0000</bug_when>
    <thetext>*** Bug 413368 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2043079</commentid>
    <comment_count>21</comment_count>
    <who name="Rex Dieter">rdieter</who>
    <bug_when>2021-06-22 20:53:14 +0000</bug_when>
    <thetext>Heads up, we have at least one downstream user reporting this issue persists with plasma-5.22.1,

https://bugzilla.redhat.com/show_bug.cgi?id=1974589</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2043099</commentid>
    <comment_count>22</comment_count>
    <who name="Ricardo J. Barberis">ricardo</who>
    <bug_when>2021-06-23 01:09:28 +0000</bug_when>
    <thetext>FWIW, I had this issue after upgrading to Plasma 5.22.0 and Gear 21.04.2.

A couple of day later I upgraded to Frameworks 5.83 and the problem was solved, so I didn&apos;t need to upgrade to Plasma 5.22.1

My O.S. is Slackware64 current (a.k.a. 15.0 beta).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2043118</commentid>
    <comment_count>23</comment_count>
    <who name="Fabian Vogt">fabian</who>
    <bug_when>2021-06-23 06:23:54 +0000</bug_when>
    <thetext>(In reply to Rex Dieter from comment #21)
&gt; Heads up, we have at least one downstream user reporting this issue persists
&gt; with plasma-5.22.1,
&gt; 
&gt; https://bugzilla.redhat.com/show_bug.cgi?id=1974589

At least openQA and my manual testing hasn&apos;t seen any issues with upgrades from 5.12, 5.18 and 5.21.5 anymore, so I don&apos;t think it&apos;s broken in general. Maybe there&apos;s some edge case with certain configs. Can you get kglobalshortcutsrc from the reporter?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2056708</commentid>
    <comment_count>24</comment_count>
    <who name="Rex Dieter">rdieter</who>
    <bug_when>2021-08-27 14:49:21 +0000</bug_when>
    <thetext>Users are still reporting as unfixed, reopened.

I&apos;ll direct them here to provide additional feedback, thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2068278</commentid>
    <comment_count>25</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2021-10-13 19:32:20 +0000</bug_when>
    <thetext>No users have shown up to provide feedback. :(

Given that it doesn&apos;t seem to be widely reproducible, without additional information, we won&apos;t be able to investigate further.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2068781</commentid>
    <comment_count>26</comment_count>
    <who name="Dmitry Vinokurov">gim6626</who>
    <bug_when>2021-10-15 13:24:12 +0000</bug_when>
    <thetext>Sorry if it is the wrong place, but I&apos;ve just upgraded to Kubuntu 21.10 from 21.04 and faced this bug. Plasma 4:5.22.5-0ubuntu1. Found 2 Krunner entries in keyboard shortcuts, one disabled and other with expected keys, reassigned - everything works now, but I still think that something is wrong with installation scripts and it should not be so, because this bug is not very easy to Google.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2068782</commentid>
    <comment_count>27</comment_count>
    <who name="Rex Dieter">rdieter</who>
    <bug_when>2021-10-15 13:28:03 +0000</bug_when>
    <thetext>Still unresolved, just had a user report seeing this today in chat</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2068783</commentid>
    <comment_count>28</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2021-10-15 13:30:38 +0000</bug_when>
    <thetext>Any ideas, Alexander or David?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2068787</commentid>
    <comment_count>29</comment_count>
    <who name="Rex Dieter">rdieter</who>
    <bug_when>2021-10-15 13:39:34 +0000</bug_when>
    <thetext>I&apos;ll try to come up with reproducibility steps, iirc, it&apos;s not that hard to trigger this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2068808</commentid>
    <comment_count>30</comment_count>
    <who name="Gene">gene</who>
    <bug_when>2021-10-15 14:54:48 +0000</bug_when>
    <thetext>I am having this issue on Fedora 34. Shortcuts shows that both alt+space and alt+f2 should open krunner but they do not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2070039</commentid>
    <comment_count>31</comment_count>
    <who name="David Redondo">kde</who>
    <bug_when>2021-10-19 07:21:33 +0000</bug_when>
    <thetext>I have no idea since manual set up and OpenQa both worked. 
5.22 is also EOL, so people who would be affected by this would be 
upgrading form 5.21 to 5.23 or later, not sure how common</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2070406</commentid>
    <comment_count>32</comment_count>
    <who name="Gene">gene</who>
    <bug_when>2021-10-20 01:46:51 +0000</bug_when>
    <thetext>(In reply to David Redondo from comment #31)
&gt; I have no idea since manual set up and OpenQa both worked. 
&gt; 5.22 is also EOL, so people who would be affected by this would be 
&gt; upgrading form 5.21 to 5.23 or later, not sure how common

It looks like Fedora 34 is using 5.22.5 as of today. I can&apos;t speak to what is eol and what&apos;s not, but it seems that if even Fedora&apos;s current distro is impacted by this it is still relevant since very few users will be running something newer than that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2072330</commentid>
    <comment_count>33</comment_count>
    <who name="Tom Chiverton">bugs.kde.org</who>
    <bug_when>2021-10-26 08:18:25 +0000</bug_when>
    <thetext>Broken in Kubuntu backports too

Two krunner entries in system settings, both missing icons. Removed, but can&apos;t re add.

It&apos;s very broken.

Operating System: Kubuntu 21.10
KDE Plasma Version: 5.23.1
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2
Kernel Version: 5.13.0-20-generic (64-bit)
Graphics Platform: X11
Processors: 4 × Intel® Core™ i5-3230M CPU @ 2.60GHz
Memory: 7.7 GiB of RAM
Graphics Processor: Mesa DRI Intel® HD Graphics 4000</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2072331</commentid>
    <comment_count>34</comment_count>
    <who name="Tom Chiverton">bugs.kde.org</who>
    <bug_when>2021-10-26 08:21:47 +0000</bug_when>
    <thetext>Work around is to add a manual custom shortcut, with the alt+space etc mappings, that just runs /usr/bin/krunner

Not sure how something so simple and unchanged since forever gets busted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2082629</commentid>
    <comment_count>35</comment_count>
    <who name="Nuno Costa">svckd</who>
    <bug_when>2021-12-04 14:23:11 +0000</bug_when>
    <thetext>I upgraded to Fedora 34 recently and following the same steps mentioned in Comment 1, made KRunner shortcuts work again.
I remember being affected by Bug 413368 in Fedora 31.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2095916</commentid>
    <comment_count>36</comment_count>
    <who name="David Edmundson">kde</who>
    <bug_when>2022-01-20 16:43:26 +0000</bug_when>
    <thetext>5.22 is outdated any fix now won&apos;t help anything</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2146280</commentid>
    <comment_count>37</comment_count>
    <who name="Fabian Vogt">fabian</who>
    <bug_when>2022-08-17 13:59:16 +0000</bug_when>
    <thetext>For some reason this now started to fail in openQA tests which upgrade from 5.8/5.12/5.18 (Leap 42.x/15.x) -&gt; 5.24 (Tumbleweed). First, kglobalacceld crashes and after the automatic restart the situation is as outlined in this report: Two entries in kglobalshortcutsrc which don&apos;t work. At least in openQA this looks like it&apos;s reproducible. Unfortunately I wasn&apos;t able to get a backtrace, but it seems to be heap corruption (&quot;unaligned fastbin chunk detected&quot;). The crash is not reproducible manually at least.

This matches the arrival of Frameworks 5.97 in Tumbleweed. I can&apos;t tell how much 5.97.0 actually caused this or just exposed it more...

CC Ahmad, who did the majority of changes in kglobalaccel 5.97.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2146296</commentid>
    <comment_count>38</comment_count>
    <who name="Fabian Vogt">fabian</who>
    <bug_when>2022-08-17 14:43:35 +0000</bug_when>
    <thetext>(In reply to Fabian Vogt from comment #37)
&gt; For some reason this now started to fail in openQA tests which upgrade from
&gt; 5.8/5.12/5.18 (Leap 42.x/15.x) -&gt; 5.24 (Tumbleweed). First, kglobalacceld
&gt; crashes and after the automatic restart the situation is as outlined in this
&gt; report: Two entries in kglobalshortcutsrc which don&apos;t work. At least in
&gt; openQA this looks like it&apos;s reproducible. Unfortunately I wasn&apos;t able to get
&gt; a backtrace, but it seems to be heap corruption (&quot;unaligned fastbin chunk
&gt; detected&quot;). The crash is not reproducible manually at least.
&gt; 
&gt; This matches the arrival of Frameworks 5.97 in Tumbleweed. I can&apos;t tell how
&gt; much 5.97.0 actually caused this or just exposed it more...
&gt; 
&gt; CC Ahmad, who did the majority of changes in kglobalaccel 5.97.

It&apos;s actually fairly simple: kglobalacceld crashes when the kconf_update binary runs. With valgrind, the cause is obvious:

void GlobalShortcutsRegistry::writeSettings() const
{
    const auto &amp;lst = GlobalShortcutsRegistry::self()-&gt;allMainComponents();
    for (const KdeDGlobalAccel::Component *component : lst) {
        KConfigGroup configGroup(&amp;_config, component-&gt;uniqueName());
        if (component-&gt;allShortcuts().isEmpty()) {
            configGroup.deleteGroup();
            delete component;
        } else {
            component-&gt;writeSettings(configGroup);
        }
    }

    _config.sync();
}

That method destroys the component, but leaves it in the m_components vector of the shortcuts registry, i.e. it generates dangling pointers. This results in all kinds of fun, in particular double-, triple- and quadruple- frees each time writeSettings is called. I think it just worked by sheer luck when QHash was still used. Reverting that commit makes the immediate valgrind complaints stop, but it still crashes at some point later due to latent memory corruption. I think this explains the not fully reproducible issues prior to 5.97 well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2146312</commentid>
    <comment_count>39</comment_count>
    <who name="Fabian Vogt">fabian</who>
    <bug_when>2022-08-17 15:52:25 +0000</bug_when>
    <thetext>(In reply to Fabian Vogt from comment #38)
&gt; (In reply to Fabian Vogt from comment #37)
&gt; &gt; For some reason this now started to fail in openQA tests which upgrade from
&gt; &gt; 5.8/5.12/5.18 (Leap 42.x/15.x) -&gt; 5.24 (Tumbleweed). First, kglobalacceld
&gt; &gt; crashes and after the automatic restart the situation is as outlined in this
&gt; &gt; report: Two entries in kglobalshortcutsrc which don&apos;t work. At least in
&gt; &gt; openQA this looks like it&apos;s reproducible. Unfortunately I wasn&apos;t able to get
&gt; &gt; a backtrace, but it seems to be heap corruption (&quot;unaligned fastbin chunk
&gt; &gt; detected&quot;). The crash is not reproducible manually at least.
&gt; &gt; 
&gt; &gt; This matches the arrival of Frameworks 5.97 in Tumbleweed. I can&apos;t tell how
&gt; &gt; much 5.97.0 actually caused this or just exposed it more...
&gt; &gt; 
&gt; &gt; CC Ahmad, who did the majority of changes in kglobalaccel 5.97.
&gt; 
&gt; It&apos;s actually fairly simple: kglobalacceld crashes when the kconf_update
&gt; binary runs. With valgrind, the cause is obvious:

&quot;obvious&quot; - ha! I wrote too soon.

~Component actually calls registry-&gt;takeComponent so it modifies m_components.
The subtle addition of &quot;&amp;&quot; in the QHash -&gt; std::vector commit means that the container
being iterated gets changed underneath the method. Just removing the &quot;&amp;&quot; again doesn&apos;t
fix the crash though, it just crashes differently, taking valgrind with it... Needs a closer look.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2146353</commentid>
    <comment_count>40</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2022-08-17 17:22:07 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kglobalaccel/-/merge_requests/57</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2146356</commentid>
    <comment_count>41</comment_count>
    <who name="Fabian Vogt">fabian</who>
    <bug_when>2022-08-17 17:25:41 +0000</bug_when>
    <thetext>(In reply to Bug Janitor Service from comment #40)
&gt; A possibly relevant merge request was started @
&gt; https://invent.kde.org/frameworks/kglobalaccel/-/merge_requests/57

I tried it again from a clean slate and just removing the &quot;&amp;&quot; fixed the issue completely, yay.
Unfortunately that also means that it&apos;s unrelated to the remaining &quot;shortcuts lost&quot; issues
and effectively I hijacked this bug report for something new...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2146380</commentid>
    <comment_count>42</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2022-08-17 18:31:34 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kglobalaccel/-/merge_requests/58</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2146633</commentid>
    <comment_count>43</comment_count>
    <who name="Fabian Vogt">fabian</who>
    <bug_when>2022-08-18 17:21:52 +0000</bug_when>
    <thetext>Git commit 7347a904f1c97db7b7f7fcf49b6bdd34701c7737 by Fabian Vogt.
Committed on 17/08/2022 at 17:14.
Pushed by fvogt into branch &apos;master&apos;.

Avoid iterating a container while it&apos;s being mutated

Otherwise the iterators get invalidated and weird stuff happens.

M  +2    -1    src/runtime/globalshortcutsregistry.cpp

https://invent.kde.org/frameworks/kglobalaccel/commit/7347a904f1c97db7b7f7fcf49b6bdd34701c7737</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2148063</commentid>
    <comment_count>44</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-08-25 13:35:17 +0000</bug_when>
    <thetext>*** Bug 458268 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2150971</commentid>
    <comment_count>45</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-09-08 04:33:42 +0000</bug_when>
    <thetext>Was that enough to fix it, or do we need something else?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2151009</commentid>
    <comment_count>46</comment_count>
    <who name="Fabian Vogt">fabian</who>
    <bug_when>2022-09-08 06:37:30 +0000</bug_when>
    <thetext>(In reply to Nate Graham from comment #45)
&gt; Was that enough to fix it, or do we need something else?

The fix following comment 37 was for a regression in KF 5.97, so actually unrelated to the original report. I have no idea what the state of the original bug is after it was apparently not fully fixed (comment 21), I was never able to reproduce it and openQA doesn&apos;t see it either.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2151094</commentid>
    <comment_count>47</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-09-08 14:54:27 +0000</bug_when>
    <thetext>Ok, then let&apos;s close this since it seems like it&apos;s not clear that the original issue is indeed still a problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2178433</commentid>
    <comment_count>48</comment_count>
    <who name="Shriramana Sharma">samjnaa</who>
    <bug_when>2022-11-28 11:21:13 +0000</bug_when>
    <thetext>My KDE keyboard switching shortcuts started malfunctioning over the past one month… Before that it was fine. I&apos;m using Kubuntu Jammy  22.04.1 with latest updates. Any idea when I can get this fixed on my system?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2241938</commentid>
    <comment_count>49</comment_count>
    <who name="Andy Simpkins">andy-kde</who>
    <bug_when>2023-07-21 07:16:58 +0000</bug_when>
    <thetext>I note that there were reports that users were not reporting this issue.
Reading through this bug I was able to fix my upgrade from Debian 11 to Debian 12. where the krunner shortcuts stopped working.

It might be worth including a test / auto recover script and pushing it to the distros explicitly so that users with even less clue than me get an update to fix the problem.

Thanks for all your great work

/Andy

Operating System: Debian GNU/Linux 12
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 6.1.0-9-amd64 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-4790 CPU @ 3.60GHz
Memory: 15.6 GiB of RAM
Graphics Processor: TAHITI
Manufacturer: ASUS
Product Name: All Series</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>