https://bugs.kde.org/show_bug.cgi?id=484019

--- Comment #18 from Jiri Palecek <jpale...@web.de> ---
(In reply to Thomas Berger from comment #16)
> I was able to create a debug prefix. I found a very strange behavior:
> 
> 1. In `linuxcpu.cpp, line 89, we call `m_temperature->update()`
> 2. m_temperature is a pointer to `KSysGuard::SensorProperty` created by an
> earlier call to KSysGuard::makeSensorsFeatureSensor

Yeah, but is it really? It could be overwritten here
https://github.com/KDE/ksystemstats/blob/b994c553f2e5d5d235f289c0112f1509b18e4e45/plugins/cpu/linuxcpu.cpp#L57
or here
https://github.com/KDE/ksystemstats/blob/b994c553f2e5d5d235f289c0112f1509b18e4e45/plugins/cpu/cpu.cpp#L77.
Although it totally shouldn't and I couldn't find any recent change in the
(scant) git history that could do anything with it. It could be some undefined
behavior, but I couldn't find that either. Maybe it could be some linker snafu?

So to check it, if you can, please try this:

1) run ksystemstats under valgrind
2) run gdb (I see you are using lldb, but lldb is totally useless on Debian, so
I'm using it)
3) enter commands into gdb:
> target remote |vgdb
# to connect to the valgrind-ed program and debug it
> break LinuxCpuObject::update
> cont
# to set breakpoint and continue
> print m_temperature
# to print the address of the SensorProperty, eg
"(KSysGuard::SensorsFeatureSensor *) 0x8a68290"
> monitor check_memory defined 0x8a68290
# to print where the sensor was allocated. use the same memory address as
returned from the previous command
# this uses valgrind's bookkeeping info
# and last
> info vtbl m_temperature
# to check the dynamic type of m_temperature

and post the output from gdb.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to