Bug 444921 - ksgrd_network_helper aborted when starting plasma-systemmonitor 5.23.2
Summary: ksgrd_network_helper aborted when starting plasma-systemmonitor 5.23.2
Status: RESOLVED FIXED
Alias: None
Product: plasma-systemmonitor
Classification: Applications
Component: general (show other bugs)
Version: 5.23.2
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-04 06:30 UTC by Matt Fagnani
Modified: 2021-11-04 16:52 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.23.3


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Fagnani 2021-11-04 06:30:43 UTC
SUMMARY

ksgrd_network_helper aborted 6/6 times when starting plasma-systemmonitor in Plasma 5.23.2 on Wayland in a Fedora 35 KDE Plasma installation. The crashes happened right after plasma-systemmonitor started to the Overview screen. 5/6 of the ksgrd_network_helper crashes had traces which involved ConnectionMapping::~ConnectionMapping as follows

Core was generated by `/usr/libexec/ksysguard/ksgrd_network_helper'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, 
    no_tid=no_tid@entry=0) at pthread_kill.c:44
44            return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
[Current thread is 1 (Thread 0x7fd5fed08fc0 (LWP 5117))]
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, 
    no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007fd5fe8b38c3 in __pthread_kill_internal (signo=6, threadid=<optimized out>)
    at pthread_kill.c:78
#2  0x00007fd5fe8666b6 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007fd5fe8507d3 in __GI_abort () at abort.c:79
#4  0x00007fd5feaf5a46 in __gnu_cxx::__verbose_terminate_handler ()
    at ../../../../libstdc++-v3/libsupc++/vterminate.cc:95
#5  0x00007fd5feb0129c in __cxxabiv1::__terminate (handler=<optimized out>)
    at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:48
#6  0x00007fd5feb01307 in std::terminate () at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:58
#7  0x000055b5febb50fc in std::thread::~thread (this=<optimized out>, this=<optimized out>)
    at /usr/include/c++/11/bits/std_thread.h:152
#8  ConnectionMapping::~ConnectionMapping (this=<optimized out>, this=<optimized out>)
    at /usr/src/debug/libksysguard-5.23.2-1.fc35.x86_64/processcore/plugins/network/helper/ConnectionMapping.h:26
#9  __gnu_cxx::new_allocator<ConnectionMapping>::destroy<ConnectionMapping> (__p=<optimized out>, 
    this=<optimized out>) at /usr/include/c++/11/ext/new_allocator.h:168
#10 std::allocator_traits<std::allocator<ConnectionMapping> >::destroy<ConnectionMapping> (
    __p=<optimized out>, __a=...) at /usr/include/c++/11/bits/alloc_traits.h:531
#11 std::_Sp_counted_ptr_inplace<ConnectionMapping, std::allocator<ConnectionMapping>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=<optimized out>) at /usr/include/c++/11/bits/shared_ptr_base.h:528
--Type <RET> for more, q to quit, c to continue without paging--c
#12 0x000055b5febb5247 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x55b5ff23a830) at /usr/include/c++/11/bits/shared_ptr_base.h:168
#13 0x000055b5febb36fb in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=<optimized out>, this=<optimized out>) at /usr/include/c++/11/bits/shared_ptr_base.h:702
#14 std::__shared_ptr<ConnectionMapping, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=<optimized out>, this=<optimized out>) at /usr/include/c++/11/bits/shared_ptr_base.h:1154
#15 std::shared_ptr<ConnectionMapping>::~shared_ptr (this=<optimized out>, this=<optimized out>) at /usr/include/c++/11/bits/shared_ptr.h:122
#16 main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/libksysguard-5.23.2-1.fc35.x86_64/processcore/plugins/network/helper/main.cpp:94

The journal at the time of the crashes showed errors like:
plasma-systemmonitor[2577]: org.kde.ksysguard.plugin.network: Helper process terminated abnormally!
plasma-systemmonitor[2577]: org.kde.ksysguard.plugin.network: "The process doesn't have permission to open the capture source\nterminate called without an active exception\n"

Nov 04 01:47:53 systemd[1106]: Started System Monitor - System Monitor.
Nov 04 01:47:54 plasma-systemmonitor[2577]: kf.kirigami: Units.devicePixelRatio is deprecated (since 5.86 ): This returns 1 when using Qt HiDPI scaling.
Nov 04 01:47:54 systemd[1106]: Starting Track hardware statistics...
Nov 04 01:47:54 NetworkManager[922]: <info>  [1636004874.4886] audit: op="statistics" interface="enp1s0" ifindex=2 args="500" pid=2589 uid=1000 result="success"
Nov 04 01:47:54 NetworkManager[922]: <info>  [1636004874.5509] audit: op="statistics" interface="wlp2s0" ifindex=3 args="500" pid=2589 uid=1000 result="success"
Nov 04 01:47:54 audit: BPF prog-id=49 op=LOAD
Nov 04 01:47:54 audit: BPF prog-id=50 op=LOAD
Nov 04 01:47:54 systemd[1]: Starting Hostname Service...
Nov 04 01:47:54 systemd[1106]: Started Track hardware statistics.
Nov 04 01:47:54 NetworkManager[922]: <info>  [1636004874.6293] audit: op="statistics" interface="wlp2s0" ifindex=3 args="500" pid=2589 uid=1000 result="success"
Nov 04 01:47:54 systemd[1]: Started Hostname Service.
Nov 04 01:47:54 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-hostnamed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Nov 04 01:47:55 plasma-systemmonitor[2577]: kf.kirigami: Units.devicePixelRatio is deprecated (since 5.86 ): This returns 1 when using Qt HiDPI scaling.
Nov 04 01:47:55 audit[2608]: ANOM_ABEND auid=1000 uid=1000 gid=1000 ses=3 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=2608 comm="ksgrd_network_h" exe="/usr/libexec/ksysguard/ksgrd_network_helper" sig=6 res=1
Nov 04 01:47:55 systemd[1]: Created slice Slice /system/systemd-coredump.
Nov 04 01:47:55 audit: BPF prog-id=51 op=LOAD
Nov 04 01:47:55 audit: BPF prog-id=52 op=LOAD
Nov 04 01:47:55 audit: BPF prog-id=53 op=LOAD
Nov 04 01:47:55 systemd[1]: Started Process Core Dump (PID 2615/UID 0).
Nov 04 01:47:55 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-coredump@0-2615-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Nov 04 01:47:55 plasma-systemmonitor[2577]: file:///usr/lib64/qt5/qml/QtQuick/Controls.2/org.kde.desktop/ScrollView.qml:99:27: QML ScrollBar: Binding loop detected for property "visible"
Nov 04 01:47:55 systemd-coredump[2624]: Process 2608 (ksgrd_network_h) of user 1000 dumped core.
                                        
                                        Found module linux-vdso.so.1 with build-id: 1a8ef68e53b362d3a5a2f0404974bd1693f8ef4d
                                        Found module libnl-route-3.so.200 with build-id: 25ac144713fd4d7ed0d9394a7d36c424b185fdf1
                                        Found module ld-linux-x86-64.so.2 with build-id: 7d2c06364366496318a96401aee1c204f80ee73a
                                        Found module libm.so.6 with build-id: fed79663436256eb88044bf3cff419c08487da77
                                        Found module libibverbs.so.1 with build-id: a54f51bbbab1f47243e2ad7bc5fb854aaade4e2a
                                        Found module libc.so.6 with build-id: f891252f9069edee265f92cfb9a163880999588b
                                        Found module libgcc_s.so.1 with build-id: 279c1648ee67377b5de1c45a244740beea48423e
                                        Found module libstdc++.so.6 with build-id: ee39599366a0d94a90b4d1b74bd39bb6ce9e4cea
                                        Found module libnl-3.so.200 with build-id: 9ec8cd67a8293913423a6e854ed3c21bb97ecf9e
                                        Found module libpcap.so.1 with build-id: d2259e63bc0fc951f7cc4d07c02d3b01a16ff76b
                                        Found module ksgrd_network_helper with build-id: d03464809b73938a3fe874120fc4955016a264f1
                                        Stack trace of thread 2608:
                                        #0  0x00007f18d362185c __pthread_kill_implementation (libc.so.6 + 0x8f85c)
                                        #1  0x00007f18d35d46b6 __GI_raise (libc.so.6 + 0x426b6)
                                        #2  0x00007f18d35be7d3 __GI_abort (libc.so.6 + 0x2c7d3)
                                        #3  0x00007f18d3863a46 _ZN9__gnu_cxx27__verbose_terminate_handlerEv.cold (libstdc++.so.6 + 0xa1a46)
                                        #4  0x00007f18d386f29c _ZN10__cxxabiv111__terminateEPFvvE (libstdc++.so.6 + 0xad29c)
                                        #5  0x00007f18d386f307 _ZSt9terminatev (libstdc++.so.6 + 0xad307)
                                        #6  0x0000562bbbea60fc _ZNSt23_Sp_counted_ptr_inplaceI17ConnectionMappingSaIS0_ELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv (ksgrd_network_helper + 0x60fc)
                                        #7  0x0000562bbbea6247 _ZNSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE10_M_releaseEv (ksgrd_network_helper + 0x6247)
                                        #8  0x0000562bbbea46fb main (ksgrd_network_helper + 0x46fb)
                                        #9  0x00007f18d35bf560 __libc_start_call_main (libc.so.6 + 0x2d560)
                                        #10 0x00007f18d35bf60c __libc_start_main_impl (libc.so.6 + 0x2d60c)
                                        #11 0x0000562bbbea5aa5 _start (ksgrd_network_helper + 0x5aa5)
                                        
                                        Stack trace of thread 2609:
                                        #0  0x00007f18d366a3b5 __GI___clock_nanosleep (libc.so.6 + 0xd83b5)
                                        #1  0x00007f18d366efb7 __GI___nanosleep (libc.so.6 + 0xdcfb7)
                                        #2  0x0000562bbbea8b39 _ZN17ConnectionMapping4loopEv (ksgrd_network_helper + 0x8b39)
                                        #3  0x00007f18d389bc84 execute_native_thread_routine (libstdc++.so.6 + 0xd9c84)
                                        #4  0x00007f18d361fb17 start_thread (libc.so.6 + 0x8db17)
                                        #5  0x00007f18d36a46a0 __clone3 (libc.so.6 + 0x1126a0)
Nov 04 01:47:55 audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-coredump@0-2615-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Nov 04 01:47:55 systemd[1]: systemd-coredump@0-2615-0.service: Deactivated successfully.
Nov 04 01:47:55 audit: BPF prog-id=53 op=UNLOAD
Nov 04 01:47:55 audit: BPF prog-id=52 op=UNLOAD
Nov 04 01:47:55 audit: BPF prog-id=51 op=UNLOAD
Nov 04 01:47:55 plasma-systemmonitor[2577]: org.kde.ksysguard.plugin.network: Helper process terminated abnormally!
Nov 04 01:47:55 plasma-systemmonitor[2577]: org.kde.ksysguard.plugin.network: "The process doesn't have permission to open the capture source\nterminate called without an active exception\n"
Nov 04 01:47:55 wireplumber[1497]: <WpSiStandardLink:0x7f8348004f10> link-factory: unknown input port 67
Nov 04 01:47:55 wireplumber[1497]: <WpSiStandardLink:0x7f8348004f10> failed to activate si-standard-link: link-factory: unknown input port 67
Nov 04 01:47:57 abrt-server[2631]: Package 'libksysguard' isn't signed with proper key
Nov 04 01:47:57 abrt-server[2631]: 'post-create' on '/var/spool/abrt/ccpp-2021-11-04-01:47:55.777593-2608' exited with 1
Nov 04 01:47:57 abrt-server[2631]: Deleting problem directory '/var/spool/abrt/ccpp-2021-11-04-01:47:55.777593-2608'

One crash had a different trace involving ConnectionMapping::parsePid.

Core was generated by `/usr/libexec/ksysguard/ksgrd_network_helper'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, 
    no_tid=no_tid@entry=0) at pthread_kill.c:44
44            return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
[Current thread is 1 (Thread 0x7f8e0010b640 (LWP 4314))]
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, 
    no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007f8e0032b8c3 in __pthread_kill_internal (signo=6, threadid=<optimized out>)
    at pthread_kill.c:78
#2  0x00007f8e002de6b6 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007f8e002c87d3 in __GI_abort () at abort.c:79
#4  0x0000562821f545b4 in std::__replacement_assert (__file=<optimized out>, __line=<optimized out>, 
    __function=<optimized out>, __condition=<optimized out>)
    at /usr/include/c++/11/x86_64-redhat-linux/bits/c++config.h:2660
#5  0x0000562821f571cf in std::array<char, 100ul>::operator[] (this=<optimized out>, 
    __n=<optimized out>) at /usr/include/c++/11/array:186
#6  std::array<char, 100ul>::operator[] (__n=<optimized out>, this=0x7f8e0010ad90)
    at /usr/include/c++/11/array:186
#7  ConnectionMapping::parsePid (this=0x562822bd5840)
    at /usr/src/debug/libksysguard-5.23.2-1.fc35.x86_64/processcore/plugins/network/helper/ConnectionMapping.cpp:228
#8  ConnectionMapping::loop (this=0x562822bd5840)
    at /usr/src/debug/libksysguard-5.23.2-1.fc35.x86_64/processcore/plugins/network/helper/ConnectionMapping.cpp:143
#9  0x00007f8e005a5c84 in std::execute_native_thread_routine (__p=0x562822bd59e0)
    at ../../../../../libstdc++-v3/src/c++11/thread.cc:82
#10 0x00007f8e00329b17 in start_thread (arg=<optimized out>) at pthread_create.c:435
--Type <RET> for more, q to quit, c to continue without paging--c
#11 0x00007f8e003ae6a0 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

 I'm guessing that crash is related to the others, but I could make another report if that would be more appropriate

STEPS TO REPRODUCE
1. Boot a Fedora 35 KDE Plasma installation updated to 2021-11-04 with the updates-testing repo enabled
2. Log in to Plasma on Wayland
3. start konsole
4. Update from Plasma 5.22.5 to 5.23.2. I did this by the following since the full Plasma 5.23.2 at https://bodhi.fedoraproject.org/updates/FEDORA-2021-f7d19c8901 isn't in the updates-testing repo yet.
5. bodhi updates download --updateid FEDORA-2021-f7d19c8901
6. Log out of Plasma
7. Switch to another VT
8. Log in on the VT
9. Switch to the directory the Plasma 5.23.2 rpms were downloaded to
10. sudo dnf upgrade *rpm
11. reboot
12. Log into Plasma 5.23.2 on wayland
13. Start plasma-systemmonitor 5.23.2
When Plasma 5.23.2 is in the updates-testing repo the update could just be done with
sudo dnf offline-upgrade download (with updates-testing enabled)
sudo dnf offline-upgrade reboot

OBSERVED RESULT
ksgrd_network_helper aborted when starting plasma-systemmonitor 5.23.2

EXPECTED RESULT
No crashes would happen

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 35
(available in About System)
KDE Plasma Version: 5.23.2
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
I didn't see anything look unusual in the plasma-systemmonitor window. These crashes didn't happen with plasma-systemmonitor 5.22.5 or earlier.
Comment 1 Arjen Hiemstra 2021-11-04 10:39:51 UTC
https://invent.kde.org/plasma/libksysguard/-/merge_requests/193 takes care of the abort. That said, the abort shouldn't really happen in the first place and only seems to happen because of a packaging bug. `ksgrd_network_helper` needs `CAP_NET_RAW` to run, as it needs to capture all the packets going over network devices. It seems Fedora's package doesn't set that. That should be reported to Fedora somewhere.
Comment 2 Arjen Hiemstra 2021-11-04 10:42:06 UTC
Git commit 457bac238af23539134525ea4cfb37cca870e9ca by Arjen Hiemstra, on behalf of Loïc Yhuel.
Committed on 04/11/2021 at 10:41.
Pushed by ahiemstra into branch 'master'.

Fix ksgrd_network_helper crash on exit afer a failure

On an early return in main, the ConnectionMapping thread was destroyed without being
properly joined, leading to an abort.
So ConnectionMapping::stop has been changed into a destructor.

m_running is also now set from the main thread, to ensure any early destruction while the
thread is starting stops it properly.

M  +10   -10   processcore/plugins/network/helper/ConnectionMapping.cpp
M  +1    -2    processcore/plugins/network/helper/ConnectionMapping.h
M  +0    -1    processcore/plugins/network/helper/main.cpp

https://invent.kde.org/plasma/libksysguard/commit/457bac238af23539134525ea4cfb37cca870e9ca
Comment 3 Arjen Hiemstra 2021-11-04 10:43:17 UTC
Git commit 1344cf98af560570fc661b175643b7a90cb7ac52 by Arjen Hiemstra, on behalf of Loïc Yhuel.
Committed on 04/11/2021 at 10:43.
Pushed by ahiemstra into branch 'Plasma/5.23'.

Fix ksgrd_network_helper crash on exit afer a failure

On an early return in main, the ConnectionMapping thread was destroyed without being
properly joined, leading to an abort.
So ConnectionMapping::stop has been changed into a destructor.

m_running is also now set from the main thread, to ensure any early destruction while the
thread is starting stops it properly.


(cherry picked from commit 457bac238af23539134525ea4cfb37cca870e9ca)

M  +10   -10   processcore/plugins/network/helper/ConnectionMapping.cpp
M  +1    -2    processcore/plugins/network/helper/ConnectionMapping.h
M  +0    -1    processcore/plugins/network/helper/main.cpp

https://invent.kde.org/plasma/libksysguard/commit/1344cf98af560570fc661b175643b7a90cb7ac52
Comment 4 Matt Fagnani 2021-11-04 11:46:05 UTC
(In reply to Arjen Hiemstra from comment #1)
> https://invent.kde.org/plasma/libksysguard/-/merge_requests/193 takes care
> of the abort. That said, the abort shouldn't really happen in the first
> place and only seems to happen because of a packaging bug.
> `ksgrd_network_helper` needs `CAP_NET_RAW` to run, as it needs to capture
> all the packets going over network devices. It seems Fedora's package
> doesn't set that. That should be reported to Fedora somewhere.

Arjen, I've quoted your comment in one on my report for Fedora at https://bugzilla.redhat.com/show_bug.cgi?id=2020138#c1 Thanks.