Bug 461468

Summary: Crash when pressing particular sequence of function keys
Product: [Applications] khelpcenter Reporter: David Korth <gerbilsoft>
Component: generalAssignee: Documentation Editorial Team <kde-doc-english>
Status: CONFIRMED ---    
Severity: crash CC: aacid, enricobe, ostroffjh, resin
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: New crash information added by DrKonqi

Description David Korth 2022-11-05 18:49:33 UTC
While cleaning my keyboard, I managed to somehow crash KHelpCenter (22.08.3; this version isn't in the list).

I've narrowed it down to the following steps:
* Open KHelpCenter (e.g. by pressing F1 in KWrite).
* Press the following keys in sequence: F3, F1, F7
* Repeat the sequence: F3, F1, F7

Application: Help Center (khelpcenter), signal: Segmentation fault

[KCrash Handler]
#4  0x00007f7762160ad2 in setCaretInvisibleIfNeeded(KHTMLPart*) () from /usr/lib64/libKF5KHtml.so.5
#5  0x00007f7760676bd4 in doActivate<false> (sender=0x55a83a195f40, signal_index=4, argv=0x7ffffb9870c0) at /var/tmp/portage/dev-qt/qtcore-5.15.5-r3/work/qtbase-everywhere-src-5.15.5/src/corelib/kernel/qobject.cpp:3898
#6  0x00007f77612f2a42 in QAction::triggered (this=this@entry=0x55a83a195f40, _t1=<optimized out>) at .moc/moc_qaction.cpp:376
#7  0x00007f77612f80fb in QAction::activate (this=0x55a83a195f40, event=<optimized out>) at /var/tmp/portage/dev-qt/qtwidgets-5.15.5-r1/work/qtbase-everywhere-src-5.15.5/src/widgets/kernel/qaction.cpp:1161
#8  0x00007f77612f81cd in QAction::event (e=<optimized out>, this=<optimized out>) at /var/tmp/portage/dev-qt/qtwidgets-5.15.5-r1/work/qtbase-everywhere-src-5.15.5/src/widgets/kernel/qaction.cpp:1086
#9  QAction::event (this=<optimized out>, e=<optimized out>) at /var/tmp/portage/dev-qt/qtwidgets-5.15.5-r1/work/qtbase-everywhere-src-5.15.5/src/widgets/kernel/qaction.cpp:1075
#10 0x00007f77612feeeb in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x55a83a195f40, e=0x7ffffb987260) at /var/tmp/portage/dev-qt/qtwidgets-5.15.5-r1/work/qtbase-everywhere-src-5.15.5/src/widgets/kernel/qapplication.cpp:3637
#11 0x00007f7760646cb8 in QCoreApplication::notifyInternal2 (receiver=0x55a83a195f40, event=0x7ffffb987260) at /var/tmp/portage/dev-qt/qtcore-5.15.5-r3/work/qtbase-everywhere-src-5.15.5/src/corelib/kernel/qcoreapplication.cpp:1064
#12 0x00007f7760d35dfe in QShortcutMap::dispatchEvent (this=<optimized out>, e=<optimized out>) at /var/tmp/portage/dev-qt/qtgui-5.15.5-r2/work/qtbase-everywhere-src-5.15.5/src/gui/kernel/qshortcutmap.cpp:675
#13 0x00007f7760d36133 in QShortcutMap::tryShortcut (this=0x55a839a84908, e=0x7ffffb987320) at /var/tmp/portage/dev-qt/qtgui-5.15.5-r2/work/qtbase-everywhere-src-5.15.5/src/gui/kernel/qshortcutmap.cpp:343
#14 0x00007f7760cf0a3a in QWindowSystemInterface::handleShortcutEvent (window=<optimized out>, timestamp=311139463, keyCode=16777270, modifiers=..., nativeScanCode=73, nativeVirtualKey=65476, nativeModifiers=2, text=..., autorepeat=false, count=1) at /var/tmp/portage/dev-qt/qtgui-5.15.5-r2/work/qtbase-everywhere-src-5.15.5/src/gui/kernel/qwindowsysteminterface.cpp:477
#15 0x00007f7760d08481 in QGuiApplicationPrivate::processKeyEvent (e=0x55a83a71d650) at /var/tmp/portage/dev-qt/qtgui-5.15.5-r2/work/qtbase-everywhere-src-5.15.5/src/gui/kernel/qguiapplication.cpp:2395
#16 0x00007f7760cec59c in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at /var/tmp/portage/dev-qt/qtgui-5.15.5-r2/work/qtbase-everywhere-src-5.15.5/src/gui/kernel/qwindowsysteminterface.cpp:1169
#17 0x00007f775e176960 in userEventSourceDispatch (source=<optimized out>) at /var/tmp/portage/dev-qt/qtgui-5.15.5/work/qtbase-everywhere-src-5.15.5/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp:74
#18 0x00007f775e91e269 in g_main_dispatch (context=0x55a839aa4d70) at ../glib-2.74.1/glib/gmain.c:3444
#19 g_main_context_dispatch (context=0x55a839aa4d70) at ../glib-2.74.1/glib/gmain.c:4162
#20 0x00007f775e973418 in g_main_context_iterate.constprop.0 (context=0x55a839aa4d70, block=<optimized out>, dispatch=1, self=<optimized out>) at ../glib-2.74.1/glib/gmain.c:4238
#21 0x00007f775e91c880 in g_main_context_iteration (context=0x55a839aa4d70, may_block=1) at ../glib-2.74.1/glib/gmain.c:4303
#22 0x00007f776068fc26 in QEventDispatcherGlib::processEvents (this=0x55a839aa4610, flags=...) at /var/tmp/portage/dev-qt/qtcore-5.15.5-r3/work/qtbase-everywhere-src-5.15.5/src/corelib/kernel/qeventdispatcher_glib.cpp:425
#23 0x00007f7760645f7b in QEventLoop::exec (this=0x7ffffb987670, flags=...) at /var/tmp/portage/dev-qt/qtcore-5.15.5-r3/work/qtbase-everywhere-src-5.15.5/include/QtCore/../../src/corelib/global/qflags.h:69
#24 0x00007f776064726a in QCoreApplication::exec () at /var/tmp/portage/dev-qt/qtcore-5.15.5-r3/work/qtbase-everywhere-src-5.15.5/include/QtCore/../../src/corelib/global/qflags.h:121
#25 0x000055a838ac1bb3 in main ()
[Inferior 1 (process 3018290) detached]
Comment 1 Enrico 2022-11-05 20:08:36 UTC
Nice! :) I can reproduce this bug

Operating System: KDE neon 5.26
KDE Plasma Version: 5.26.2
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.7
Kernel Version: 5.15.0-52-generic (64-bit)
Graphics Platform: Wayland
Comment 2 Jack 2022-11-05 23:05:16 UTC
I get the same crash just typing F7 twice.

Artix Linux, kernel 6.0.7
khelpcenter 22.08.2
KDE Frameworks 5.99.0
KDE Plasma 5.26.2
Qt 5.15.7
Xorg Server 21.1.4

Application: Help Center (khelpcenter), signal: Segmentation fault
Content of s_kcrashErrorMessage: std::unique_ptr<char []> = {get() = <optimized out>}
[KCrash Handler]
#6  setCaretInvisibleIfNeeded (part=0x55d9148a1830) at /usr/src/debug/khtml/khtml-5.99.0/src/misc/shared.h:98
#7  0x00007f9ea8ebe1c0 in doActivate<false> (sender=0x55d914abd580, signal_index=4, argv=0x7ffec1e52d10) at kernel/qobject.cpp:3931
#8  0x00007f9ea9b6bec7 in QAction::triggered (this=this@entry=0x55d914abd580, _t1=<optimized out>) at .moc/moc_qaction.cpp:376
#9  0x00007f9ea9b718c7 in QAction::activate (this=0x55d914abd580, event=<optimized out>) at kernel/qaction.cpp:1161
#10 0x00007f9ea9b7198e in QAction::event (e=<optimized out>, this=<optimized out>) at kernel/qaction.cpp:1086
#11 QAction::event (this=<optimized out>, e=<optimized out>) at kernel/qaction.cpp:1075
#12 0x00007f9ea9b78b1c in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x55d914abd580, e=0x7ffec1e52ea0) at kernel/qapplication.cpp:3637
#13 0x00007f9ea8e8d578 in QCoreApplication::notifyInternal2 (receiver=0x55d914abd580, event=0x7ffec1e52ea0) at kernel/qcoreapplication.cpp:1064
#14 0x00007f9ea93742cd in QShortcutMap::dispatchEvent (this=<optimized out>, e=<optimized out>) at kernel/qshortcutmap.cpp:675
#15 0x00007f9ea936ab27 in QShortcutMap::tryShortcut (this=0x55d9145252c8, e=0x7ffec1e52f60) at kernel/qshortcutmap.cpp:343
#16 0x00007f9ea932a168 in QWindowSystemInterface::handleShortcutEvent (window=<optimized out>, timestamp=33169991, keyCode=16777270, modifiers=..., nativeScanCode=73, nativeVirtualKey=65476, nativeModifiers=0, text=..., autorepeat=false, count=1) at kernel/qwindowsysteminterface.cpp:477
#17 0x00007f9ea933fb22 in QGuiApplicationPrivate::processKeyEvent (e=0x55d914ff5820) at kernel/qguiapplication.cpp:2398
#18 0x00007f9ea93289b5 in QWindowSystemInterface::sendWindowSystemEvents (flags=flags@entry=...) at kernel/qwindowsysteminterface.cpp:1169
#19 0x00007f9ea35d6630 in xcbSourceDispatch (source=<optimized out>) at /usr/src/debug/qt5-base/qtbase/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp:105
#20 0x00007f9ea6f0f87b in g_main_dispatch (context=0x7f9e9c005010) at ../glib/glib/gmain.c:3444
#21 g_main_context_dispatch (context=0x7f9e9c005010) at ../glib/glib/gmain.c:4162
#22 0x00007f9ea6f66279 in g_main_context_iterate.constprop.0 (context=0x7f9e9c005010, block=1, dispatch=1, self=<optimized out>) at ../glib/glib/gmain.c:4238
#23 0x00007f9ea6f0e132 in g_main_context_iteration (context=0x7f9e9c005010, may_block=1) at ../glib/glib/gmain.c:4303
#24 0x00007f9ea8ed820c in QEventDispatcherGlib::processEvents (this=0x55d9145f5260, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#25 0x00007f9ea8e85d2c in QEventLoop::exec (this=0x7ffec1e53310, flags=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#26 0x00007f9ea8e90849 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#27 0x00007f9ea933a112 in QGuiApplication::exec () at kernel/qguiapplication.cpp:1870
#28 0x00007f9ea9b76f2a in QApplication::exec () at kernel/qapplication.cpp:2829
#29 0x000055d912a41a0f in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/khelpcenter/khelpcenter-22.08.2/application.cpp:145
[Inferior 1 (process 18699) detached]
Comment 3 Jack 2022-11-05 23:33:52 UTC
Settings/Configure Keyboard Shortcuts says F7 is "Toggle caret mode."  I can't find any mention about khelpcenter having caret mode.  Even searching the source files, the only mention I see of F7 is for Ctl-F7 "Present Windows of current application only" in the section on  "Moving Around."  I wonder if the system is getting confused because that key combination (just F7) doesn't actually map to anything in khelpcenter.
Comment 4 Albert Astals Cid 2022-11-06 11:03:22 UTC
That's a KHTML shortcut, may have to do with the khelpcenter<->khtml or khtml itself is broken
Comment 5 resin 2024-10-08 22:11:47 UTC
Created attachment 174547 [details]
New crash information added by DrKonqi

khelpcenter (5.8.22123) using Qt 5.15.8

Opened Help Center.
Tried to get the search in focus by,
Typing Ctrl + l , then trying / 
Help center crashed and the crash handler popped up.

-- Backtrace (Reduced):
#5  0x00007f10cc247ee8 in KHTMLPart::slotFindAheadText() () from /lib/x86_64-linux-gnu/libKF5KHtml.so.5
[...]
#7  0x00007f10caf5c782 in QAction::triggered(bool) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#8  0x00007f10caf5f3ab in QAction::activate(QAction::ActionEvent) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#9  0x00007f10caf5ff7d in QAction::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#10 0x00007f10caf62fae in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
Comment 6 David Korth 2024-10-09 00:46:10 UTC
Interestingly, I can't seem to reproduce this anymore with the KF6-based KHelpCenter, so something during the Qt6 transition must have fixed it.

Using KHelpCenter 24.08.1.