Bug 119387 - Ktorrent crashed when enabling the upnp plugin
Summary: Ktorrent crashed when enabling the upnp plugin
Status: RESOLVED FIXED
Alias: None
Product: ktorrent
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: Joris Guisson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-02 12:35 UTC by Thomas Beinicke
Modified: 2007-09-05 19:01 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Here is a backtrace (5.41 KB, text/plain)
2006-01-02 12:37 UTC, Thomas Beinicke
Details
drkonqi output using gdb (5.00 KB, text/plain)
2006-01-02 17:51 UTC, nathan.elshout
Details
backtrace (6.39 KB, text/plain)
2006-02-03 03:37 UTC, Idzi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Beinicke 2006-01-02 12:35:38 UTC
Version:           1.2dev (using KDE 3.5.0, Gentoo)
Compiler:          Target: i686-pc-linux-gnu
OS:                Linux (i686) release 2.6.14-nitro2

As soon as I enable it ktorrent crashes.
I have an upnp router.

A friend of mine is on 64bit and it doesn't crash but I am not sure if the crash actually happens when ktorrent communicates with my router.
Comment 1 Thomas Beinicke 2006-01-02 12:37:04 UTC
Created attachment 14106 [details]
Here is a backtrace
Comment 2 Joris Guisson 2006-01-02 12:43:55 UTC
Never experienced any crashes with the plugin, but I am one 64bit like your friend. I will try it out on my old 32bit computer.


Comment 3 Thomas Beinicke 2006-01-02 13:15:01 UTC
How can I get a bit more debug info or is my backtrace sufficient?
Comment 4 Joris Guisson 2006-01-02 13:20:33 UTC
You can compile in debug mode, but the backtrace should be sufficient.
Comment 5 Thomas Beinicke 2006-01-02 14:08:55 UTC
I thought I compiled it with debug already but only ktorrent after it crashed (from svn) and not the rest of KDE.
Anyways, let me know if you need any additional info.
Comment 6 Joris Guisson 2006-01-02 14:43:41 UTC
OK, then you don't have to do anything anymore.
Comment 7 nathan.elshout 2006-01-02 17:49:10 UTC
I have the same problem, with the same specs, only linux-2.6.14-r5-gentoo.

I have a speedtouch 546 router
Comment 8 nathan.elshout 2006-01-02 17:51:07 UTC
Created attachment 14110 [details]
drkonqi output using gdb

error message in console:
KCrash: Application 'ktorrent' crashing...
kio (KDirWatch): WARNING: KDirWatch::removeDir can't handle
'/etc/samba/smb.conf'
kio (KDirWatch): WARNING: KDirWatch::removeDir can't handle
'/etc/security/fileshare.conf'
Comment 9 Joris Guisson 2006-01-02 18:06:41 UTC
SVN commit 493563 by guisson:

Fixed 119387

BUG: 119387



 M  +9 -1      upnpdescriptionparser.cpp  
 M  +6 -3      upnpmcastsocket.cpp  


--- trunk/extragear/network/ktorrent/plugins/upnp/upnpdescriptionparser.cpp #493562:493563
@@ -19,6 +19,9 @@
  ***************************************************************************/
 #include <qxml.h>
 #include <qvaluestack.h>
+#include <kglobal.h>
+#include <kstandarddirs.h>
+#include <util/fileops.h>
 #include "upnprouter.h"
 #include "upnpdescriptionparser.h"
 
@@ -71,7 +74,12 @@
 		QXmlSimpleReader reader;
 
 		reader.setContentHandler(&chandler);
-		return reader.parse(&input,false);
+		if (!reader.parse(&input,false))
+		{
+			bt::CopyFile(file,KGlobal::dirs()->saveLocation("data","ktorrent") + "upnp_failure",true);
+			return false;
+		}
+		return true;
 	}
 
 	/////////////////////////////////////////////////////////////////////////////////
--- trunk/extragear/network/ktorrent/plugins/upnp/upnpmcastsocket.cpp #493562:493563
@@ -88,9 +88,12 @@
 				// get rid of it
 				delete r;
 			}
-			// add it to the list and emit the signal
-			routers.insert(r->getServer(),r);
-			discovered(r);
+			else
+			{
+				// add it to the list and emit the signal
+				routers.insert(r->getServer(),r);
+				discovered(r);
+			}
 		}
 	}
 	
Comment 10 Joris Guisson 2006-01-02 18:08:37 UTC
Note : if your router doesn't show up in the list, please send me the ~/.kde/share/apps/ktorrent/upnp_failure file (if present) 

Comment 11 Thomas Beinicke 2006-01-02 18:38:04 UTC
I updated ktorrent and now I can add the plugin without ktorrent crashing though it cannot find my router.
However, upon the next start of ktorrent it just freezes though the CPU load stays low.

I also don't have the file you mentioned above so I guess it doesn't get created.
Comment 12 Joris Guisson 2006-01-02 19:15:08 UTC
It shouldn't freeze, update again, I have made some small changes.
Comment 13 Thomas Beinicke 2006-01-02 19:32:13 UTC
Ok, I updated again.
Now it doesn't freeze and starts properly and I can see it's downloading but I can't do anything in the ktorrent window.
All I can do is minimize and maximize it.
But it is downloading and I can see log entries scrolling by from the connections I get.
Comment 14 Joris Guisson 2006-01-02 21:08:42 UTC
Can you post the log file (~/.kde/share/apps/ktorrent/log) ?

This is a weird bug I encountered several times during the development of 1.2rc1, but I managed to solve those.
Comment 15 Thomas Beinicke 2006-01-02 23:01:58 UTC
I couldn't find anything specific in the log but I can reproduce it now and it has nothing to do with the upnp plugin.

If I start ktorrent and then minimize it and right click on the icon to "quit" it then ktorrent remembers that it was minimized in the moment it was closed doesn't it?

Now when I start ktorrent again it starts as tray icon only and when I click on it I can see ktorrent but cannot click anything.
Can you reproduce this?

Oh and the upnp plugin cannot find my router.
Do you need any additional info?
Comment 16 Joris Guisson 2006-01-03 08:00:10 UTC
That should help me pinpoint the problem.

Try searching for the upnp_failure file in the .kde dir, if you can't find it.
Comment 17 Joris Guisson 2006-01-03 18:59:57 UTC
I can't reproduce the non-responsiveness of the GUI, I shutdown minimized and then restart, the tray icon appears, I click on it, and the GUI is responsive. I tried it with and without a download.

What plugins do you have loaded ?
Comment 18 Thomas Beinicke 2006-01-06 19:27:52 UTC
Sorry for my late reply.
I didn't have any plugins loaded (only the default ones after the installation).

I will bughunt again soon but I got a new system and compiled everything for amd64 now.
Comment 19 Joris Guisson 2006-01-08 13:26:42 UTC
Actually the crash is allready fixed, the only thing left to fix, is
the unresponsiveness of the UI.

Joris,

On 8 Jan 2006 10:34:04 -0000, Stephan Binner <binner@kde.org> wrote:
[bugs.kde.org quoted mail]
Comment 20 Joris Guisson 2006-02-02 18:33:50 UTC
Haven't seen this happening and haven't heard any complaints about the unresponsiveness. So FIXED.
Comment 21 Idzi 2006-02-03 03:37:20 UTC
Created attachment 14506 [details]
backtrace

For me , the crash is always active with the 1.2
Comment 22 Idzi 2006-02-03 03:39:45 UTC
my router is also a Speedtouch
Comment 23 Joris Guisson 2006-02-05 12:59:53 UTC
Lets reopen this one.
Comment 24 Joris Guisson 2006-02-05 13:02:31 UTC
As a work around solution, I suggest you guys open the file :
~/.kde/share/apps/ktorrent/plugins

and delete the upnpplugin line, that way the plugin does not get loaded, and the crash does not occur.
Comment 25 Simon Yuan 2006-04-20 04:50:11 UTC
I have a Dynalink RTA770W router. Ktorrent still crashes on SVN 531139.
Here's the link to the thread I posted before I found this bug report:
http://ktorrent.pwsp.net/forum/viewtopic.php?t=411
Comment 26 Joris Guisson 2006-04-25 19:45:21 UTC
What is the status of this bug, is anybody still experiencing this crash ?
Comment 27 Joris Guisson 2006-05-01 13:43:38 UTC
Guess not, so lets close it
Comment 28 Gemes Tibor 2007-09-05 09:33:20 UTC
I have a socks proxy at work, and no proxy at home. If I forgot to disable the socks settings in kde systempreferences then ktorrent freezes at home. If I disable the upnpplugin or disable the kde-wide socks then it works. 
Comment 29 Joris Guisson 2007-09-05 19:01:54 UTC
It doesn't make much sense to use a socks proxy for communication on the local network. I will see if I can prevent that somehow.