Summary: | Systemmonitor dataEngine adds non existent sources | ||
---|---|---|---|
Product: | [Unmaintained] plasma4 | Reporter: | Andreas Fink <finkandreas> |
Component: | general | Assignee: | Plasma Bugs List <plasma-bugs-null> |
Status: | RESOLVED NOT A BUG | ||
Severity: | crash | CC: | aseigo |
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | crashing plasmoid |
Description
Andreas Fink
2009-08-06 22:59:59 UTC
Created attachment 35941 [details]
crashing plasmoid
I forgot to mention that if the loop number is low enough, that dataUpdated(...) is finished before the next source is about to be added, then everything works fine. this line: QApplication::processEvents(); is not legal. it will end up re-entering code in the dataengine and possibly elsewhere. never use processEvents(). is there another way to replicate this bug, or is this the only method you've found? This is the only way to reproduce the bug (at least I did not find another way) But I do not get why processEvents() is not legal. I always thought that Qt mainEventLoop does the same as calling processEvents(). So why is it not valid to call it myself... And why is the dataEngine trying to add a source with this odd name. I mean there has to be something broken, that this happens? Actually the reason why I need this processEvents() stuff, is that the systemmonitor dataEngine is not providing directly valid data, but only after the 2nd-3rd dataUpdated call. So I wanted to wait until this happens. But it seems that this is not possible with one thread, so I will change my application to use a thread . Thhis bug can be closed from my side. > I always thought that Qt > mainEventLoop does the same as calling processEvents(). yes, but only when it's "safe" to do so. > So why is it not valid to call it myself because, as in this case, it can cause methods to be re-entered. unless the code is reentrant, this will cause problems. here the dataengine is executing code and emits a signal which moves execution into your code, where process events is called. apparently there is information on the socket that the dataengine is listening to from ksysguardd and so it reads that data, which causes it to update the source and now it's back to executing the _same code_ it was above. obviously this code is not written in a way to handle that. :/ > is that the systemmonitor dataEngine is not providing directly > valid data, but only after the 2nd-3rd dataUpdated call. define "directly valid data"? because if the engine is broken it should be fixed (rather than worked around :) perhaps we can take this up by email? maybe even on plasma-devel@kde.org? |