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

[r624223]: Odd behavior...

Tags: None
(comma "," separated)
imported4-Tomasu
Registered Member
Posts
302
Karma
0

Fri Feb 09, 2007 1:24 pm
Does that mean you aren't seeing it crash, or you can't figure out at all why it might even crash after looking at the code for a while?

If I used the STL much, I'd help, but I don't. I much prefer Qt's STL.
George
Moderator
Posts
5421
Karma
1

Fri Feb 09, 2007 8:30 pm
It's straitforward iterating and then erasing some elements from the set, this shouldn't be crashing.

I will replace the set by something else, (a list probably) and hopefully that will fix your crash.
George
Moderator
Posts
5421
Karma
1

Fri Feb 09, 2007 8:52 pm
OK, the set is now a list, try it out, hopefully it is fixed
imported4-Tomasu
Registered Member
Posts
302
Karma
0

Fri Feb 09, 2007 9:58 pm
Its still crashing, but not exactly the same way:

I've coppied some of the log items with the backtrace, hoping that they are usefull in some way:

Code: Select all
Sending ping request to 80.26.80.170:61541
Queueing RPC call, no slots available at the moment
Switching back to normal server authenticate
Already connected to -XT2000-��PdQ
Authentication(S) to 82.138.91.158 : failure
Authentication to 222.164.200.168 : failure
Authentication to 144.92.123.55 : failure
Authentication to 144.92.123.78 : failure
Authentication to 146.163.218.160 : failure
Authentication to 68.149.42.221 : failure
Authentication to 142.161.218.69 : failure
Initiating connection to 203.206.82.46
Initiating connection to 203.208.122.131
Sending ping request to 72.12.173.240:29524
Queueing RPC call, no slots available at the moment
Initiating connection to 67.71.142.99
Initiating connection to 68.149.42.221
Sending ping request to 69.154.23.28:6881
Queueing RPC call, no slots available at the moment
Initiating connection to 144.92.123.84
Initiating connection to 195.47.0.250
Initiating connection to 207.12.112.53
Initiating connection to 125.238.11.176
Initiating connection to 124.157.224.251
Initiating connection to 80.126.33.202
Initiating connection to 81.6.243.252
Initiating connection to 149.84.52.53
Initiating connection to 150.101.178.215
Initiating connection to 164.77.166.254
Initiating connection to 82.253.244.186
Initiating connection to 72.92.15.8
Initiating connection to 76.184.22.39
Connection closed
Initiating connection to 142.167.11.246
Initiating connection to 156.34.1.129
Initiating connection to 198.53.74.98
Initiating connection to 198.53.74.98
Initiating connection to 204.112.130.110
Timeout occurred
Authentication to 24.17.158.60 : failure
Timeout occurred
Authentication to 125.238.86.82 : failure
Initiating connection to 125.238.86.82
Queueing RPC call, no slots available at the moment
Queueing RPC call, no slots available at the moment
Queueing RPC call, no slots available at the moment
Queueing RPC call, no slots available at the moment

Program received signal SIGSEGV, Segmentation fault.
0x6feec03e in bt::AuthenticationMonitor::update (this=0x80f3a18) at authenticationmonitor.cpp:83
83                              AuthenticateBase* ab = *itr;
(gdb) bt
#0  0x6feec03e in bt::AuthenticationMonitor::update (this=0x80f3a18) at authenticationmonitor.cpp:83
#1  0x08081b93 in KTorrentCore::update (this=0x82f7f40) at ktorrentcore.cpp:564
#2  0x08084249 in KTorrentCore::qt_invoke (this=0x82f7f40, _id=5, _o=0x77863808) at ktorrentcore.moc:243
#3  0x6f0f9b19 in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
#4  0x6f0fa76d in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
#5  0x6f4345e9 in QTimer::timeout () from /usr/qt/3/lib/libqt-mt.so.3
#6  0x6f11d2cf in QTimer::event () from /usr/qt/3/lib/libqt-mt.so.3
#7  0x6f09a947 in QApplication::internalNotify () from /usr/qt/3/lib/libqt-mt.so.3
#8  0x6f09b501 in QApplication::notify () from /usr/qt/3/lib/libqt-mt.so.3
#9  0x6f61a3ba in KApplication::notify () from /usr/kde/3.5/lib/libkdecore.so.4
#10 0x77863ce0 in ?? ()
#11 0x082f7f74 in ?? ()
#12 0x77863ab4 in ?? ()
#13 0x778639e8 in ?? ()
#14 0x6ecd5c6f in malloc () from /lib/libc.so.6
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) print *itr
$1 = (class bt::AuthenticateBase *&) @0xa00901d1: <error reading variable>
(gdb)


This generally happens after downloading fairly fast for a bit, then everything in kt goes "stalled", and kt starts using up 70-90% CPU, and eventually crashes.

I'm not sure if this is the problem or not, since I don't use STL, but I've seen many people have issues with STL and its iterators because you have to handle them specially when deleting an element, otherwise, the iterator is invalidated, and you get a crash.

edit:

I should also say, this mostly happens when theres a fair number of downloading torrents, say 10+, and a number of them want to be downloading rather "Fast" (20-200KB/s or more). It all coincides with a bandwidth spike, cpu usage spike, kt stalling, and then a crash. thats the general pattern.
imported4-Tomasu
Registered Member
Posts
302
Karma
0

Sat Feb 10, 2007 8:45 am
After a few hours of constant crashing (and relaunching by cron), and a few hours of being away from the computer, I came home to find ktorrent frozen:

Code: Select all
bt::AuthenticateBase::getSocket (this=0x9869e88) at authenticatebase.h:68
68                      const mse::StreamSocket* getSocket() const {return sock;}
(gdb) bt
#0  bt::AuthenticateBase::getSocket (this=0x9869e88) at authenticatebase.h:68
#1  0x6feb1100 in bt::AuthenticationMonitor::update (this=0x80f3a18) at authenticationmonitor.cpp:95
#2  0x08081b93 in KTorrentCore::update (this=0x82f6f60) at ktorrentcore.cpp:564
#3  0x08084249 in KTorrentCore::qt_invoke (this=0x82f6f60, _id=5, _o=0x779dc998) at ktorrentcore.moc:243
#4  0x6f0beb19 in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
#5  0x6f0bf76d in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
#6  0x6f3f95e9 in QTimer::timeout () from /usr/qt/3/lib/libqt-mt.so.3
#7  0x6f0e22cf in QTimer::event () from /usr/qt/3/lib/libqt-mt.so.3
#8  0x6f05f947 in QApplication::internalNotify () from /usr/qt/3/lib/libqt-mt.so.3
#9  0x6f060501 in QApplication::notify () from /usr/qt/3/lib/libqt-mt.so.3
#10 0x6f5df3ba in KApplication::notify () from /usr/kde/3.5/lib/libkdecore.so.4
#11 0x779dce70 in ?? ()
#12 0x082f6f94 in ?? ()
#13 0x779dcc44 in ?? ()
#14 0x779dcb78 in ?? ()
#15 0x6ec9ac6f in malloc () from /lib/libc.so.6
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)


I'm not sure how thats possible... but having corrupt frames at all means the entire trace back may be corrupted. so I dunno. Its the only app I get crashes in. and it crashes very very often when its busy downloading several torrents, at varying speeds over 20KB/s.
imported4-Tomasu
Registered Member
Posts
302
Karma
0

Sat Feb 10, 2007 9:16 am
I have also managed to catch Ktorrent freezing before it gets to one of its crashes:

Code: Select all
std::_List_iterator<bt::AuthenticateBase*>::operator++ (this=0x77c3baa0) at /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/bits/stl_list.h:146
146           operator++(int)


Its stuck there, in the while loop iterating the connections.

One simple suggestion, replace all ab->getSocket()s with a variable you prefetched the socket into. Actually, it was a real simple change, and I've done it myself for now to see if I can see any difference, I'll update in a bit.

edit, sooner than I expected, crash again, but it only used up like 20% cpu, which isn't all that bad considering I have a bunch of torrents downloading and quite a few seeding.

Code: Select all
Program received signal SIGSEGV, Segmentation fault.
0x6fe3a03e in bt::AuthenticationMonitor::update (this=0x80f3a18) at authenticationmonitor.cpp:83
83                              AuthenticateBase* ab = *itr;
(gdb) bt
#0  0x6fe3a03e in bt::AuthenticationMonitor::update (this=0x80f3a18) at authenticationmonitor.cpp:83
#1  0x08081b93 in KTorrentCore::update (this=0x82f7f40) at ktorrentcore.cpp:564
#2  0x08084249 in KTorrentCore::qt_invoke (this=0x82f7f40, _id=5, _o=0x77a92238) at ktorrentcore.moc:243
#3  0x6f047b19 in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
#4  0x6f04876d in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
#5  0x6f3825e9 in QTimer::timeout () from /usr/qt/3/lib/libqt-mt.so.3
#6  0x6f06b2cf in QTimer::event () from /usr/qt/3/lib/libqt-mt.so.3
#7  0x6efe8947 in QApplication::internalNotify () from /usr/qt/3/lib/libqt-mt.so.3
#8  0x6efe9501 in QApplication::notify () from /usr/qt/3/lib/libqt-mt.so.3
#9  0x6f5683ba in KApplication::notify () from /usr/kde/3.5/lib/libkdecore.so.4
#10 0x77a92710 in ?? ()
#11 0x082f7f74 in ?? ()
#12 0x77a924e4 in ?? ()
#13 0x77a92418 in ?? ()
#14 0x6ec23c6f in malloc () from /lib/libc.so.6
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)


Something is corrupting your stack which is probably causing the iterator to go bad. or the use of the iterator is corrupting the stack. Not sure as of yet.

I will keep trying to see what if any patterns emerge from the change I made.
imported4-Tomasu
Registered Member
Posts
302
Karma
0

Sat Feb 10, 2007 10:00 am
ahh, the fun of quadruple posting...

I thought I found the source of the crash, as it seems to be a serious problem, as well as fixed up the multiple calls to getSocket.. heres the patch:

Code: Select all
Index: authenticationmonitor.cpp
===================================================================
--- authenticationmonitor.cpp   (revision 632043)
+++ authenticationmonitor.cpp   (working copy)
@@ -90,10 +90,12 @@
                        }
                        else
                        {
-                               if (ab->getSocket() && ab->getSocket()->fd() >= 0)
+                               const mse::StreamSocket* sock = ab->getSocket();
+
+                               if (sock && sock->fd() >= 0)
                                {
-                                       int fd = ab->getSocket()->fd();
-                                       if (!ab->getSocket()->connecting())
+                                       int fd = sock->fd();
+                                       if (!sock->connecting())
                                                FD_SET(fd,&rfds);
                                        else
                                                FD_SET(fd,&wfds);
@@ -112,9 +114,10 @@
                        while (itr != auths.end())
                        {
                                AuthenticateBase* ab = *itr;
-                               if (ab && ab->getSocket() && ab->getSocket()->fd() >= 0)
+                               const mse::StreamSocket* sock = ab->getSocket();
+                               if (ab && sock && sock->fd() >= 0)
                                {
-                                       int fd = ab->getSocket()->fd();
+                                       int fd = sock->fd();
                                        if (FD_ISSET(fd,&rfds))
                                        {
                                                ab->onReadyRead();
@@ -127,7 +130,9 @@

                                if (!ab || ab->isFinished())
                                {
-                                       ab->deleteLater();
+                                       if(ab)
+                                               ab->deleteLater();
+
                                        itr = auths.erase(itr);
                                }
                                else


Its crashed again even after the change, but I'm not sure its updated libktorrent or the program properly, so I'll clean and rebuild, and post back here once thats done and tested.

edit, Well, a full rebuild later, its still crashing in the same spot, but I'm running it in valgrind (memcheck) now to see if it pops up, I do see some suspicious things in valgrind, but I'm not sure my problem will pop up in valgrind since its running too slow, what I see happen happens when theres seemingly a ton of items in the auth manager list, and kt is downloading relatively fast (300-800KB/s+), and when running in valgrind, all I get out of it is 50KB/s ish. so we'll see, it might just take a long time.

edit2, I see I made a mistake in that patch, I'm fixing it now (the ab->getSocket call outside of any if(ab); programming while tired == bad).
imported4-Tomasu
Registered Member
Posts
302
Karma
0

Sat Feb 10, 2007 11:14 am
I really hope this is the last consecutive post I make (I just dont want to remove any of the history... no idea why ;))

new patch:
Code: Select all
Index: authenticationmonitor.cpp
===================================================================
--- authenticationmonitor.cpp   (revision 632043)
+++ authenticationmonitor.cpp   (working copy)
@@ -90,10 +90,12 @@
                        }
                        else
                        {
-                               if (ab->getSocket() && ab->getSocket()->fd() >= 0)
+                               const mse::StreamSocket* sock = ab->getSocket();
+
+                               if (sock && sock->fd() >= 0)
                                {
-                                       int fd = ab->getSocket()->fd();
-                                       if (!ab->getSocket()->connecting())
+                                       int fd = sock->fd();
+                                       if (!sock->connecting())
                                                FD_SET(fd,&rfds);
                                        else
                                                FD_SET(fd,&wfds);
@@ -112,22 +114,31 @@
                        while (itr != auths.end())
                        {
                                AuthenticateBase* ab = *itr;
-                               if (ab && ab->getSocket() && ab->getSocket()->fd() >= 0)
+                               if (ab)
                                {
-                                       int fd = ab->getSocket()->fd();
-                                       if (FD_ISSET(fd,&rfds))
+                                       const mse::StreamSocket* sock = ab->getSocket();
+                                       if (sock)
                                        {
-                                               ab->onReadyRead();
+                                               int fd = sock->fd();
+                                               if (fd >= 0)
+                                               {
+                                                       if (FD_ISSET(fd,&rfds))
+                                                       {
+                                                               ab->onReadyRead();
+                                                       }
+                                                       else if (FD_ISSET(fd,&wfds))
+                                                       {
+                                                               ab->onReadyWrite();
+                                                       }
+                                               }
                                        }
-                                       else if (FD_ISSET(fd,&wfds))
-                                       {
-                                               ab->onReadyWrite();
-                                       }
                                }
-
+
                                if (!ab || ab->isFinished())
                                {
-                                       ab->deleteLater();
+                                       if(ab)
+                                               ab->deleteLater();
+
                                        itr = auths.erase(itr);
                                }
                                else


I just don't get it. If anyone can see what might be causing the crash after this, let me know, I need some sleep. I'll come back to it later. Thanks for reading though all that nonsense... Crash is still around, so I must look elsewhere, not sure where to start, but I'll see what I can find tomorrow.
J
Registered Member
Posts
86
Karma
0

Sun Feb 11, 2007 6:47 am
I think this is the same problem i've been having. As Tomasu obviously seems to be of more help than me in getting it fixed, consider my forum thread to be closed. :)


Thank you KTorrent developers! :)
_________________
"Thou shalt not steal." - STOP PIRACY NOW!
imported4-Tomasu
Registered Member
Posts
302
Karma
0

Sun Feb 11, 2007 6:53 am
I am so happy I'm not the only one seeing this problem :D It makes you feel like its somehow your fault...

edit:

I have a potential fix for the crashing, it seems the fd_set struct can hold as few as 32 sockets, in linux it seems to be around 128.

So I've hacked in some static arrays that are used as the mem for the fd_set pointers, which means I've had to change a bit of code to make them use pointers instead of the struct. Also, I've cleaned up the code in the AuthenticationManager::update method a little, it makes fewer calls to various other object methods which will have a small effect on performance, not much I expect though.

Code: Select all
Index: libktorrent/net/socketmonitor.cpp
===================================================================
--- libktorrent/net/socketmonitor.cpp   (revision 632043)
+++ libktorrent/net/socketmonitor.cpp   (working copy)
@@ -177,14 +177,20 @@
        void SocketMonitor::update()
        {
        //      Out() << "SocketMonitor::update()" << endl;
-               fd_set fds,wfds;
-               FD_ZERO(&fds);
-               FD_ZERO(&wfds);
+
+               // this is a dirty hack, the fd_set type can hold as little as 32 sockets normally, so we will extend that to 256*32 = 8192
+               //  If this is still not enough, QBitArray should be used instead, but that will incur some overhead
+               unsigned int rfds[256], rwfds[256];
+               memset(rfds, 0, sizeof(rfds));
+               memset(rwfds, 0, sizeof(rwfds));
+
+               fd_set *fds = (fd_set *)rfds, *wfds = (fd_set *)rwfds;

                TimeStamp ts = bt::Now();
                int max = 0;
                mutex.lock();
                QPtrList<BufferedSocket>::iterator itr = smap.begin();
+               Out(SYS_CON|LOG_DEBUG) << "SocketMonitor plist size: " <<  smap.count() << endl;
                while (itr != smap.end())
                {
                        BufferedSocket* s = *itr;
@@ -192,9 +198,9 @@
                        {
                                // if we have bytes to write, see if we can write them
                                if (s->bytesReadyToWrite())
-                                       FD_SET(s->fd(),&wfds);
+                                       FD_SET(s->fd(),wfds);

-                               FD_SET(s->fd(),&fds);
+                               FD_SET(s->fd(),fds);

                                if (s->fd() > max)
                                        max = s->fd();
@@ -207,7 +213,7 @@

                struct timeval tv = {0,100*1000};
                TimeStamp before = bt::Now(); // get the current time
-               if (select(max+1,&fds,&wfds,NULL,&tv) > 0)
+               if (select(max+1,fds,wfds,NULL,&tv) > 0)
                {
                        TimeStamp now = bt::Now(); // get the current time
                        Uint32 num_to_read = 0;
@@ -220,7 +226,7 @@
                        {
                                BufferedSocket* s = *itr;

-                               if (s->ok() && FD_ISSET(s->fd(),&fds))
+                               if (s->ok() && FD_ISSET(s->fd(),fds))
                                {
                                        // fd is set
                                        if (dcap == 0)
@@ -234,7 +240,7 @@
                                        }
                                }

-                               if (s->ok() && FD_ISSET(s->fd(),&wfds))
+                               if (s->ok() && FD_ISSET(s->fd(),wfds))
                                {
                                        if (ucap == 0)
                                        {
Index: libktorrent/torrent/authenticationmonitor.cpp
===================================================================
--- libktorrent/torrent/authenticationmonitor.cpp       (revision 632043)
+++ libktorrent/torrent/authenticationmonitor.cpp       (working copy)
@@ -27,8 +27,9 @@
 #include "authenticatebase.h"

 #include <util/profiler.h>
+#include <iostream>

-
+using namespace std;
 namespace bt
 {
        AuthenticationMonitor AuthenticationMonitor::self;
@@ -72,66 +73,91 @@

                KT_PROF_START("auth");

-               fd_set rfds,wfds;
+               // this is a dirty hack, the fd_set type can hold as little as 32 sockets normally, so we will extend that to 256*32 = 8192
+               //  If this is still not enough, QBitArray should be used instead, but that will incur some overhead
+
+               unsigned int rrfds[256], rwfds[256];
+               memset(rrfds, 0, sizeof(rrfds));
+               memset(rwfds, 0, sizeof(rwfds));
+
+               fd_set *rfds = (fd_set *)rrfds, *wfds = (fd_set *)rwfds;
                int max_fd = 0;
-               FD_ZERO(&rfds);
-               FD_ZERO(&wfds);

                std::list<AuthenticateBase*>::iterator itr = auths.begin();
+
                while (itr != auths.end())
                {
                        AuthenticateBase* ab = *itr;
                        if (!ab || ab->isFinished())
                        {
-                               if (ab)
+                               if (ab) {
                                        ab->deleteLater();
+                                       *itr = 0;
+                               }

                                itr = auths.erase(itr);
                        }
                        else
                        {
-                               if (ab->getSocket() && ab->getSocket()->fd() >= 0)
+                               const mse::StreamSocket* sock = ab->getSocket();
+
+                               if (sock)
                                {
-                                       int fd = ab->getSocket()->fd();
-                                       if (!ab->getSocket()->connecting())
-                                               FD_SET(fd,&rfds);
-                                       else
-                                               FD_SET(fd,&wfds);
-
-                                       if (fd > max_fd)
-                                               max_fd = fd;
+                                       int fd = sock->fd();
+                                       if (fd >= 0)
+                                       {
+                                               if (!sock->connecting())
+                                                       FD_SET(fd,rfds);
+                                               else
+                                                       FD_SET(fd,wfds);
+
+                                               if (fd > max_fd)
+                                                       max_fd = fd;
+                                       }
                                }
                                itr++;
                        }
                }

                struct timeval tv = {0,1000};
-               if (select(max_fd+1,&rfds,&wfds,NULL,&tv) > 0)
+               if (select(max_fd+1,rfds,wfds,NULL,&tv) > 0)
                {
                        itr = auths.begin();
                        while (itr != auths.end())
                        {
                                AuthenticateBase* ab = *itr;
-                               if (ab && ab->getSocket() && ab->getSocket()->fd() >= 0)
+                               if (ab)
                                {
-                                       int fd = ab->getSocket()->fd();
-                                       if (FD_ISSET(fd,&rfds))
+                                       const mse::StreamSocket* sock = ab->getSocket();
+                                       if (sock)
                                        {
-                                               ab->onReadyRead();
+                                               int fd = sock->fd();
+                                               if (fd >= 0)
+                                               {
+                                                       if (FD_ISSET(fd,rfds))
+                                                       {
+                                                               ab->onReadyRead();
+                                                       }
+                                                       else if (FD_ISSET(fd,wfds))
+                                                       {
+                                                               ab->onReadyWrite();
+                                                       }
+                                               }
                                        }
-                                       else if (FD_ISSET(fd,&wfds))
-                                       {
-                                               ab->onReadyWrite();
-                                       }
                                }
-
+
                                if (!ab || ab->isFinished())
                                {
-                                       ab->deleteLater();
+                                       if(ab) {
+                                               ab->deleteLater();
+                                               *itr = 0;
+                                       }
+
                                        itr = auths.erase(itr);
                                }
-                               else
+                               else {
                                        itr++;
+                               }
                        }
                }
                KT_PROF_END();


As far as I can tell, the crash is fixed with this patch. (ktorrent has been running for about 30 min or so, and a crash would have normally come every 5 min or less, so for now, its stable)

I just saw this: Qt: Warning: QSocketNotifier: Socket descriptor too large for select() come from ktorrent, I assume its serious, so I'll go track that down now.
J
Registered Member
Posts
86
Karma
0

Mon Feb 12, 2007 6:32 am
Try building with SSP (stack smashing protection). Every time ktorrent crashes, i get:

*** stack smashing detected ***: ktorrent terminated


Thank you KTorrent developers! :)
_________________
"Thou shalt not steal." - STOP PIRACY NOW!
imported4-Tomasu
Registered Member
Posts
302
Karma
0

Mon Feb 12, 2007 9:09 am
Will do, though after that patch, I'm not getting those crashes anymore. I woke up today with a new one however:

Code: Select all
Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 20836]
0x6fd6d02f in net::SocketMonitor::update (this=0x6fe80160) at socketmonitor.cpp:203
203                                     FD_SET(s->fd(),fds);
(gdb) print s
$1 = (class net::BufferedSocket *) 0x9707088
(gdb) print s->fd()
$2 = -1
(gdb) bt
#0  0x6fd6d02f in net::SocketMonitor::update (this=0x6fe80160) at socketmonitor.cpp:203
#1  0x6fd6e989 in net::MonitorThread::run (this=0x8165518) at socketmonitor.cpp:57
#2  0x6ef9e8b3 in QThreadInstance::start () from /usr/qt/3/lib/libqt-mt.so.3
#3  0x6e787294 in ?? () from /lib/libpthread.so.0
#4  0x08c8a424 in ?? ()
#5  0x6dca04a0 in ?? ()
#6  0x6dca04a0 in ?? ()
#7  0x6dca04a0 in ?? ()
#8  0x6dca04a0 in ?? ()
#9  0x00000000 in ?? ()


And a bunch of Warnings from Qt:

Code: Select all
Qt: Warning: QObject::disconnect: Unexpected null parameter
Qt: Warning: QObject::disconnect: Unexpected null parameter
Qt: Warning: QSocketNotifier: Socket descriptor too large for select()
Qt: Warning: QSocketNotifier: Internal error
Qt: Warning: QSocketNotifier: Socket descriptor too large for select()
Qt: Warning: QSocketNotifier: Internal error
Qt: Warning: QSocketNotifier: Socket descriptor too large for select()
Qt: Warning: QSocketNotifier: Internal error
Qt: Warning: QSocketNotifier: Socket descriptor too large for select()
Qt: Warning: QSocketNotifier: Internal error
Qt: Warning: QFile::writeBlock: File not open
Qt: Warning: QFile::writeBlock: File not open
Qt: Warning: QFile::putch: File not open
Qt: Warning: QGArray::at: Absolute index 301 out of range
Qt: Warning: QGArray::at: Absolute index 301 out of range


All of which are serious, but Qt isn't giving me any info about them, anyone know how to get qt to give me more info (file, line, etc)?
George
Moderator
Posts
5421
Karma
1

Mon Feb 12, 2007 11:33 am
This is interesting, grepping through /usr/include , it appears that FD_SETSIZE is by default 1024 on linux.

I guess we will have to move to the poll system call, because there does not appear to be a limit with poll (you have to pass the number of file descriptors).

Tomasu wrote:Will do, though after that patch, I'm not getting those crashes anymore. I woke up today with a new one however:

Code: Select all
Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 20836]
0x6fd6d02f in net::SocketMonitor::update (this=0x6fe80160) at socketmonitor.cpp:203
203                                     FD_SET(s->fd(),fds);
(gdb) print s
$1 = (class net::BufferedSocket *) 0x9707088
(gdb) print s->fd()
$2 = -1
(gdb) bt
#0  0x6fd6d02f in net::SocketMonitor::update (this=0x6fe80160) at socketmonitor.cpp:203
#1  0x6fd6e989 in net::MonitorThread::run (this=0x8165518) at socketmonitor.cpp:57
#2  0x6ef9e8b3 in QThreadInstance::start () from /usr/qt/3/lib/libqt-mt.so.3
#3  0x6e787294 in ?? () from /lib/libpthread.so.0
#4  0x08c8a424 in ?? ()
#5  0x6dca04a0 in ?? ()
#6  0x6dca04a0 in ?? ()
#7  0x6dca04a0 in ?? ()
#8  0x6dca04a0 in ?? ()
#9  0x00000000 in ?? ()



The file descriptor is -1, so a simple check for this will probably fix it.
imported4-Tomasu
Registered Member
Posts
302
Karma
0

Mon Feb 12, 2007 12:02 pm
The file descriptor is -1, so a simple check for this will probably fix it.
Though I don't think thats a proper fix, whats the Socket doing in the manager at all if its totally invalid?

I just hope that going to poll doesn't harm performance at all. I'd assume it will, since you have to sit and spin in a loop checking poll all the time.

also, using my dirty hack, things are "ok" ;) it seems mallocing a larger buffer for fd_set is somewhat common.

Unfortunately, I have no idea how to fix the QSocketNotifier stuff. Maybe you'll have to run your own version of it?
imported4-Tomasu
Registered Member
Posts
302
Karma
0

Mon Feb 12, 2007 12:22 pm
I have profiling enabled, so I thought I'd see what I could find, and it appears the program is spending 38% of its time in QLNode::getData(), which is insane.

Also, I noticed some of the code uses a QValueList<SomeType *> when it should probably be using a QPtrList<SomeType> or QPtrVector<SomeType> instead.


Bookmarks



Who is online

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