Bug 458430 - KCoreConfigSkeleton::save() will leave an invalid file descriptor and make the number of fd reach the limit
Summary: KCoreConfigSkeleton::save() will leave an invalid file descriptor and make t...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kconfig
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.97.0
Platform: openSUSE Linux
: HI normal
Target Milestone: ---
Assignee: Matthew Dawson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-28 13:43 UTC by Fushan Wen
Modified: 2022-10-04 16:33 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fushan Wen 2022-08-28 13:43:19 UTC
SUMMARY
In accentColorService, calling KCoreConfigSkeleton::save()  will cause an invalid file descriptor to leave in the process, and eventually the fd limit will be reached.


STEPS TO REPRODUCE
1. Enable accent color from wallpaper in colors kcm
2. Play slideshow, 3 seconds one picture
3. Watch "lsof -p $(pidof kded5) | wc -l"

OBSERVED RESULT
The number of fd increases when accent color changes.

EXPECTED RESULT
No fd increase

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20220820
KDE Plasma Version: 5.25.80
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.5
Kernel Version: 5.19.2-1-default (64-bit)
Graphics Platform: X11
Comment 1 Fushan Wen 2022-09-07 00:28:12 UTC
*** Bug 458817 has been marked as a duplicate of this bug. ***
Comment 2 Bug Janitor Service 2022-10-01 06:03:22 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kde-gtk-config/-/merge_requests/47
Comment 3 Fushan Wen 2022-10-04 16:24:40 UTC
Git commit 3c2437815920856608a27361fe1da03e763742a5 by Fushan Wen.
Committed on 04/10/2022 at 15:41.
Pushed by fusionfuture into branch 'master'.

kded: properly delete factory to fix file descriptor leak

Not unloading the plugin loader will cause file descriptor leaks in
kded, and when fd limit is reached, accent color can't be updated
anymore because updating accent color requires writing to kdeglobals.
This fixes the leak and also fixes the accent color bug.
Related: bug 458817, bug 459870
FIXED-IN: 5.26

M  +5    -5    kded/kwin_bridge/dummydecorationbridge.cpp
M  +2    -1    kded/kwin_bridge/dummydecorationbridge.h

https://invent.kde.org/plasma/kde-gtk-config/commit/3c2437815920856608a27361fe1da03e763742a5
Comment 4 Fushan Wen 2022-10-04 16:33:23 UTC
Git commit d5c646f151d1ac7e3fc7c5ff9178b000321a9ab6 by Fushan Wen.
Committed on 04/10/2022 at 16:33.
Pushed by fusionfuture into branch 'Plasma/5.26'.

kded: properly delete factory to fix file descriptor leak

Not unloading the plugin loader will cause file descriptor leaks in
kded, and when fd limit is reached, accent color can't be updated
anymore because updating accent color requires writing to kdeglobals.
This fixes the leak and also fixes the accent color bug.
Related: bug 458817, bug 459870
FIXED-IN: 5.26


(cherry picked from commit 3c2437815920856608a27361fe1da03e763742a5)

M  +5    -5    kded/kwin_bridge/dummydecorationbridge.cpp
M  +2    -1    kded/kwin_bridge/dummydecorationbridge.h

https://invent.kde.org/plasma/kde-gtk-config/commit/d5c646f151d1ac7e3fc7c5ff9178b000321a9ab6