Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

From time to time Deluge goes to 100% CPU with no apparent reason, (no active torrents). If I restart it the CPU goes to around 0%

Has anyone else encountered that?


Edit:

Lol, finally solved the bug (after some investigating). In short it appears it's caused by Deluge using twisted.internet.run() instead of gtk.main() for it's main loop, and then twisted.internet.run() calling gobject.threads_init() internally, which sets a SIGCHLD handler, and ultimately it boils down to a bug in PyGtk that is resoved by this patch:

diff --git a/gtk/gtk.override b/gtk/gtk.override
index 75018f4..94309a6 100644
--- a/gtk/gtk.override
+++ b/gtk/gtk.override
@@ -1151,9 +1151,10 @@ pygtk_main_watch_check(GSource *source)
 #ifdef HAVE_PYSIGNAL_SETWAKEUPFD
     PySignalWatchSource *real_source = (PySignalWatchSource *)source;
     GPollFD *poll_fd = &real_source->fd;
-    int data_size = 0;
+    unsigned char dummy;
+    gssize ret;
     if (poll_fd->revents & G_IO_IN)
-        data_size = read(poll_fd->fd, 0, 1);
+        ret = read(poll_fd->fd, &dummy, 1);
 #endif
     state = pyg_gil_state_ensure();

Now Deluge works fine, and I understand that this patch fixes a similar bug in other programs that use PyGtk as well.

share|improve this question
3  
    
When you have problems with a program like this you need to have some basic information like: What version of Ubuntu are you using? What version of Deluge are you using? Without this most basic info, we're shooting in the dark. –  djeikyb Feb 6 '11 at 0:20
    
@CYREX, thanks for the answer, I read about the bug (it was a duplicate btw), but had forgotten to come here and mark your answer as the correct. –  sashoalm Feb 6 '11 at 8:48
1  
Do not worry. Not helping for the points as primary reason but for the community as the first reason. –  Luis Feb 6 '11 at 15:10
1  
The actual bug is now fixed in Natty: bugs.launchpad.net/ubuntu/+source/pygtk/+bug/664920 –  Cas May 13 '11 at 17:36

2 Answers 2

up vote 2 down vote accepted

I believe this is a bug that the Deluge developers have blamed on a GTK+ control they use for displaying files. In short the workaround is to just not use the file pane and not to use the "open folder" context menu option.

deluge-web has a separate bug that also causes high CPU but this is officially fixed in the latest version available from their website.

share|improve this answer

The Deluge Forum has more detail about this problem, with links to bug reports and the patched debs for Natty and Maverick.

http://forum.deluge-torrent.org/viewtopic.php?p=152813#p152813

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.