Summary: | ksystemstats crashes on startup | ||
---|---|---|---|
Product: | [Unmaintained] ksysguard | Reporter: | Luca Beltrame <lbeltrame> |
Component: | general | Assignee: | KSysGuard Developers <ksysguard-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | fabian, kde, kde, nate, plasma-bugs |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/ksystemstats/commit/207b8960a6fcd531584283f9475081d2dcf0f4aa | Version Fixed In: | 5.23 |
Sentry Crash Report: | |||
Attachments: | Backtrace of the crash |
Description
Luca Beltrame
2021-09-05 07:29:51 UTC
Pasting inline for search #0 0x00007ffff79dffc9 in operator==(QString const&, QString const&) () from /lib64/libQt5Core.so.5 #1 0x00007ffff7ed5c39 in KSysGuard::SensorProperty::setName (this=0x7ffff7640a60 <main_arena+96>, name=...) at /usr/src/debug/libksysguard5-5.22.80git.20210904T011806~8247320-ku.38.1.x86_64/systemstats/SensorProperty.cpp:71 #2 0x00007ffff340a53b in GpuDevice::initialize (this=0x5555556de740) at /usr/src/debug/ksystemstats5-5.22.80git.20210903T113040~ede1aab-ku.22.3.x86_64/plugins/gpu/GpuDevice.cpp:49 #3 0x00007ffff340b164 in LinuxAmdGpu::initialize (this=0x5555556de740) at /usr/src/debug/ksystemstats5-5.22.80git.20210903T113040~ede1aab-ku.22.3.x86_64/plugins/gpu/LinuxAmdGpu.cpp:56 #4 0x00007ffff340c71f in LinuxBackend::start (this=0x5555556cc9e0) at /usr/src/debug/ksystemstats5-5.22.80git.20210903T113040~ede1aab-ku.22.3.x86_64/plugins/gpu/LinuxBackend.cpp:64 #5 0x00007ffff3409770 in GpuPlugin::GpuPlugin (args=..., parent=0x7fffffffd338, this=0x5555556cba90) at /usr/src/debug/ksystemstats5-5.22.80git.20210903T113040~ede1aab-ku.22.3.x86_64/plugins/gpu/GpuPlugin.cpp:44 #6 KPluginFactory::createInstance<GpuPlugin, QObject> (parentWidget=<optimized out>, parent=<optimized out>, args=...) at /usr/include/KF5/KCoreAddons/kpluginfactory.h:806 It looks like the sensor property is constructed improperly (garbage when trying to check it from gdb), but I'm not sure how to debug this further. By sensor property I mean m_temperatureProperty in plugins/gpu/GpuDevice.cpp. FWICT, the issue is that m_temperatureProperty and the other members are never initialized, so the check for nullptr in LinuxAmdGpu::makeSensors also fails. Does it work with the following change? diff --git a/plugins/gpu/GpuDevice.h b/plugins/gpu/GpuDevice.h index 18ddedc..1450d9f 100644 --- a/plugins/gpu/GpuDevice.h +++ b/plugins/gpu/GpuDevice.h @@ -28,7 +28,7 @@ protected: KSysGuard::SensorProperty *m_usageProperty; KSysGuard::SensorProperty *m_totalVramProperty; KSysGuard::SensorProperty *m_usedVramProperty; - KSysGuard::SensorProperty *m_temperatureProperty; + KSysGuard::SensorProperty *m_temperatureProperty = nullptr; KSysGuard::SensorProperty *m_coreFrequencyProperty; KSysGuard::SensorProperty *m_memoryFrequencyProperty; }; This at least prevents ksystemstats from crashing. There's another issue now which I'll report a separate bug for later. It's a bit weird that we have a member in the superclass that's created in the subclass overriding the superclass creation of it. But for the design we have, the patch looks sane. A possibly relevant merge request was started @ https://invent.kde.org/plasma/ksystemstats/-/merge_requests/18 Git commit 207b8960a6fcd531584283f9475081d2dcf0f4aa by David Edmundson. Committed on 06/09/2021 at 12:16. Pushed by davidedmundson into branch 'master'. [plugins/gpu] Initialise properties Properties are created in the relevant subclass via makeSensors. If an implementation fails to create an object we don't want dangling pointers. M +7 -7 plugins/gpu/GpuDevice.h https://invent.kde.org/plasma/ksystemstats/commit/207b8960a6fcd531584283f9475081d2dcf0f4aa |