Summary: | crash while editing sensor properies | ||
---|---|---|---|
Product: | [Unmaintained] ksysguard | Reporter: | Volker Lanz <vl> |
Component: | general | Assignee: | KSysGuard Developers <ksysguard-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | echidnaman, johnflux, korvin, lotusom-dev, sputnikshock |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Unspecified | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Bug fix for 179305 + color and order not being updated after setting change |
Description
Volker Lanz
2009-01-01 19:28:05 UTC
We received a report about this crash downstream at https://launchpad.net/bugs/377774 I have the same (or at leas similar) bug, but it is not stable. I've noticed that it is fired more often when deleting the sensors. I assume that the problem may be with the lack of thread sync. If sensor is deleted and at the same time another thread tries to update the graph (or just seek through the array) SVN commit 975473 by johnflux: Stupid hack to fix crash when deleting sensors I can't think of a better way to fix it, because of this stupid communication protocol code. I hope I can switch to dbus for communication and kill of all these types of bugs once and for all BUG:179305 M +8 -6 FancyPlotter.cc WebSVN link: http://websvn.kde.org/?view=rev&revision=975473 The patch below is to fix this bug. As discussed with John there was still some problem after the previous patch. This fix this problem, in addition with the label color not being updated, and the order not being updated. Created attachment 34205 [details]
Bug fix for 179305 + color and order not being updated after setting change
This is a rewrite of FancyPlotter and SignalPlotter to now rely on the beamId instead of index of sensor which got out of sync before and caused crash. Note that the same problem is present in other Plotter, e.g. the bar one. The common code could be pulled up in SensorDisplay and a similar solution written for other plotter that are affected by this bug. This is a svn diff of latest code as of today.
Thanks mlconsultant. Your patch looks good, but unfortunately you've removed all the summationName code! This is used so that sensors can be summed together. If you look at the networking graph, for example, (the last graph on the second graph) the data comes in from lots of different interfaces (lo, eth0, eth1, wifi0, etc) but then all the numbers get added together and displayed on the graph as just one or two lines. I didn't want your change to go to waste though and spent the last few hours trying to putting the summationName stuff back in, but I think now it might be better to just try a clean attempt to writing the patch again. It would be nice to avoid using QHash's as well - we need the graphs to take as little CPUs as possible, so replacing a QList with three or so QHash lookups for every number is a bit painful! Do you want another crack at trying to do this? Thanks John As for the summation part I thought it shouldn't be implemented in the sensor code but through some type of aggregator pattern higher up in the hierarchy. As for the QHash, it is slightly less efficient then a QList but more appropriate for our scenario I believe. In addition, it doesn't take into account that if using a QList you need extra code to adjust the beamId of all sensors and adjust all the QList that referred to it, and it also adds some synchronization problems of keeping everything in sync while processing answers which means locking/partial locking of all QList affected by the beamId while we are adjusting. At the end of the day just the performance aspect alone might not even make a big difference. I can work on an aggregator to restore the summation part, I shouldn't have changed it in the same patch however. Here is where a svn branch would be useful... SVN commit 978091 by johnflux: Fix problems when deleting or reordering sensors Inspiration for the patch came from mlconsultant's patch and discussions. BUG:179305 M +75 -26 FancyPlotter.cc M +4 -1 FancyPlotter.h M +0 -11 SensorDisplay.cc M +0 -1 SensorDisplay.h M +7 -6 SignalPlotter.h WebSVN link: http://websvn.kde.org/?view=rev&revision=978091 *** Bug 199032 has been marked as a duplicate of this bug. *** *** Bug 185061 has been marked as a duplicate of this bug. *** |