![]() Registered Member ![]()
|
|
![]() Moderator ![]()
|
|
![]() Moderator ![]()
|
|
![]() Registered Member ![]()
|
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:
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. |
![]() Registered Member ![]()
|
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:
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. |
![]() Registered Member ![]()
|
I have also managed to catch Ktorrent freezing before it gets to one of its crashes:
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.
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. |
![]() Registered Member ![]()
|
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:
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). |
![]() Registered Member ![]()
|
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:
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. |
![]() Registered Member ![]()
|
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! |
![]() Registered Member ![]()
|
I am so happy I'm not the only one seeing this problem
![]() 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.
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. |
![]() Registered Member ![]()
|
|
![]() Registered Member ![]()
|
Will do, though after that patch, I'm not getting those crashes anymore. I woke up today with a new one however:
And a bunch of Warnings from Qt:
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)? |
![]() Moderator ![]()
|
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).
The file descriptor is -1, so a simple check for this will probably fix it. |
![]() Registered Member ![]()
|
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" ![]() Unfortunately, I have no idea how to fix the QSocketNotifier stuff. Maybe you'll have to run your own version of it? |
![]() Registered Member ![]()
|
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. |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]