Bug 477001

Summary: System Settings crashes on quit while the Font Management KCM was open
Product: [Applications] systemsettings Reporter: Patrick Silva <bugseforuns>
Component: kcm_fontinstAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: bednarczyk.pawel, kde, nate
Priority: NOR Keywords: drkonqi, qt6
Version First Reported In: 5.27.80   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=477191
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: New crash information added by DrKonqi
dump debug symbols

Description Patrick Silva 2023-11-14 17:12:59 UTC
Application: systemsettings (5.81.0)

Qt Version: 6.6.0
Frameworks Version: 5.245.0
Operating System: Linux 6.5.7-060507-generic x86_64
Windowing System: Wayland
Distribution: KDE neon Unstable Edition
DrKonqi: 5.81.0 [CoredumpBackend]

-- Information about the crash:
open Font Management KCM, close System Settings; Plasma notifies a crash.
Can also reproduce on Arch Linux running Plasma 6 alpha.

The crash can be reproduced every time.

-- Backtrace (Reduced):
#7  0x00007f6686227b7e in QWidget::ensurePolished() const (this=0x55ab53fc5200) at ./src/widgets/kernel/qwidget.cpp:10230
#8  0x00007f668611e7af in QSplitter::sizes() const (this=<optimized out>) at ./src/widgets/widgets/qsplitter.cpp:1563
#9  0x00007f66642a025b in KFI::CKCmFontInst::~CKCmFontInst() (this=0x55ab5406e500, __in_chrg=<optimized out>) at /usr/include/x86_64-linux-gnu/qt6/QtCore/qflags.h:74
#10 0x00007f66642a041d in KFI::CKCmFontInst::~CKCmFontInst() (this=0x55ab5406e500, __in_chrg=<optimized out>) at ./kcms/kfontinst/kcmfontinst/KCmFontInst.cpp:360
#11 0x00007f66841c7c0a in QObjectPrivate::deleteChildren() (this=this@entry=0x55ab540672b0) at ./src/corelib/kernel/qobject.cpp:2206


Reported using DrKonqi
Comment 1 Patrick Silva 2023-11-14 17:13:02 UTC
Created attachment 163157 [details]
New crash information added by DrKonqi

DrKonqi auto-attaching complete backtrace.
Comment 2 Pawel 2023-11-14 20:56:41 UTC
Created attachment 163164 [details]
dump debug symbols

confirmed - also on arch 

Operating System: Arch Linux 
KDE Plasma Version: 5.27.80
KDE Frameworks Version: 5.245.0
Qt Version: 6.6.0
Kernel Version: 6.7.0-rc1-next-20231114-1-next-git-01346-g5ba73bec5e7b-dirty (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 5900X 12-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 6800 XT
Comment 3 Nate Graham 2023-11-14 22:38:01 UTC
Can also confirm.
Comment 4 Harald Sitter 2023-11-25 18:56:15 UTC
Git commit cf04d02a42ff08f332d6ed55fa894c7e1c61b4cc by Harald Sitter.
Committed on 25/11/2023 at 19:39.
Pushed by sitter into branch 'master'.

kfontinst: don't crash on exit

lifetimes have changed in kf6: `widget()` is a child of `parent` and as
such a sibling to `CKCmFontInst` what happens at destruction is that
~parent runs -> ~widget runs (destroys its children - among them the
splitters) then ~CKCmFontInst runs -> crash.

Instead simply hold on to the destroyed signal of widget which fires
before its children (the splitters) get destroyed.

It feels a bit hacky but in the grands scheme of things the widget code
is not long for this world anyway.

Fixes SYSTEMSETTINGS-3A

M  +8    -4    kcms/kfontinst/kcmfontinst/KCmFontInst.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/cf04d02a42ff08f332d6ed55fa894c7e1c61b4cc