Bug 375540 - Ambiguous shortcuts crash at startup
Summary: Ambiguous shortcuts crash at startup
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: emulation (show other bugs)
Version: 16.12.1
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
: 379059 380991 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-01-25 12:47 UTC by Norman Hull
Modified: 2017-06-27 19:22 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
typescript (7.04 KB, text/plain)
2017-02-01 11:09 UTC, Norman
Details
Shortcut dialog (16.78 KB, image/png)
2017-02-02 10:37 UTC, Norman Hull
Details
backtrace with some debuginfo (7.21 KB, text/plain)
2017-03-08 03:00 UTC, Orivej Desh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Norman Hull 2017-01-25 12:47:03 UTC
Following system update (pacman -Suy) konsole is now version 16.12.1

Will not run, instead gives a seg fault on startup every time.  

Tried rebooting just in case - although I didn't expect this to fix it. It didn't

Had to install yakuake as a temporary measure, this gave me information not included when run from plasma directly:

KCrash: Application 'konsole' crashing...
KCrash: Attempting to start /usr/lib/drkonqi from kdeinit
sock_file=/run/user/1000/kdeinit5__0
[00007fdc80001028] filesystem access error: read error: Bad file descriptor
[00007fdc80001028] core access error: File reading failed
[00007fdc80001028] core access error: VLC could not read the file (Bad file descriptor).
Unable to start Dr. Konqi
Re-raising signal for core dump handling.
zsh: segmentation fault (core dumped)  konsole
Comment 1 Martin Sandsmark 2017-01-28 19:10:00 UTC
Can you run it in gdb and get a stacktrace?

https://wiki.archlinux.org/index.php/Debug_-_Getting_Traces
Comment 2 Norman 2017-02-01 11:09:13 UTC
Created attachment 103744 [details]
typescript

On Saturday, 28 January 2017 19:10:00 GMT you wrote:
> https://bugs.kde.org/show_bug.cgi?id=375540
> 
> Martin Sandsmark <martin.sandsmark@kde.org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
> CC|                            |martin.sandsmark@kde.org
> 
> --- Comment #1 from Martin Sandsmark <martin.sandsmark@kde.org> ---
> Can you run it in gdb and get a stacktrace?
> 
> https://wiki.archlinux.org/index.php/Debug_-_Getting_Traces

gdb run typescript attached
Comment 3 Christoph Feck 2017-02-01 22:32:54 UTC
It looks like there are ambiguous keyboard shortcuts. KXmlGui opens a message box, and the crash could be related to the nested event loop in QDialog::exec().

Try resetting your Konsole configuration, if you customized shortcuts.

Backtrace from comment #2:
Thread 1 "konsole" received signal SIGSEGV, Segmentation fault.
0x00007ffff75908c4 in Konsole::ViewManager::saveSessions(KConfigGroup&) () from /usr/lib/libkonsoleprivate.so.16
(gdb) bt full
#0  0x00007ffff75908c4 in Konsole::ViewManager::saveSessions(KConfigGroup&) () from /usr/lib/libkonsoleprivate.so.16
#1  0x00007ffff6df1370 in KMainWindow::savePropertiesInternal(KConfig*, int) () from /usr/lib/libKF5XmlGui.so.5
#2  0x00007ffff6df155e in ?? () from /usr/lib/libKF5XmlGui.so.5
#3  0x00007ffff3e31149 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/libQt5Core.so.5
#4  0x00007ffff45e3d35 in QGuiApplication::saveStateRequest(QSessionManager&) () from /usr/lib/libQt5Gui.so.5
#5  0x00007ffff45e5e8b in QGuiApplicationPrivate::saveState() () from /usr/lib/libQt5Gui.so.5
#6  0x00007fffe51cb72d in ?? () from /usr/lib/libQt5XcbQpa.so.5
#7  0x00007fffe51cbab4 in ?? () from /usr/lib/libQt5XcbQpa.so.5
#8  0x00007fffe4d58c38 in _SmcProcessMessage () from /usr/lib/libSM.so.6
#9  0x00007fffe4b4846c in IceProcessMessages () from /usr/lib/libICE.so.6
#10 0x00007ffff3e31149 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/libQt5Core.so.5
#11 0x00007ffff3eab52e in QSocketNotifier::activated(int, QSocketNotifier::QPrivateSignal) () from /usr/lib/libQt5Core.so.5
#12 0x00007ffff3e3ddc2 in QSocketNotifier::event(QEvent*) () from /usr/lib/libQt5Core.so.5
#13 0x00007ffff4d8234c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#14 0x00007ffff4d89b61 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#15 0x00007ffff3e05840 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#16 0x00007ffff3e5a8fd in ?? () from /usr/lib/libQt5Core.so.5
#17 0x00007fffed9a5587 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#18 0x00007fffed9a57f0 in ?? () from /usr/lib/libglib-2.0.so.0
#19 0x00007fffed9a589c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#20 0x00007ffff3e5a44f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#21 0x00007ffff3e03c9a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#22 0x00007ffff4f70917 in QDialog::exec() () from /usr/lib/libQt5Widgets.so.5
#23 0x00007ffff5c34d5b in KMessageBox::createKMessageBox(QDialog*, QDialogButtonBox*, QIcon const&, QString const&, QStringList const&, QString const&, bool*, QFlags<KMessageBox::Option>, QString const&, QMessageBox::Icon) () from /usr/lib/libKF5WidgetsAddons.so.5
#24 0x00007ffff5c3584c in KMessageBox::createKMessageBox(QDialog*, QDialogButtonBox*, QMessageBox::Icon, QString const&, QStringList const&, QString const&, bool*, QFlags<KMessageBox::Option>, QString const&) () from /usr/lib/libKF5WidgetsAddons.so.5
#25 0x00007ffff5c3b4df in KMessageBox::informationList(QWidget*, QString const&, QStringList const&, QString const&, QString const&, QFlags<KMessageBox::Option>) ()
   from /usr/lib/libKF5WidgetsAddons.so.5
#26 0x00007ffff5c3b641 in KMessageBox::information(QWidget*, QString const&, QString const&, QString const&, QFlags<KMessageBox::Option>) ()
   from /usr/lib/libKF5WidgetsAddons.so.5
#27 0x00007ffff6e4444e in KXmlGuiWindow::checkAmbiguousShortcuts() () from /usr/lib/libKF5XmlGui.so.5
#28 0x00007ffff6e44f88 in KXmlGuiWindow::createGUI(QString const&) () from /usr/lib/libKF5XmlGui.so.5
#29 0x00007ffff7bb2597 in ?? () from /usr/lib/libkdeinit5_konsole.so
#30 0x00007ffff7ba5920 in ?? () from /usr/lib/libkdeinit5_konsole.so
#31 0x00007ffff7ba5c84 in ?? () from /usr/lib/libkdeinit5_konsole.so
#32 0x00007ffff7bab19a in ?? () from /usr/lib/libkdeinit5_konsole.so
#33 0x00007ffff7bb9718 in kdemain () from /usr/lib/libkdeinit5_konsole.so
#34 0x00007ffff7813291 in __libc_start_main () from /usr/lib/libc.so.6
#35 0x000000000040065a in _start ()
Comment 4 Kurt Hindenburg 2017-02-02 04:45:03 UTC
If I manually enter an ambiguous shortcut in sessionui.rc, all I get is the dialog - no crashes.  It would be interesting to see what your ~/.local/share/kxmlgui5/konsole/*rc has for shortcuts
Comment 5 Norman Hull 2017-02-02 10:37:56 UTC
Created attachment 103770 [details]
Shortcut dialog

~/.local/share/kxmlgui5/konsole is empty

The reference to shortcuts is interesting.  For some time KDE had been pretending that it didn't recognise shortcuts until I went into the shortcuts setting dialog and reset them manually.

Since the last update, whenever a KDE application starts it gives a series of annoying error messages that each shortcut is assigned to two actions - each the same (see screenshot).

Thanks to the help received here I have told KD to reset shortcuts to the default and konsole starts up without problems.

Thank you - now I just have to add in the keystrokes to control my extra desktops!
Comment 6 Kurt Hindenburg 2017-02-03 03:02:52 UTC
good to hear - a little puzzling that Konsole would crash due to this - I wonder if there's a way to prevent that.
Comment 7 Orivej Desh 2017-03-08 03:00:11 UTC
Created attachment 104445 [details]
backtrace with some debuginfo

I encountered the same bug after upgrading Konsole from the version that used ~/.kde/share/apps/konsole/konsoleui.rc to 16.12.2.  I collected the traceback with some debuginfo (attached), noticed container = 0x0, recompiled with the following patch, and the konsole succesfully launched and allowed me to delete conflicting keybindings in the settings. After that I was unable to reproduce the bug, even by deleting ~/.local/share/kxmlgui5/konsole/konsoleui.rc.

diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp
index c187e64..b656ef2 100644
--- a/src/ViewManager.cpp
+++ b/src/ViewManager.cpp
@@ -904,6 +904,8 @@ void ViewManager::saveSessions(KConfigGroup& group)
 
     // first: sessions in the active container, preserving the order
     ViewContainer* container = _viewSplitter->activeContainer();
+    if (!container) {
+         return;
+    }
-    Q_ASSERT(container);
     TerminalDisplay* activeview = qobject_cast<TerminalDisplay*>(container->activeView());
Comment 8 Kurt Hindenburg 2017-04-22 01:08:29 UTC
*** Bug 379059 has been marked as a duplicate of this bug. ***
Comment 9 Kurt Hindenburg 2017-04-22 01:42:10 UTC
Git commit a2b6a81b45680deaa0dca62f502d52ef49b359bd by Kurt Hindenburg.
Committed on 22/04/2017 at 01:40.
Pushed by hindenburg into branch 'master'.

Add check for valid container (possible crash fix)

Possible fix for crashes from ambiguous shortcuts.  I have been unable
to duplicate the crashes.

M  +3    -0    src/ViewManager.cpp

https://commits.kde.org/konsole/a2b6a81b45680deaa0dca62f502d52ef49b359bd
Comment 10 Kurt Hindenburg 2017-05-07 14:06:57 UTC
Git commit 4e1f489e3437adf150780c424c03aa129ff41aab by Kurt Hindenburg.
Committed on 07/05/2017 at 13:57.
Pushed by hindenburg into branch 'Applications/17.04'.

Add check for valid container (possible crash fix)

Possible fix for crashes from ambiguous shortcuts.  I have been unable
to duplicate the crashes.
(cherry picked from commit a2b6a81b45680deaa0dca62f502d52ef49b359bd)

M  +3    -0    src/ViewManager.cpp

https://commits.kde.org/konsole/4e1f489e3437adf150780c424c03aa129ff41aab
Comment 11 Christoph Feck 2017-06-09 02:57:23 UTC
*** Bug 380991 has been marked as a duplicate of this bug. ***
Comment 12 Lukáš Turek 2017-06-20 11:35:14 UTC
The patch fixed the crash for me when applied to version 16.12.3. I had the shortcut Ctrl+Shift+N assigned to New Tab.
Comment 13 Christoph Feck 2017-06-27 19:22:53 UTC
Thanks for the update; closing.