This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Statistics plugin

Tags: None
(comma "," separated)
Athantor
Registered Member
Posts
45
Karma
0

Mon May 21, 2007 10:55 pm
George wrote:It's seems that there is no such icon present in the default KDE theme (Crystal SVG)


I other words: it doesn't obey the freedesktop.org standards ;-)

New icons.

BTW: Unneeded header.


Image Image
George
Moderator
Posts
5421
Karma
1

Tue May 22, 2007 6:15 pm
The patches are committed, lets hope that KDE sticks to the freedesktop standard in the future3
dierbro
Registered Member
Posts
36
Karma
0

Wed May 23, 2007 7:33 pm
ktorrent -v
Qt: 3.3.8
KDE: 3.5.5
KTorrent: 2.2dev

svn 667404

Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread -1233594048 (LWP 23747)]
[New Thread -1260676208 (LWP 21036)]
[New Thread -1235498096 (LWP 21035)]
[KCrash handler]
#6 0xb7edabd7 in mse::StreamSocket::getDownloadRate ()
from /usr/kde/3.5/lib/libktorrent-2.2dev.so
#7 0xb7eff516 in bt::Peer::getDownloadRate ()
from /usr/kde/3.5/lib/libktorrent-2.2dev.so
#8 0xb4419f85 in kt::StatsPlugin::UpdateData ()
from /usr/kde/3.5/lib/kde3/ktstatsplugin.so
#9 0xb441a52b in kt::StatsPlugin::qt_invoke ()
from /usr/kde/3.5/lib/kde3/ktstatsplugin.so
#10 0xb7036399 in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
#11 0xb7036fed in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
#12 0xb7372549 in QTimer::timeout () from /usr/qt/3/lib/libqt-mt.so.3
#13 0xb7059b4f in QTimer::event () from /usr/qt/3/lib/libqt-mt.so.3
#14 0xb6fd6cc7 in QApplication::internalNotify ()
from /usr/qt/3/lib/libqt-mt.so.3
#15 0xb6fd7881 in QApplication::notify () from /usr/qt/3/lib/libqt-mt.so.3
#16 0xb76136ee in KApplication::notify () from /usr/kde/3.5/lib/libkdecore.so.4
#17 0xb6fcbe3c in QEventLoop::activateTimers ()
from /usr/qt/3/lib/libqt-mt.so.3
#18 0xb6f869ec in QEventLoop::processEvents () from /usr/qt/3/lib/libqt-mt.so.3
#19 0xb6fed7f1 in QEventLoop::enterLoop () from /usr/qt/3/lib/libqt-mt.so.3
#20 0xb6fed676 in QEventLoop::exec () from /usr/qt/3/lib/libqt-mt.so.3
#21 0xb6fd674f in QApplication::exec () from /usr/qt/3/lib/libqt-mt.so.3
#22 0x0808b518 in main ()

seems to be equal to previous


unzip;strip;touch;finger;mount;fsck;more;yes;umount;sleep
Athantor
Registered Member
Posts
45
Karma
0

Wed May 23, 2007 11:10 pm
OMG :shock:

I'm guessing that's a threading thing in
Code: Select all
float BufferedSocket::getDownloadRate() const


As far as I understand it isn't my plugin that segfaults — my plugin only calls function, that calls other function, etc., that gets SIGSEGV (in libktorrent-2.2dev.so)… (Right?) :roll:


Image Image
George
Moderator
Posts
5421
Karma
1

Thu May 24, 2007 5:36 pm
It is actually your fault :

Code: Select all
if(StatsPluginSettings::peersSpeed() && ( mPeerSpdUpdCtr >= StatsPluginSettings::peersSpeedDataIval() ) )
      {
         bt::TorrentControl * tc = dynamic_cast<bt::TorrentControl *>( *tor );
         const bt::PeerManager * pm = tc->getPeerMgr();
         if(tc && pm)
         {
            for(bt::PeerManager::CItr it = pm -> beginPeerList(); it != pm -> endPeerList (); ++it)
            {
               if(it && (*it) )
               {   tc -> update();
                  if(!(*it) -> isSeeder())
                  {
                     ld += (*it) -> getDownloadRate();
                     lu += (*it) -> getUploadRate();
                  } else {
                     sd += (*it) -> getDownloadRate();
                  }
               }
            }
         }
      }


The problem is that you call tc->update() for every peer, tc->update() will at the end clean up killed peers.

This means that the list you are iterating over can change, and the iterator can be invalid because the Peer has just been removed from the list.

So to fix this, just don't do a tc->update(), this is done a couple of times per second anyway, so there is no need for you to call that.
George
Moderator
Posts
5421
Karma
1

Thu May 24, 2007 5:42 pm
OK, I have fixed it myself.

Now, time to make the 2.2beta1 package.
Athantor
Registered Member
Posts
45
Karma
0

Thu May 24, 2007 5:50 pm
George wrote:This means that the list you are iterating over can change, and the iterator can be invalid because the Peer has just been removed from the list.


And at the beginning I suspected that…

George wrote:OK, I have fixed it myself.


Thank you.

George wrote:Now, time to make the 2.2beta1 package.


w00t ;-)


Image Image
Athantor
Registered Member
Posts
45
Karma
0

Sat May 26, 2007 4:12 pm
New thing: mode of setting maximum on OY axis scale.

Top — the old behavior.
Exact — sets max according to data on chart.


Image Image
George
Moderator
Posts
5421
Karma
1

Mon May 28, 2007 10:26 am
OK, it is committed


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot]