Bug 466086

Summary: System Settings crashed in KCMiscKeyboardWidget::setRepeat() when when clicking the Hardware > Input Devices tab
Product: [Applications] systemsettings Reporter: tamim <tbacc+kde>
Component: kcm_keyboardAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: crash CC: butirsky, nate
Priority: NOR Keywords: drkonqi
Version First Reported In: 5.27.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Crash Log with debugsybols

Description tamim 2023-02-19 13:54:59 UTC
Application: systemsettings (5.27.0)

Qt Version: 5.15.8
Frameworks Version: 5.103.0
Operating System: Linux 6.1.12-zen1-1-zen x86_64
Windowing System: X11
Distribution: "Arch Linux"
DrKonqi: 5.27.0 [KCrashBackend]

-- Information about the crash:
System Settings crash immediately clicking the Input Devices tab in the settings

The crash can be reproduced every time.

-- Backtrace:
Application: System Settings (systemsettings), signal: Segmentation fault
Content of s_kcrashErrorMessage: std::unique_ptr<char []> = {get() = 0x0}
[KCrash Handler]
#6  QWidget::testAttribute (attribute=<optimized out>, this=<optimized out>, this=<optimized out>, attribute=<optimized out>) at ../../include/QtWidgets/../../src/widgets/kernel/qwidget.h:883
#7  QWidget::isEnabled (this=<optimized out>, this=<optimized out>) at ../../include/QtWidgets/../../src/widgets/kernel/qwidget.h:780
#8  QAbstractButton::click (this=0x0) at widgets/qabstractbutton.cpp:893
#9  0x00007fb320b7dd60 in ?? () from /usr/lib/qt/plugins/plasma/kcms/systemsettings/kcm_keyboard.so
#10 0x00007fb3284b1bb0 in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5
#11 0x00007fb329178b5c in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x557734bfbe60, e=0x5577342f7540) at kernel/qapplication.cpp:3640
#12 0x00007fb32848df48 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#13 0x00007fb32848ea53 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQt5Core.so.5
#14 0x00007fb3284d4e88 in ?? () from /usr/lib/libQt5Core.so.5
#15 0x00007fb326f1682b in g_main_dispatch (context=0x7fb31c005010) at ../glib/glib/gmain.c:3454
#16 g_main_context_dispatch (context=0x7fb31c005010) at ../glib/glib/gmain.c:4172
#17 0x00007fb326f6dcc9 in g_main_context_iterate.constprop.0 (context=0x7fb31c005010, block=1, dispatch=1, self=<optimized out>) at ../glib/glib/gmain.c:4248
#18 0x00007fb326f150e2 in g_main_context_iteration (context=0x7fb31c005010, may_block=1) at ../glib/glib/gmain.c:4313
#19 0x00007fb3284d8c6c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#20 0x00007fb3284866ec in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#21 0x00007fb328491219 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#22 0x00007fb328939fe2 in QGuiApplication::exec () at kernel/qguiapplication.cpp:1870
#23 0x00007fb329176f2a in QApplication::exec () at kernel/qapplication.cpp:2832
#24 0x0000557731c55c07 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/systemsettings/systemsettings-5.27.0/app/main.cpp:188
[Inferior 1 (process 4949) detached]

Reported using DrKonqi
Comment 1 Nate Graham 2023-02-22 03:46:48 UTC
Thank you for the bug report! Unfortunately the backtrace is incomplete and missing debug symbols for the following lines that we need to figure out exactly what's going wrong:

> #9  0x00007fb320b7dd60 in ?? () from /usr/lib/qt/plugins/plasma/kcms/systemsettings/kcm_keyboard.so

Could you please install debug symbols for plasma, reproduce the crash, and attach a new symbolicated backtrace? See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Thanks again!
Comment 2 Bug Janitor Service 2023-03-09 03:45:38 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 3 tamim 2023-03-09 18:37:53 UTC
Created attachment 157158 [details]
Crash Log with debugsybols
Comment 4 tamim 2023-03-09 18:38:41 UTC
(In reply to Nate Graham from comment #1)
> Thank you for the bug report! Unfortunately the backtrace is incomplete and
> missing debug symbols for the following lines that we need to figure out
> exactly what's going wrong:
> 
> > #9  0x00007fb320b7dd60 in ?? () from /usr/lib/qt/plugins/plasma/kcms/systemsettings/kcm_keyboard.so
> 
> Could you please install debug symbols for plasma, reproduce the crash, and
> attach a new symbolicated backtrace? See
> https://community.kde.org/Guidelines_and_HOWTOs/Debugging/
> How_to_create_useful_crash_reports
> 
> Thanks again!

Sorry for the delay. Attached the backtrace
Comment 5 Nate Graham 2023-03-10 15:50:24 UTC
Pasting the relevant part inline for searchability:

[KCrash Handler]
#6  QWidget::testAttribute (attribute=<optimized out>, this=<optimized out>, this=<optimized out>, attribute=<optimized out>) at ../../include/QtWidgets/../../src/widgets/kernel/qwidget.h:883
#7  QWidget::isEnabled (this=<optimized out>, this=<optimized out>) at ../../include/QtWidgets/../../src/widgets/kernel/qwidget.h:780
#8  QAbstractButton::click (this=0x0) at widgets/qabstractbutton.cpp:893
#9  0x00007f970c240d60 in KCMiscKeyboardWidget::setRepeat (rate_=25, delay_=600, keyboardRepeat=<optimized out>, this=0x563e2cfb7c70) at /usr/src/debug/plasma-desktop/plasma-desktop-5.27.2/kcms/keyboard/kcmmisc.cpp:105
#10 KCMiscKeyboardWidget::load (this=0x563e2cfb7c70) at /usr/src/debug/plasma-desktop/plasma-desktop-5.27.2/kcms/keyboard/kcmmisc.cpp:133
#11 0x00007f9713ab1bb0 in QObject::event (this=0x563e2d94cf90, e=0x563e2cd2aed0) at kernel/qobject.cpp:1347

Programmatically clicking the button is weird.
Comment 6 Nate Graham 2023-03-10 15:51:34 UTC
Ahh, an idea. Can you paste the output of running `grep KeyRepeat ~/.config/kcminputrc` in a terminal window?
Comment 7 tamim 2023-03-10 16:05:42 UTC
(In reply to Nate Graham from comment #6)
> Ahh, an idea. Can you paste the output of running `grep KeyRepeat
> ~/.config/kcminputrc` in a terminal window?

grep KeyRepeat ~/.config/kcminputrc
KeyRepeat=accent
Comment 8 Nate Graham 2023-03-10 16:12:04 UTC
I  had a feeling. I tested with that setting and ran into the crash myself.

Accent isn't a valid option at this point since the feature it controls was never fully merged. There isn't a way to set the value of KeyRepeat to "accent" in the UI, so either you or something else manually edited the config file to set the value to "accent", or else it's a leftover from far in the past when you tested merge requests for the WIP feature or something.

Removing that line or changing "Accent" to either "repeat" or "nothing" will make it stop crashing.
Comment 9 tamim 2023-03-10 16:15:58 UTC
(In reply to Nate Graham from comment #8)
> I  had a feeling. I tested with that setting and ran into the crash myself.
> 
> Accent isn't a valid option at this point since the feature it controls was
> never fully merged. There isn't a way to set the value of KeyRepeat to
> "accent" in the UI, so either you or something else manually edited the
> config file to set the value to "accent", or else it's a leftover from far
> in the past when you tested merge requests for the WIP feature or something.
> 
> Removing that line or changing "Accent" to either "repeat" or "nothing" will
> make it stop crashing.

Must be a left over then. I never changed this manually. 
I can confirm, removing the value fixed the crash.

Thanks for taking the time!