Bug 423111 - kcmshell5 crashes when trying to open 'Configure Window Manager' from the application icon in the title bar
Summary: kcmshell5 crashes when trying to open 'Configure Window Manager' from the app...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcmshell (show other bugs)
Version: 5.19.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
: 422840 423289 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-06-17 15:35 UTC by Guruprasad
Modified: 2020-06-24 07:28 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.19.2
Sentry Crash Report:


Attachments
New crash information added by DrKonqi (3.01 KB, text/plain)
2020-06-17 16:13 UTC, Yaroslav Sidlovsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Guruprasad 2020-06-17 15:35:37 UTC
Application: kcmshell5 (5.19.1)                                                                                                                                                                                            
                                                                                                                                                                                                                           
Qt Version: 5.15.0                                                                                                                                                                                                         
Frameworks Version: 5.71.0                                                                                                                                                                                                 
Operating System: Linux 5.7.2-arch1-1 x86_64                                                                                                                                                                               
Windowing system: X11                                                                                                                                                                                                      
Distribution: Arch Linux                                                                                                                                                                                                   
                                                                                                                                                                                                                           
-- Information about the crash:                                                                                                                                                                                            
Click the application icon in the top-left corner of the title bar. Navigate to 'More Actions' and click                                                                                                                   
'Configure Window Manager'. The crash happens and a notification shows up.                                                                                                                                                 
                                                                                                                                                                                                                           
The crash can be reproduced every time.                                                                                                                                                                                    
                                                                                                                                                                                                                           
-- Backtrace:                                                                                                                                                                                                              
                                                                                                                                                                                                                           
Application: System Settings Module (kcmshell5), signal: Segmentation fault                                                                                                                                                
                                                                                                                                                                                                                           
[KCrash Handler]                                                                                                                                                                                                           
#4  0x00007f560de14437 in QObjectPrivate::setParent_helper(QObject*) () from /usr/lib/libQt5Core.so.5                                                                                                                      
#5  0x00007f5600202630 in ?? () from /usr/lib/qt/plugins/kcm_kwinoptions.so                                                                                                                                                
#6  0x00007f56001f4757 in ?? () from /usr/lib/qt/plugins/kcm_kwinoptions.so                                                                                                                                                
#7  0x00007f560ef4fad5 in KPluginFactory::create(char const*, QWidget*, QObject*, QList<QVariant> const&, QString const&) () from /usr/lib/libKF5CoreAddons.so.5                                                           
#8  0x00007f560f27b062 in ?? () from /usr/lib/libKF5KCMUtils.so.5                                                                                                                                                          
#9  0x00007f560f27a1d3 in KCModuleLoader::loadModule(KCModuleInfo const&, KCModuleLoader::ErrorReporting, QWidget*, QStringList const&) () from /usr/lib/libKF5KCMUtils.so.5                                               
#10 0x00007f560f281e64 in ?? () from /usr/lib/libKF5KCMUtils.so.5                                                                                                                                                          
#11 0x00007f560f2822cb in KCModuleProxy::realModule() const () from /usr/lib/libKF5KCMUtils.so.5                                                                                                                           
#12 0x00007f560f280107 in KCMultiDialog::addModule(KCModuleInfo const&, KPageWidgetItem*, QStringList const&) () from /usr/lib/libKF5KCMUtils.so.5                                                                         
#13 0x00005625a115a0f6 in ?? ()                                                                                                                                                                                            
#14 0x00007f560d7b0002 in __libc_start_main () from /usr/lib/libc.so.6                                                                                                                                                     
#15 0x00005625a115abce in _start ()                                                                                                                                                                                        
[Inferior 1 (process 116512) detached]
Comment 1 David Edmundson 2020-06-17 15:50:22 UTC
Ooh, me too. 

yet kcmshell5 kwinoptions works
Comment 2 Yaroslav Sidlovsky 2020-06-17 16:13:24 UTC
Created attachment 129454 [details]
New crash information added by DrKonqi

kcmshell5 (5.19.1) using Qt 5.14.2

I've got just the same bug on 2 of my computers.
Here is backtrace.

-- Backtrace (Reduced):
#4  QObjectPrivate::setParent_helper (this=0x5628a13d12e0, o=0x5628a13d10b0) at kernel/qobject.h:132
#5  0x00007fbb674020b2 in KWinOptionsSettings::KWinOptionsSettings (this=0x5628a13d1230, parent=0x7ffda9be73e8) at /usr/src/debug/kwin-5.19.1-1.fc32.x86_64/x86_64-redhat-linux-gnu/kcmkwin/kwinoptions/kwinoptions_settings.cpp:9
#6  0x00007fbb673f4ab8 in KFocusConfigStandalone::KFocusConfigStandalone (parent=0x5628a13cf920, this=0x5628a13d10b0) at /usr/src/debug/kwin-5.19.1-1.fc32.x86_64/kcmkwin/kwinoptions/main.cpp:44
#7  KPluginFactory::createInstance<KFocusConfigStandalone, QWidget> (parentWidget=<optimized out>, parent=<optimized out>, args=...) at /usr/include/KF5/KCoreAddons/kpluginfactory.h:520
#8  0x00007fbb87f89f72 in KPluginFactory::create (this=this@entry=0x5628a1301010, iface=0x7fbb867f79b8 "KCModule", parentWidget=parentWidget@entry=0x0, parent=parent@entry=0x5628a13cf920, args=..., keyword=...) at /usr/src/debug/kf5-kcoreaddons-5.71.0-1.fc32.x86_64/src/lib/plugin/kpluginfactory.cpp:133
Comment 3 sggdev.im 2020-06-17 16:23:29 UTC
Same or similar bug

Application: kcmshell5 (5.19.0)

Qt Version: 5.15.0
Frameworks Version: 5.70.0
Operating System: Linux 5.7.1-1-default x86_64
Windowing system: X11
Distribution: "openSUSE Tumbleweed"

The crash can be reproduced every time.

-- Backtrace:
Application: (kcmshell5), signal: Segmentation fault

[KCrash Handler]
#4  0x00007fc321497b97 in std::__atomic_base<QThreadData*>::load (__m=std::memory_order_acquire, this=0x38) at /usr/include/c++/10/bits/atomic_base.h:741
#5  std::atomic<QThreadData*>::load (__m=std::memory_order_acquire, this=0x38) at /usr/include/c++/10/atomic:523
#6  QAtomicOps<QThreadData*>::loadAcquire<QThreadData*> (_q_value=...) at ../../include/QtCore/../../src/corelib/thread/qatomic_cxx11.h:251
#7  QBasicAtomicPointer<QThreadData>::loadAcquire (this=0x38) at ../../include/QtCore/../../src/corelib/thread/qbasicatomic.h:255
#8  QBasicAtomicPointer<QThreadData>::operator QThreadData* (this=0x38) at ../../include/QtCore/../../src/corelib/thread/qbasicatomic.h:251
#9  QObjectPrivate::setParent_helper (this=0x55d37a54ef00, o=0x55d37a54ed20) at kernel/qobject.cpp:2157
#10 0x00007fc30b0784ff in KWinOptionsSettings::KWinOptionsSettings (this=<optimized out>, parent=<optimized out>, this=<optimized out>, parent=<optimized out>) at /usr/src/debug/kwin5-5.19.0-1.1.x86_64/build/kcmkwin/kwinoptions/kwinoptions_settings.cpp:9
#11 0x00007fc30b075d94 in KFocusConfigStandalone::KFocusConfigStandalone (parent=0x55d37a557640, this=0x55d37a54ed20) at /usr/src/debug/kwin5-5.19.0-1.1.x86_64/kcmkwin/kwinoptions/main.cpp:44
#12 KPluginFactory::createInstance<KFocusConfigStandalone, QWidget> (parentWidget=<optimized out>, parent=<optimized out>, args=...) at /usr/include/KF5/KCoreAddons/kpluginfactory.h:520
#13 0x00007fc322646c72 in KPluginFactory::create (this=this@entry=0x55d37a3db2c0, iface=0x7fc320d09218 "KCModule", parentWidget=parentWidget@entry=0x0, parent=parent@entry=0x55d37a557640, args=..., keyword=...) at /usr/src/debug/kcoreaddons-5.70.0-1.2.x86_64/src/lib/plugin/kpluginfactory.cpp:133
#14 0x00007fc322965564 in KPluginFactory::create<KCModule> (parentWidget=0x0, args=..., keyword=..., parent=0x55d37a557640, this=0x55d37a3db2c0) at /usr/include/KF5/KCoreAddons/kpluginfactory.h:567
#15 KService::createInstance<KCModule> (parentWidget=0x0, error=0x7fff54b93490, args=..., parent=0x55d37a557640, this=0x55d37a1a8f10) at /usr/include/KF5/KService/kservice.h:557
#16 KService::createInstance<KCModule> (error=0x7fff54b93490, args=..., parent=0x55d37a557640, this=0x55d37a1a8f10) at /usr/include/KF5/KService/kservice.h:532
#17 KCModuleLoader::loadModule (mod=..., report=report@entry=KCModuleLoader::Inline, parent=0x55d37a557640, args=...) at /usr/src/debug/kcmutils-5.70.0-2.1.x86_64/src/kcmoduleloader.cpp:118
#18 0x00007fc322965fc4 in KCModuleProxyPrivate::loadModule (this=this@entry=0x55d37a557840) at /usr/src/debug/kcmutils-5.70.0-2.1.x86_64/src/kcmoduleproxy.cpp:94
#19 0x00007fc322966658 in KCModuleProxy::realModule (this=this@entry=0x55d37a557640) at /usr/src/debug/kcmutils-5.70.0-2.1.x86_64/src/kcmoduleproxy.cpp:67
#20 0x00007fc322966ae2 in KCMultiDialog::addModule (this=0x7fc30c008160, moduleInfo=..., parentItem=0x0, args=...) at /usr/src/debug/kcmutils-5.70.0-2.1.x86_64/src/kcmultidialog.cpp:496
#21 0x000055d3798c9ee0 in main (_argc=<optimized out>, _argv=<optimized out>) at /usr/include/qt5/QtCore/qbasicatomic.h:118
[Inferior 1 (process 7859) detached]
Comment 4 David Edmundson 2020-06-18 07:06:32 UTC
Relevant full line called from kwin crashes:

kcmshell5     --icon preferences-system-windows --desktopfile /opt/kde5/share/kservices5/kwinfocus.desktop kwindecoration kwinactions kwinfocus kwinmoving kwinadvanced kwinrules kwincompositing kwineffects kwintabbox kwinscreenedges kwinscripts
Comment 5 David Edmundson 2020-06-18 08:02:01 UTC
Minimal reproducible case:

kcmshell5 kwinoptions kwinfocus 

both work on their own..or with the order flipped
Comment 6 David Edmundson 2020-06-18 08:05:45 UTC
Aha! found it.

class KFocusConfigStandalone : public KFocusConfig
{
    Q_OBJECT
public:
    KFocusConfigStandalone(QWidget* parent, const QVariantList &)
        : KFocusConfig(true, new KWinOptionsSettings(this), parent)
    {
    }
};



The problem is KWinOptionsSettings(this) uses "this", before we've called the QObject superclass constructor on "this"
Comment 7 Bug Janitor Service 2020-06-18 10:06:51 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/64
Comment 8 Méven Car 2020-06-18 10:25:23 UTC
Git commit 396a9da557c8825cc6de2ca9cfd26babf6a9a5b0 by Méven Car.
Committed on 18/06/2020 at 10:15.
Pushed by meven into branch 'Plasma/5.19'.

KCMoptions: delay initialization after QObject creation in standalone
FIXED-IN: 5.19.2

M  +12   -6    kcmkwin/kwinoptions/main.cpp
M  +16   -2    kcmkwin/kwinoptions/mouse.cpp
M  +2    -0    kcmkwin/kwinoptions/mouse.h
M  +27   -5    kcmkwin/kwinoptions/windows.cpp
M  +4    -1    kcmkwin/kwinoptions/windows.h

https://invent.kde.org/plasma/kwin/commit/396a9da557c8825cc6de2ca9cfd26babf6a9a5b0
Comment 9 Wolfgang Bauer 2020-06-24 07:24:11 UTC
*** Bug 423289 has been marked as a duplicate of this bug. ***
Comment 10 Wolfgang Bauer 2020-06-24 07:28:06 UTC
*** Bug 422840 has been marked as a duplicate of this bug. ***