Bug 433013

Summary: New System Monitor in 5.21 without systemd crashes on startup in KSysGuard::CGroupDataModel::update()
Product: [Applications] plasma-systemmonitor Reporter: Marco Rebhan <me>
Component: generalAssignee: KSysGuard Developers <ksysguard-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: 288pat0tem, ahiemstra, asturm, kde, laguest, nate, nowa, plasma-bugs, sunzheng.david
Priority: VHI Keywords: drkonqi
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
URL: https://github.com/elogind/elogind#differences-relative-to-systemd
Latest Commit: Version Fixed In: 5.21.1
Sentry Crash Report:
Attachments: New crash information added by DrKonqi

Description Marco Rebhan 2021-02-16 16:34:42 UTC
Application: plasma-systemmonitor (5.21.0)
 (Compiled from sources)
Qt Version: 5.15.2
Frameworks Version: 5.79.0
Operating System: Linux 5.11.0-gentoo x86_64
Windowing System: X11
Drkonqi Version: 5.21.0
Distribution: "Gentoo Base System release 2.7"

-- Information about the crash:
- What I was doing when the application crashed:

Open System Monitor

Looks like this is caused by it expecting the directory /sys/fs/cgroup/unified/user.slice/user-1000.slice/user@1000.service to be there which it isn't on my system. (/sys/fs/cgroup/unified/user.slice doesn't exist)

The crash can be reproduced every time.

-- Backtrace:
Application: System Monitor (plasma-systemmonitor), signal: Aborted

[KCrash Handler]
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
#5  0x00007f14ab9cd536 in __GI_abort () at abort.c:79
#6  0x00007f14abc0d8dc in __gnu_cxx::__verbose_terminate_handler () at /usr/src/debug/sys-devel/gcc-10.2.0-r5/gcc-10.2.0/libstdc++-v3/libsupc++/vterminate.cc:95
#7  0x00007f14abc3c976 in __cxxabiv1::__terminate (handler=<optimized out>) at /usr/src/debug/sys-devel/gcc-10.2.0-r5/gcc-10.2.0/libstdc++-v3/libsupc++/eh_terminate.cc:48
#8  0x00007f14abc3c9e1 in std::terminate () at /usr/src/debug/sys-devel/gcc-10.2.0-r5/gcc-10.2.0/libstdc++-v3/libsupc++/eh_terminate.cc:58
#9  0x00007f14abc3cc83 in __cxxabiv1::__cxa_throw (obj=obj@entry=0x563860af7180, tinfo=0x7f14abdd3810 <typeinfo for std::filesystem::__cxx11::filesystem_error>, dest=0x7f14abd04f80 <std::filesystem::__cxx11::filesystem_error::~filesystem_error()>) at /usr/src/debug/sys-devel/gcc-10.2.0-r5/gcc-10.2.0/libstdc++-v3/libsupc++/eh_throw.cc:95
#10 0x00007f14abc116ab in std::filesystem::__cxx11::directory_iterator::directory_iterator (this=0x7ffd924706d0, p=filesystem::path "" = {...}, options=<optimized out>, ecptr=0x0) at /usr/src/debug/sys-devel/gcc-10.2.0-r5/build/x86_64-pc-linux-gnu/libstdc++-v3/include/ext/new_allocator.h:89
#11 0x00007f1464538298 in KSysGuard::CGroupDataModel::update(KSysGuard::CGroup*) () from /usr/lib64/libprocesscore.so.9
#12 0x00007f1464538c85 in KSysGuard::CGroupDataModel::update() () from /usr/lib64/libprocesscore.so.9
#13 0x00007f14ac050e2b in QObject::event (this=0x56386039c950, e=0x5638603ad410) at /usr/src/debug/dev-qt/qtcore-5.15.2-r2/qtbase-everywhere-src-5.15.2/src/corelib/kernel/qobject.cpp:1314
#14 0x00007f14aca9f503 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x56386039c950, e=0x5638603ad410) at /usr/src/debug/dev-qt/qtwidgets-5.15.2/qtbase-everywhere-src-5.15.2/src/widgets/kernel/qapplication.cpp:3632
#15 0x00007f14ac029fa8 in QCoreApplication::notifyInternal2 (receiver=0x56386039c950, event=0x5638603ad410) at /usr/src/debug/dev-qt/qtcore-5.15.2-r2/qtbase-everywhere-src-5.15.2/src/corelib/kernel/qcoreapplication.cpp:1063
#16 0x00007f14ac02cc17 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x56385f754af0) at /usr/src/debug/dev-qt/qtcore-5.15.2-r2/qtbase-everywhere-src-5.15.2/src/corelib/kernel/qcoreapplication.cpp:1817
#17 0x00007f14ac074f83 in postEventSourceDispatch (s=0x56385f7d7990) at /usr/src/debug/dev-qt/qtcore-5.15.2-r2/qtbase-everywhere-src-5.15.2/src/corelib/kernel/qeventdispatcher_glib.cpp:277
#18 0x00007f14aabff54b in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#19 0x00007f14aabff808 in ?? () from /usr/lib64/libglib-2.0.so.0
#20 0x00007f14aabff8bf in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#21 0x00007f14ac074a4f in QEventDispatcherGlib::processEvents (this=0x56385f7d04b0, flags=...) at /usr/src/debug/dev-qt/qtcore-5.15.2-r2/qtbase-everywhere-src-5.15.2/src/corelib/kernel/qeventdispatcher_glib.cpp:423
#22 0x00007f14ac028a6b in QEventLoop::exec (this=this@entry=0x7ffd92470b80, flags=..., flags@entry=...) at /usr/src/debug/dev-qt/qtcore-5.15.2-r2/qtbase-everywhere-src-5.15.2/include/QtCore/../../src/corelib/global/qflags.h:69
#23 0x00007f14ac0303c0 in QCoreApplication::exec () at /usr/src/debug/dev-qt/qtcore-5.15.2-r2/qtbase-everywhere-src-5.15.2/include/QtCore/../../src/corelib/global/qflags.h:121
#24 0x000056385ed75c73 in ?? ()
#25 0x00007f14ab9cee3a in __libc_start_main (main=0x56385ed74a90, argc=1, argv=0x7ffd92470f58, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffd92470f48) at ../csu/libc-start.c:314
#26 0x000056385ed7611a in ?? ()
[Inferior 1 (process 5406) detached]

Possible duplicates by query: bug 432084, bug 429344, bug 427384, bug 424911, bug 423951.

Reported using DrKonqi
Comment 1 kskot 2021-02-16 17:10:09 UTC
Created attachment 135727 [details]
New crash information added by DrKonqi

plasma-systemmonitor (5.21.0) using Qt 5.15.2

- What I was doing when the application crashed:

started new system monitor from new start menu

-- Backtrace (Reduced):
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#5  0x00007f485fb97859 in __GI_abort () at abort.c:79
[...]
#11 0x00007f47fc046436 in KSysGuard::CGroupDataModel::update(KSysGuard::CGroup*) () from /usr/lib/x86_64-linux-gnu/libprocesscore.so.9
#12 0x00007f47fc047930 in KSysGuard::CGroupDataModel::update() () from /usr/lib/x86_64-linux-gnu/libprocesscore.so.9
#13 0x00007f4860226239 in QObject::event (this=0x5575a1e55f10, e=0x5575a1e5ee10) at kernel/qobject.cpp:1314
Comment 2 Andreas Sturmlechner 2021-02-17 06:36:15 UTC
*** Bug 433038 has been marked as a duplicate of this bug. ***
Comment 3 Andreas Sturmlechner 2021-02-17 06:51:11 UTC
> Unlike systemd, whose logind arranges to manage resources for user sessions via 
> RPC calls to systemd, in elogind there is no systemd so there is no global 
> cgroup-based resource management. This has a few implications:
> 
> - Elogind does not create "slices" for users. Elogind will not record that 
>   users are associated with slices.
> - The /run/systemd/slices directory will always be empty.
> - Elogind does not have the concept of a "scope", internally, as it's the same
>   as a session. Any API that refers to scopes will always return an error code.
Comment 4 David Edmundson 2021-02-17 14:25:55 UTC
I think I accidentally fixed this in a patch that I did in master, just needs a backport
Comment 5 Bug Janitor Service 2021-02-17 16:12:38 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/libksysguard/-/merge_requests/121
Comment 6 Nate Graham 2021-02-17 16:25:22 UTC
Fixed by David Edmundson with https://invent.kde.org/plasma/libksysguard/-/commit/76a3570ab2f9fab98aa6ccc9ceafbbc29323db06 in Plasma 5.21.1
Comment 7 David Edmundson 2021-02-17 16:37:46 UTC
*** Bug 433086 has been marked as a duplicate of this bug. ***