Bug 419981

Summary: With KBookmarks >= 5.69, Ctrl+B standard KDE shortcut overrides Konsole shortcut settings
Product: [Frameworks and Libraries] frameworks-kbookmarks Reporter: outloudvi <i>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: a.samirh78, ach, arojas, bjoernv, chgonzalezg, farhan.kathawala, fsvm88+kdebugzilla, git, l.leblansch, mike.cloaked, poorchoppe+kde, roger.vins.11
Priority: NOR    
Version: 5.69.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=420010
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description outloudvi 2020-04-12 08:01:54 UTC
SUMMARY
After upgrading kbookmarks to 5.69.0, tmux in Konsole (in most time) crashes Konsole when Ctrl-B (which is a fundamental hotkey of tmux) is pressed at the first time.
Rolling back to kbookmarks 5.68.0 solves this.

STEPS TO REPRODUCE
1. Install tmux
2. Run tmux in Konsole
3. Press "Ctrl-B C" (create a tab in tmux by default)

OBSERVED RESULT
First press: tmux has no response to the key, and Konsole crashes.
Non-first press (if Konsole didn't crash): tmux has no response to the key.

EXPECTED RESULT
tmux responses to the key, creating a tab.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 5.18.4
KDE Frameworks Version: 5.69.0
Qt Version: 5.14.2

Konsole 19.12.3
KBookmarks 5.69.0

ADDITIONAL INFORMATION

Backtrace log:
Application: Konsole (konsole), signal: Segmentation fault
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f7cd4ca6840 (LWP 295238))]

Thread 7 (Thread 0x7f7cc90e5700 (LWP 295245)):
#0 0x00007f7cd8083cf5 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1 0x00007f7ccad6dbfc in ?? () from /usr/lib/dri/iris_dri.so
#2 0x00007f7ccad6d7f8 in ?? () from /usr/lib/dri/iris_dri.so
#3 0x00007f7cd807d46f in start_thread () from /usr/lib/libpthread.so.0
#4 0x00007f7cdad1b3d3 in clone () from /usr/lib/libc.so.6

Thread 6 (Thread 0x7f7cc98e6700 (LWP 295244)):
#0 0x00007f7cd8083cf5 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1 0x00007f7ccad6dbfc in ?? () from /usr/lib/dri/iris_dri.so
#2 0x00007f7ccad6d7f8 in ?? () from /usr/lib/dri/iris_dri.so
#3 0x00007f7cd807d46f in start_thread () from /usr/lib/libpthread.so.0
#4 0x00007f7cdad1b3d3 in clone () from /usr/lib/libc.so.6

Thread 5 (Thread 0x7f7cca0e7700 (LWP 295243)):
#0 0x00007f7cd8083cf5 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1 0x00007f7ccad6dbfc in ?? () from /usr/lib/dri/iris_dri.so
#2 0x00007f7ccad6d7f8 in ?? () from /usr/lib/dri/iris_dri.so
#3 0x00007f7cd807d46f in start_thread () from /usr/lib/libpthread.so.0
#4 0x00007f7cdad1b3d3 in clone () from /usr/lib/libc.so.6

Thread 4 (Thread 0x7f7cca8e8700 (LWP 295242)):
#0 0x00007f7cd8083cf5 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1 0x00007f7ccad6dbfc in ?? () from /usr/lib/dri/iris_dri.so
#2 0x00007f7ccad6d7f8 in ?? () from /usr/lib/dri/iris_dri.so
#3 0x00007f7cd807d46f in start_thread () from /usr/lib/libpthread.so.0
#4 0x00007f7cdad1b3d3 in clone () from /usr/lib/libc.so.6

Thread 3 (Thread 0x7f7cd2364700 (LWP 295241)):
#0 0x00007f7cd76d7f2b in ?? () from /usr/lib/libglib-2.0.so.0
#1 0x00007f7cd76d89f6 in ?? () from /usr/lib/libglib-2.0.so.0
#2 0x00007f7cd76d9cbb in g_main_context_prepare () from /usr/lib/libglib-2.0.so.0
#3 0x00007f7cd76da3c6 in ?? () from /usr/lib/libglib-2.0.so.0
#4 0x00007f7cd76da571 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#5 0x00007f7cd94b68ac in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#6 0x00007f7cd945d05c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#7 0x00007f7cd9281c62 in QThread::exec() () from /usr/lib/libQt5Core.so.5
#8 0x00007f7cd8992b28 in ?? () from /usr/lib/libQt5DBus.so.5
#9 0x00007f7cd9282dd6 in ?? () from /usr/lib/libQt5Core.so.5
#10 0x00007f7cd807d46f in start_thread () from /usr/lib/libpthread.so.0
#11 0x00007f7cdad1b3d3 in clone () from /usr/lib/libc.so.6

Thread 2 (Thread 0x7f7cd3bc0700 (LWP 295240)):
#0 0x00007f7cdad10abf in poll () from /usr/lib/libc.so.6
#1 0x00007f7cd82a563b in ?? () from /usr/lib/libxcb.so.1
#2 0x00007f7cd82a737b in xcb_wait_for_event () from /usr/lib/libxcb.so.1
#3 0x00007f7cd457ce01 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#4 0x00007f7cd9282dd6 in ?? () from /usr/lib/libQt5Core.so.5
#5 0x00007f7cd807d46f in start_thread () from /usr/lib/libpthread.so.0
#6 0x00007f7cdad1b3d3 in clone () from /usr/lib/libc.so.6

Thread 1 (Thread 0x7f7cd4ca6840 (LWP 295238)):
[KCrash Handler]
#6 0x00007f7cdab4dce0 in ?? () from /usr/lib/libkonsoleprivate.so.19
#7 0x00007f7cdab7825d in Konsole::Session::getUrl() () from /usr/lib/libkonsoleprivate.so.19
#8 0x00007f7cdab7fac6 in Konsole::SessionController::url() const () from /usr/lib/libkonsoleprivate.so.19
#9 0x00007f7cdab0d26b in Konsole::BookmarkHandler::titleForView(Konsole::ViewProperties*) const () from /usr/lib/libkonsoleprivate.so.19
#10 0x00007f7cdab0d6c3 in Konsole::BookmarkHandler::currentTitle() const () from /usr/lib/libkonsoleprivate.so.19
#11 0x00007f7cd8f47f4a in KBookmarkMenu::slotAddBookmark() () from /usr/lib/libKF5Bookmarks.so.5
#12 0x00007f7cd9493d10 in ?? () from /usr/lib/libQt5Core.so.5
#13 0x00007f7cd9ef4f33 in QAction::triggered(bool) () from /usr/lib/libQt5Widgets.so.5
#14 0x00007f7cd9ef761c in QAction::activate(QAction::ActionEvent) () from /usr/lib/libQt5Widgets.so.5
#15 0x00007f7cd9ef7f60 in QAction::event(QEvent*) () from /usr/lib/libQt5Widgets.so.5
#16 0x00007f7cd9efb352 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#17 0x00007f7cd9f04829 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#18 0x00007f7cd945e4f2 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#19 0x00007f7cd9853840 in QShortcutMap::dispatchEvent(QKeyEvent*) () from /usr/lib/libQt5Gui.so.5
#20 0x00007f7cd9853923 in QShortcutMap::tryShortcut(QKeyEvent*) () from /usr/lib/libQt5Gui.so.5
#21 0x00007f7cd9805184 in QWindowSystemInterface::handleShortcutEvent(QWindow*, unsigned long, int, QFlags<Qt::KeyboardModifier>, unsigned int, unsigned int, unsigned int, QString const&, bool, unsigned short) () from /usr/lib/libQt5Gui.so.5
#22 0x00007f7cd982456e in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) () from /usr/lib/libQt5Gui.so.5
#23 0x00007f7cd982999a in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /usr/lib/libQt5Gui.so.5
#24 0x00007f7cd9801c5c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Gui.so.5
#25 0x00007f7cd457de2c in ?? () from /usr/lib/libQt5XcbQpa.so.5
#26 0x00007f7cd76d86be in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#27 0x00007f7cd76da531 in ?? () from /usr/lib/libglib-2.0.so.0
#28 0x00007f7cd76da571 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#29 0x00007f7cd94b6890 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#30 0x00007f7cd945d05c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#31 0x00007f7cd9465066 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#32 0x00007f7cdae11814 in kdemain () from /usr/lib/libkdeinit5_konsole.so
#33 0x00007f7cdac43023 in __libc_start_main () from /usr/lib/libc.so.6
#34 0x000055a45caf605e in _start ()
[Inferior 1 (process 295238) detached]
Comment 1 Fabio Scaccabarozzi 2020-04-12 11:58:41 UTC
I can confirm the bug, but for me it acts slightly different.
Gentoo user here, upgraded to kbookmarks-5.69.0 yesterday.

For me it doesn't crash.

Noticed today that I could not issue Ctrl+B as usual to issue tmux commands in Konsole.
Somehow I figured out I had to issue Ctrl+Shift+B in order to have the hotkey functionality.
After 1h poking, I discovered in "System Settings > Standard shortcuts" that Ctrl+B was bound to "Add bookmark" action.
Removed it, I can finally use tmux properly again.

I don't recall ever clearing that hotkey before to have tmux working, I think Ctrl+B was still at its default settings.
I also tested by adding a "test" user to my system to check the out-of-the-box configuration, and the bug appeared there as well.

It seems to me that the "Add bookmark" action became suddenly available (or bound) to Konsole as well after the upgrade.
Comment 2 Antonio Rojas 2020-04-12 16:47:22 UTC
*** Bug 419991 has been marked as a duplicate of this bug. ***
Comment 3 Ahmad Samir 2020-04-12 17:17:30 UTC
It could be related to the recent changes in KBookmarks:
https://phabricator.kde.org/D25660
https://api.kde.org/frameworks/kbookmarks/html/classKBookmarkMenu.html
Comment 4 Antonio Rojas 2020-04-13 07:13:13 UTC
*** Bug 420008 has been marked as a duplicate of this bug. ***
Comment 5 Ahmad Samir 2020-04-13 12:58:01 UTC
*** Bug 420026 has been marked as a duplicate of this bug. ***
Comment 6 Ahmad Samir 2020-04-13 13:02:06 UTC
As has been said in comment#1 a simple workaround is to change the "Add Bookmark" shortcut in systemsettings -> Shortcuts -> Standard Shortcuts to anything else other than Ctrl+B.

Proposed fix https://invent.kde.org/kde/konsole/-/merge_requests/76
Comment 7 Ahmad Samir 2020-04-13 14:23:03 UTC
Git commit 6db7f8d2593ccb0238b2b547ed6eaf7da6a26c4c by Ahmad Samir.
Committed on 13/04/2020 at 14:03.
Pushed by hindenburg into branch 'master'.

[BookmarkMenu] Adapt the code to KBookmarks 5.69 changes

Starting from KBookmarks 5.69 the ctor that took a KActionCollection
parameter has been deprecated, and we need to manually add the various
bookmark actions to the actionCollection so that they show up in the
shortcusts editor.

Move the code that overrides the add bookmark shortcut, Ctrl+B, to the
BookmarkMenu class, so that all the relevant code is in one place.

M  +29   -5    src/BookmarkMenu.cpp
M  +1    -1    src/BookmarkMenu.h
M  +0    -10   src/MainWindow.cpp

https://invent.kde.org/kde/konsole/commit/6db7f8d2593ccb0238b2b547ed6eaf7da6a26c4c
Comment 8 Antonio Rojas 2020-04-13 15:35:19 UTC
Thanks for the fix, please push it to the 20.04 branch too
Comment 9 Kurt Hindenburg 2020-04-14 01:12:10 UTC
Git commit dcf8cf3f2255293da170648f633873aa7c4afcf1 by Kurt Hindenburg, on behalf of Ahmad Samir.
Committed on 14/04/2020 at 01:07.
Pushed by hindenburg into branch 'release/20.04'.

[BookmarkMenu] Adapt the code to KBookmarks 5.69 changes

Starting from KBookmarks 5.69 the ctor that took a KActionCollection
parameter has been deprecated, and we need to manually add the various
bookmark actions to the actionCollection so that they show up in the
shortcusts editor.

Move the code that overrides the add bookmark shortcut, Ctrl+B, to the
BookmarkMenu class, so that all the relevant code is in one place.
(cherry picked from commit 6db7f8d2593ccb0238b2b547ed6eaf7da6a26c4c)

M  +29   -5    src/BookmarkMenu.cpp
M  +1    -1    src/BookmarkMenu.h
M  +0    -10   src/MainWindow.cpp

https://invent.kde.org/kde/konsole/commit/dcf8cf3f2255293da170648f633873aa7c4afcf1
Comment 10 Ahmad Samir 2020-04-14 15:10:16 UTC
*** Bug 420080 has been marked as a duplicate of this bug. ***
Comment 11 Patrick Silva 2020-04-14 23:01:18 UTC
*** Bug 420096 has been marked as a duplicate of this bug. ***
Comment 12 Antonio Rojas 2020-04-15 07:13:47 UTC
*** Bug 420102 has been marked as a duplicate of this bug. ***
Comment 13 Antonio Rojas 2020-04-15 10:30:48 UTC
*** Bug 420107 has been marked as a duplicate of this bug. ***
Comment 14 Ahmad Samir 2020-04-21 10:45:49 UTC
*** Bug 420371 has been marked as a duplicate of this bug. ***