Bug 202880 - Systemmonitor dataEngine adds non existent sources
Summary: Systemmonitor dataEngine adds non existent sources
Status: RESOLVED NOT A BUG
Alias: None
Product: plasma4
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-06 22:59 UTC by Andreas Fink
Modified: 2009-08-07 00:37 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
crashing plasmoid (2.13 KB, application/octet-stream)
2009-08-06 23:01 UTC, Andreas Fink
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Fink 2009-08-06 22:59:59 UTC
Version:            (using KDE 4.3.0)
Compiler:          gcc-Version 4.3.3 (Gentoo 4.3.3-r2 p1.2, pie-10.1.5) 
OS:                Linux
Installed from:    Gentoo Packages

Here a short extract from a test plasmoid (this test plasmoid does not make much sense, but it's just for showing what happens)

void Test::init()
{
  connect( dataEngine("systemmonitor"), SIGNAL(sourceAdded(QString)), this, SLOT(sourceAdded(QString)) );
}
void Test::sourceAdded( QString sSource )
{
  qDebug() << "Adding source" << sSource;
  if ( sSource == "partitions/home/usedspace" )
    dataEngine("systemmonitor")->connectSource( "partitions/home/usedspace", this, 1000 );
}
void Test::dataUpdated( const QString& sSource, const Plasma::DataEngine::Data data )
{
  qDebug() << "Calling dataUpdated for source" << sSource << "Data:" << data;
  for ( int i=0; i<50; ++i ) {
    usleep( 50000 ); // 50 milliseconds
    qDebug() << i << "Processing events";
    QApplication::processEvents();
    qDebug() << "Processing finished";
  }
}

The generated output of this program looks like this:
Adding source "acpi/battery/0/batterycharge" 
Adding source "acpi/battery/0/batteryusage" 
Adding source "acpi/thermal_zone/THRM/temperature" 
Adding source "system/processors" 
Adding source "system/cores" 
Adding source "cpu/cpu0/clock" 
Adding source "cpu/cpu1/clock" 
Adding source "cpu/system/AverageClock" 
Adding source "partitions/list" 
Adding source "partitions/root/usedspace" 
Adding source "partitions/root/freespace" 
Adding source "partitions/root/filllevel" 
Adding source "partitions/sys/kernel/debug/usedspace" 
Adding source "partitions/sys/kernel/debug/freespace" 
Adding source "partitions/sys/kernel/debug/filllevel" 
Adding source "partitions/home/usedspace" 
Calling dataUpdated for source "partitions/home/usedspace" Data: QHash() 
0 Processing events 
Calling dataUpdated for source "partitions/home/usedspace" Data: QHash() 
0 Processing events 
Processing finished 
1 Processing events 
Processing finished 
2 Processing events 
Processing finished 
3 Processing events 
Processing finished 
4 Processing events 
Processing finished 
5 Processing events 
Processing finished 
6 Processing events 
Processing finished 
7 Processing events 
Processing finished 
8 Processing events 
Processing finished 
9 Processing events 
Processing finished 
10 Processing events 
Processing finished 
11 Processing events 
Processing finished 
12 Processing events 
Processing finished 
13 Processing events 
Processing finished 
14 Processing events 
Processing finished 
15 Processing events 
Processing finished 
16 Processing events 
Calling dataUpdated for source "partitions/home/usedspace" Data: QHash() 
0 Processing events 
Processing finished 
1 Processing events 
Adding source "15095354" 
KCrash: Application 'plasmoidviewer' crashing...

And here we can already see the bug. Shortly before crashing the dataEngine adds a source with the name "15095354" (whereas this number varies always)

And last but not least also the stack backtrace:
Application: Plasma-Miniprogramm-Anzeige (plasmoidviewer), signal: Segmentation fault
[KCrash Handler]
#5  construct (x=0x7fff16b52fd0, copy=0x1274970) at src/corelib/arch/qatomic_x86_64.h:121
#6  0x00007f72dadd0b2a in construct (x=0x7fff16b52fd0, copy=0x1274970) at kernel/qguivariant.cpp:152
#7  0x00007f72db991a9c in QVariant::create (this=0x7fff16b52fd0, type=<value optimized out>, copy=0x7f72dba02c28) at kernel/qvariant.cpp:1343
#8  0x00007f72db991e35 in QVariant (this=0x7fff16b52fd0, val=<value optimized out>) at kernel/qvariant.cpp:1627
#9  0x00007f72c269978c in SystemMonitorEngine::answerReceived (this=0x10d95e0, id=<value optimized out>, answer=<value optimized out>)
    at /usr/src/debug/kde-base/plasma-workspace-4.3.0/plasma-workspace-4.3.0/plasma/dataengines/systemmonitor/systemmonitor.cpp:131
#10 0x00007f72c2488f78 in KSGRD::SensorAgent::processAnswer (this=0x1163d40, buf=<value optimized out>, buflen=<value optimized out>)
    at /usr/src/debug/kde-base/ksysguard-4.3.0/ksysguard-4.3.0/ksysguard/gui/ksgrd/SensorAgent.cc:184
#11 0x00007f72c248f2b1 in KSGRD::SensorShellAgent::msgRcvd (this=0x1163d40) at /usr/src/debug/kde-base/ksysguard-4.3.0/ksysguard-4.3.0/ksysguard/gui/ksgrd/SensorShellAgent.cc:91
#12 0x00007f72c24902ed in KSGRD::SensorShellAgent::qt_metacall (this=0x1163d40, _c=QMetaObject::InvokeMetaMethod, _id=48, _a=0x7fff16b53410)
    at /usr/src/debug/kde-base/ksysguard-4.3.0/ksysguard-4.3.0_build/ksysguard/gui/ksgrd/SensorShellAgent.moc:72
#13 0x00007f72db98a551 in QMetaObject::activate (sender=0x132d190, from_signal_index=<value optimized out>, to_signal_index=13, argv=0x0) at kernel/qobject.cpp:3101
#14 0x00007f72db98a98b in QMetaObject::activate (sender=0x132d190, m=<value optimized out>, local_signal_index=5, argv=0x0) at kernel/qobject.cpp:3178
#15 0x00007f72db92d212 in QProcess::readyReadStandardOutput (this=0x7fff16b52fd0) at .moc/release-shared/moc_qprocess.cpp:156
#16 0x00007f72db93161c in QProcessPrivate::_q_canReadStandardOutput (this=0x1274160) at io/qprocess.cpp:564
#17 0x00007f72db931863 in QProcess::qt_metacall (this=0x132d190, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff16b53690) at .moc/release-shared/moc_qprocess.cpp:101
#18 0x00007f72dbf7ed47 in KProcess::qt_metacall (this=0x7fff16b52fd0, _c=19351920, _id=-610259928, _a=0x0) at /usr/src/debug/kde-base/kdelibs-4.3.0/kdelibs-4.3.0_build/kdecore/kprocess.moc:63
#19 0x00007f72db98a551 in QMetaObject::activate (sender=0x1124660, from_signal_index=<value optimized out>, to_signal_index=4, argv=0x0) at kernel/qobject.cpp:3101
#20 0x00007f72db98a98b in QMetaObject::activate (sender=0x1124660, m=<value optimized out>, local_signal_index=0, argv=0x7fff16b53690) at kernel/qobject.cpp:3178
#21 0x00007f72db9b8a09 in QSocketNotifier::activated (this=0x7fff16b52fd0, _t1=24) at .moc/release-shared/moc_qsocketnotifier.cpp:83
#22 0x00007f72db98f78b in QSocketNotifier::event (this=0x1124660, e=0x7fff16b53bb0) at kernel/qsocketnotifier.cpp:316
#23 0x00007f72dad9e98b in QApplicationPrivate::notify_helper (this=<value optimized out>, receiver=0x1124660, e=0x7fff16b53bb0) at kernel/qapplication.cpp:4056
#24 0x00007f72dada56ef in QApplication::notify (this=0x7fff16b574d0, receiver=0x1124660, e=0x7fff16b53bb0) at kernel/qapplication.cpp:3603
#25 0x00007f72dcb63d14 in KApplication::notify (this=0x7fff16b574d0, receiver=0x1124660, event=0x7fff16b53bb0) at /usr/src/debug/kde-base/kdelibs-4.3.0/kdelibs-4.3.0/kdeui/kernel/kapplication.cpp:302
#26 0x00007f72db979592 in QCoreApplication::notifyInternal (this=0x7fff16b574d0, receiver=0x1124660, event=0x7fff16b53bb0) at kernel/qcoreapplication.cpp:606
#27 0x00007f72db99c02c in socketNotifierSourceDispatch (source=<value optimized out>) at kernel/qcoreapplication.h:213
#28 0x00007f72d49a3869 in IA__g_main_context_dispatch (context=0xdcd130) at gmain.c:1824
#29 0x00007f72d49a6718 in g_main_context_iterate (context=0xdcd130, block=0, dispatch=1, self=<value optimized out>) at gmain.c:2455
#30 0x00007f72d49a6827 in IA__g_main_context_iteration (context=0xdcd130, may_block=0) at gmain.c:2518
#31 0x00007f72db99b98e in QEventDispatcherGlib::processEvents (this=0xdb0930, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:327
#32 0x00007f72dae1999f in QGuiEventDispatcherGlib::processEvents (this=0x7fff16b52fd0, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:202
#33 0x00007f72db97a1b5 in QCoreApplication::processEvents (flags={i = 380977008}) at kernel/qcoreapplication.cpp:803
#34 0x00007f72c28a3161 in Test::dataUpdated (this=<value optimized out>, sSource=<value optimized out>, data=<value optimized out>) at /home/andreas/plasmoid_test/applet-test.cpp:62
#35 0x00007f72c28a372a in Test::qt_metacall (this=0x114cf00, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7fff16b54120) at /home/andreas/plasmoid_test/build/applet-test.moc:72
#36 0x00007f72db98a551 in QMetaObject::activate (sender=0x138d290, from_signal_index=<value optimized out>, to_signal_index=4, argv=0x0) at kernel/qobject.cpp:3101
#37 0x00007f72db98a98b in QMetaObject::activate (sender=0x138d290, m=<value optimized out>, local_signal_index=0, argv=0x7fff16b54120) at kernel/qobject.cpp:3178
#38 0x00007f72dc65aeca in Plasma::SignalRelay::dataUpdated (this=0x7fff16b52fd0, _t1=<value optimized out>, _t2=<value optimized out>)
    at /usr/src/debug/kde-base/kdelibs-4.3.0/kdelibs-4.3.0_build/plasma/datacontainer_p.moc:79
#39 0x00007f72dc65b13c in Plasma::SignalRelay::timerEvent (this=0x138d290, event=<value optimized out>) at /usr/src/debug/kde-base/kdelibs-4.3.0/kdelibs-4.3.0/plasma/private/datacontainer_p.cpp:152
#40 0x00007f72db9870f8 in QObject::event (this=0x138d290, e=0x1274970) at kernel/qobject.cpp:1066
#41 0x00007f72dad9e98b in QApplicationPrivate::notify_helper (this=<value optimized out>, receiver=0x138d290, e=0x7fff16b546e0) at kernel/qapplication.cpp:4056
#42 0x00007f72dada56ef in QApplication::notify (this=0x7fff16b574d0, receiver=0x138d290, e=0x7fff16b546e0) at kernel/qapplication.cpp:3603
#43 0x00007f72dcb63d14 in KApplication::notify (this=0x7fff16b574d0, receiver=0x138d290, event=0x7fff16b546e0) at /usr/src/debug/kde-base/kdelibs-4.3.0/kdelibs-4.3.0/kdeui/kernel/kapplication.cpp:302
#44 0x00007f72db979592 in QCoreApplication::notifyInternal (this=0x7fff16b574d0, receiver=0x138d290, event=0x7fff16b546e0) at kernel/qcoreapplication.cpp:606
#45 0x00007f72db99d6ff in QTimerInfoList::activateTimers (this=0xdce400) at kernel/qcoreapplication.h:213
#46 0x00007f72db99bea0 in timerSourceDispatch (source=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:165
#47 0x00007f72d49a3869 in IA__g_main_context_dispatch (context=0xdcd130) at gmain.c:1824
#48 0x00007f72d49a6718 in g_main_context_iterate (context=0xdcd130, block=0, dispatch=1, self=<value optimized out>) at gmain.c:2455
#49 0x00007f72d49a6827 in IA__g_main_context_iteration (context=0xdcd130, may_block=0) at gmain.c:2518
#50 0x00007f72db99b98e in QEventDispatcherGlib::processEvents (this=0xdb0930, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:327
#51 0x00007f72dae1999f in QGuiEventDispatcherGlib::processEvents (this=0x7fff16b52fd0, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:202
#52 0x00007f72db97a1b5 in QCoreApplication::processEvents (flags={i = 380979952}) at kernel/qcoreapplication.cpp:803
#53 0x00007f72c28a3161 in Test::dataUpdated (this=<value optimized out>, sSource=<value optimized out>, data=<value optimized out>) at /home/andreas/plasmoid_test/applet-test.cpp:62
#54 0x00007f72c28a372a in Test::qt_metacall (this=0x114cf00, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7fff16b54ca0) at /home/andreas/plasmoid_test/build/applet-test.moc:72
#55 0x00007f72db98a551 in QMetaObject::activate (sender=0x138d290, from_signal_index=<value optimized out>, to_signal_index=4, argv=0x0) at kernel/qobject.cpp:3101
#56 0x00007f72db98a98b in QMetaObject::activate (sender=0x138d290, m=<value optimized out>, local_signal_index=0, argv=0x7fff16b54ca0) at kernel/qobject.cpp:3178
#57 0x00007f72dc65aeca in Plasma::SignalRelay::dataUpdated (this=0x7fff16b52fd0, _t1=<value optimized out>, _t2=<value optimized out>)
    at /usr/src/debug/kde-base/kdelibs-4.3.0/kdelibs-4.3.0_build/plasma/datacontainer_p.moc:79
#58 0x00007f72dc65afb8 in Plasma::SignalRelay::checkQueueing (this=0x138d290) at /usr/src/debug/kde-base/kdelibs-4.3.0/kdelibs-4.3.0/plasma/private/datacontainer_p.cpp:115
#59 0x00007f72dc634146 in Plasma::DataContainer::checkForUpdate (this=0xe9c030) at /usr/src/debug/kde-base/kdelibs-4.3.0/kdelibs-4.3.0/plasma/datacontainer.cpp:170
#60 0x00007f72dc63564c in Plasma::DataEngine::timerEvent (this=0x10d95e0, event=<value optimized out>) at /usr/src/debug/kde-base/kdelibs-4.3.0/kdelibs-4.3.0/plasma/dataengine.cpp:381
#61 0x00007f72db9870f8 in QObject::event (this=0x10d95e0, e=0x1274970) at kernel/qobject.cpp:1066
#62 0x00007f72dad9e98b in QApplicationPrivate::notify_helper (this=<value optimized out>, receiver=0x10d95e0, e=0x7fff16b552f0) at kernel/qapplication.cpp:4056
#63 0x00007f72dada56ef in QApplication::notify (this=0x7fff16b574d0, receiver=0x10d95e0, e=0x7fff16b552f0) at kernel/qapplication.cpp:3603
#64 0x00007f72dcb63d14 in KApplication::notify (this=0x7fff16b574d0, receiver=0x10d95e0, event=0x7fff16b552f0) at /usr/src/debug/kde-base/kdelibs-4.3.0/kdelibs-4.3.0/kdeui/kernel/kapplication.cpp:302
#65 0x00007f72db979592 in QCoreApplication::notifyInternal (this=0x7fff16b574d0, receiver=0x10d95e0, event=0x7fff16b552f0) at kernel/qcoreapplication.cpp:606
#66 0x00007f72db99d6ff in QTimerInfoList::activateTimers (this=0xdce400) at kernel/qcoreapplication.h:213
#67 0x00007f72db99bea0 in timerSourceDispatch (source=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:165
#68 0x00007f72d49a3869 in IA__g_main_context_dispatch (context=0xdcd130) at gmain.c:1824
#69 0x00007f72d49a6718 in g_main_context_iterate (context=0xdcd130, block=0, dispatch=1, self=<value optimized out>) at gmain.c:2455
#70 0x00007f72d49a6827 in IA__g_main_context_iteration (context=0xdcd130, may_block=0) at gmain.c:2518
#71 0x00007f72db99b98e in QEventDispatcherGlib::processEvents (this=0xdb0930, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:327
#72 0x00007f72dae1999f in QGuiEventDispatcherGlib::processEvents (this=0x7fff16b52fd0, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:202
#73 0x00007f72db97a1b5 in QCoreApplication::processEvents (flags={i = 380983040}) at kernel/qcoreapplication.cpp:803
#74 0x00007f72c28a3161 in Test::dataUpdated (this=<value optimized out>, sSource=<value optimized out>, data=<value optimized out>) at /home/andreas/plasmoid_test/applet-test.cpp:62
#75 0x00007f72c28a372a in Test::qt_metacall (this=0x114cf00, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7fff16b558b0) at /home/andreas/plasmoid_test/build/applet-test.moc:72
#76 0x00007f72db97ff37 in QMetaMethod::invoke (this=0x7fff16b55d70, object=0x114cf00, connectionType=Qt::DirectConnection, returnValue=
        {<QGenericArgument> = {_data = 0x0, _name = 0x0}, <No data fields>}, val0={_data = 0x7fff16b55f40, _name = 0x7f72dc70f047 "QString"}, val1=
      {_data = 0x7fff16b55f30, _name = 0x7f72dc70f04f "Plasma::DataEngine::Data"}, val2={_data = 0x0, _name = 0x0}, val3={_data = 0x0, _name = 0x0}, val4={_data = 0x0, _name = 0x0}, val5=
      {_data = 0x0, _name = 0x0}, val6={_data = 0x0, _name = 0x0}, val7={_data = 0x0, _name = 0x0}, val8={_data = 0x0, _name = 0x0}, val9={_data = 0x0, _name = 0x0}) at kernel/qmetaobject.cpp:1522
#77 0x00007f72db9807d0 in QMetaObject::invokeMethod (obj=0x114cf00, member=<value optimized out>, type=Qt::AutoConnection, ret={<QGenericArgument> = {_data = 0x0, _name = 0x0}, <No data fields>}, 
    val0={_data = 0x7fff16b55f40, _name = 0x7f72dc70f047 "QString"}, val1={_data = 0x7fff16b55f30, _name = 0x7f72dc70f04f "Plasma::DataEngine::Data"}, val2={_data = 0x0, _name = 0x0}, val3=
      {_data = 0x0, _name = 0x0}, val4={_data = 0x0, _name = 0x0}, val5={_data = 0x0, _name = 0x0}, val6={_data = 0x0, _name = 0x0}, val7={_data = 0x0, _name = 0x0}, val8={_data = 0x0, _name = 0x0}, 
    val9={_data = 0x0, _name = 0x0}) at kernel/qmetaobject.cpp:1114
#78 0x00007f72dc63652d in Plasma::DataEnginePrivate::connectSource (this=<value optimized out>, s=0xe9c030, visualization=0x114cf00, pollingInterval=1000, align=<value optimized out>, 
    immediateCall=<value optimized out>) at /usr/include/qt4/QtCore/qobjectdefs.h:403
#79 0x00007f72dc63672e in Plasma::DataEngine::connectSource (this=0x10d95e0, source=<value optimized out>, visualization=0x114cf00, pollingInterval=1000, intervalAlignment=Plasma::NoAlignment)
    at /usr/src/debug/kde-base/kdelibs-4.3.0/kdelibs-4.3.0/plasma/dataengine.cpp:94
#80 0x00007f72c28a2901 in Test::sourceAdded (this=0x114cf00, sSource=
      {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 5363}, alloc = 0, size = 0, data = 0x60c75a, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 90}, alloc = 0, size = 0, data = 0x7f72dbc4b81a, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x7fff16b56080, static codecForCStrings = 0x0}) at /home/andreas/plasmoid_test/applet-test.cpp:53
#81 0x00007f72c28a36a8 in Test::qt_metacall (this=0x114cf00, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7fff16b561d0) at /home/andreas/plasmoid_test/build/applet-test.moc:71
#82 0x00007f72db98a551 in QMetaObject::activate (sender=0x10d95e0, from_signal_index=<value optimized out>, to_signal_index=4, argv=0x0) at kernel/qobject.cpp:3101
#83 0x00007f72db98a98b in QMetaObject::activate (sender=0x10d95e0, m=<value optimized out>, local_signal_index=0, argv=0x7fff16b561d0) at kernel/qobject.cpp:3178
#84 0x00007f72dc6352d7 in Plasma::DataEngine::sourceAdded (this=0x7fff16b52fd0, _t1=<value optimized out>) at /usr/src/debug/kde-base/kdelibs-4.3.0/kdelibs-4.3.0_build/plasma/dataengine.moc:176
#85 0x00007f72dc63610b in Plasma::DataEngine::setData (this=0x10d95e0, source=@0x7fff16b562e0, key=@0x7fff16b56460, value=@0x7fff16b56450)
    at /usr/src/debug/kde-base/kdelibs-4.3.0/kdelibs-4.3.0/plasma/dataengine.cpp:188
#86 0x00007f72c269974a in SystemMonitorEngine::answerReceived (this=0x10d95e0, id=<value optimized out>, answer=<value optimized out>)
    at /usr/src/debug/kde-base/plasma-workspace-4.3.0/plasma-workspace-4.3.0/plasma/dataengines/systemmonitor/systemmonitor.cpp:130
#87 0x00007f72c2488f78 in KSGRD::SensorAgent::processAnswer (this=0x1163d40, buf=<value optimized out>, buflen=<value optimized out>)
    at /usr/src/debug/kde-base/ksysguard-4.3.0/ksysguard-4.3.0/ksysguard/gui/ksgrd/SensorAgent.cc:184
#88 0x00007f72c248f2b1 in KSGRD::SensorShellAgent::msgRcvd (this=0x1163d40) at /usr/src/debug/kde-base/ksysguard-4.3.0/ksysguard-4.3.0/ksysguard/gui/ksgrd/SensorShellAgent.cc:91
#89 0x00007f72c24902ed in KSGRD::SensorShellAgent::qt_metacall (this=0x1163d40, _c=QMetaObject::InvokeMetaMethod, _id=48, _a=0x7fff16b568b0)
    at /usr/src/debug/kde-base/ksysguard-4.3.0/ksysguard-4.3.0_build/ksysguard/gui/ksgrd/SensorShellAgent.moc:72
#90 0x00007f72db98a551 in QMetaObject::activate (sender=0x132d190, from_signal_index=<value optimized out>, to_signal_index=13, argv=0x0) at kernel/qobject.cpp:3101
#91 0x00007f72db98a98b in QMetaObject::activate (sender=0x132d190, m=<value optimized out>, local_signal_index=5, argv=0x0) at kernel/qobject.cpp:3178
#92 0x00007f72db92d212 in QProcess::readyReadStandardOutput (this=0x7fff16b52fd0) at .moc/release-shared/moc_qprocess.cpp:156
#93 0x00007f72db93161c in QProcessPrivate::_q_canReadStandardOutput (this=0x1274160) at io/qprocess.cpp:564
#94 0x00007f72db931863 in QProcess::qt_metacall (this=0x132d190, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff16b56b30) at .moc/release-shared/moc_qprocess.cpp:101
#95 0x00007f72dbf7ed47 in KProcess::qt_metacall (this=0x7fff16b52fd0, _c=19351920, _id=-610259928, _a=0x0) at /usr/src/debug/kde-base/kdelibs-4.3.0/kdelibs-4.3.0_build/kdecore/kprocess.moc:63
#96 0x00007f72db98a551 in QMetaObject::activate (sender=0x1124660, from_signal_index=<value optimized out>, to_signal_index=4, argv=0x0) at kernel/qobject.cpp:3101
#97 0x00007f72db98a98b in QMetaObject::activate (sender=0x1124660, m=<value optimized out>, local_signal_index=0, argv=0x7fff16b56b30) at kernel/qobject.cpp:3178
#98 0x00007f72db9b8a09 in QSocketNotifier::activated (this=0x7fff16b52fd0, _t1=24) at .moc/release-shared/moc_qsocketnotifier.cpp:83
#99 0x00007f72db98f78b in QSocketNotifier::event (this=0x1124660, e=0x7fff16b57050) at kernel/qsocketnotifier.cpp:316
#100 0x00007f72dad9e98b in QApplicationPrivate::notify_helper (this=<value optimized out>, receiver=0x1124660, e=0x7fff16b57050) at kernel/qapplication.cpp:4056
#101 0x00007f72dada56ef in QApplication::notify (this=0x7fff16b574d0, receiver=0x1124660, e=0x7fff16b57050) at kernel/qapplication.cpp:3603
#102 0x00007f72dcb63d14 in KApplication::notify (this=0x7fff16b574d0, receiver=0x1124660, event=0x7fff16b57050)
    at /usr/src/debug/kde-base/kdelibs-4.3.0/kdelibs-4.3.0/kdeui/kernel/kapplication.cpp:302
#103 0x00007f72db979592 in QCoreApplication::notifyInternal (this=0x7fff16b574d0, receiver=0x1124660, event=0x7fff16b57050) at kernel/qcoreapplication.cpp:606
#104 0x00007f72db99c02c in socketNotifierSourceDispatch (source=<value optimized out>) at kernel/qcoreapplication.h:213
#105 0x00007f72d49a3869 in IA__g_main_context_dispatch (context=0xdcd130) at gmain.c:1824
#106 0x00007f72d49a6718 in g_main_context_iterate (context=0xdcd130, block=1, dispatch=1, self=<value optimized out>) at gmain.c:2455
#107 0x00007f72d49a6827 in IA__g_main_context_iteration (context=0xdcd130, may_block=1) at gmain.c:2518
#108 0x00007f72db99b98e in QEventDispatcherGlib::processEvents (this=0xdb0930, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:327
#109 0x00007f72dae1999f in QGuiEventDispatcherGlib::processEvents (this=0x7fff16b52fd0, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:202
#110 0x00007f72db9780ad in QEventLoop::processEvents (this=<value optimized out>, flags={i = 380990064}) at kernel/qeventloop.cpp:149
#111 0x00007f72db978244 in QEventLoop::exec (this=0x7fff16b572b0, flags={i = 380990144}) at kernel/qeventloop.cpp:197
#112 0x00007f72db97a03a in QCoreApplication::exec () at kernel/qcoreapplication.cpp:888
#113 0x00007f72dad9e824 in QApplication::exec () at kernel/qapplication.cpp:3525
#114 0x000000000040975d in main (argc=4, argv=0x7fff16b57e08) at /usr/src/debug/kde-base/plasma-workspace-4.3.0/plasma-workspace-4.3.0/plasma/shells/plasmoidviewer/main.cpp:164


One last note: This happens only on KDE 4.3 not on KDE 4.2.4.
Comment 1 Andreas Fink 2009-08-06 23:01:41 UTC
Created attachment 35941 [details]
crashing plasmoid
Comment 2 Andreas Fink 2009-08-06 23:02:36 UTC
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.
Comment 3 Aaron J. Seigo 2009-08-07 00:06:54 UTC
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?
Comment 4 Andreas Fink 2009-08-07 00:28:19 UTC
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.
Comment 5 Aaron J. Seigo 2009-08-07 00:37:48 UTC
> 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?