[Goodies-dev] [PATCH] xfce4-weather-plugin: fix hang with 100% CPU load after network interruption

Johannes Stezenbach js at sig21.net
Sun Jul 19 16:37:22 CEST 2009


Hi,

I'm using Debian unstable, xfce4-weather-plugin 0.7.0-1.

Sometimes when the network is taken down (unplug cable,
ifdown wireless, poff), xfce4-weather-plugin enters an endless
loop where it chews 100% CPU and doesn't respond to mouse
events anymore.  If I kill it, it disappears from the panel,
and when I re-add it to the panel I have to re-enter the
configuration, which makes this bug doubly annonying,

Not being a gtk+ expert I tried to debug this anyway, and
found a source in the glib mainloop on fd 0,
but according to /proc/<pid>/fd/ fd 0 was closed.  I believe
the patch below fixes the root cause, namely that if
weather_http_receive_data_idle() errors out early then
weather_http_receive_data_destroyed() closes fd 0.
(So the first time round it closes stdin, and the second time
it closes whatever fd was opend in the meantime.)

I tested this patch for a week now and it seems to cure the problem.


Johannes

--- xfce4-weather-plugin-0.7.0/panel-plugin/weather-http.c.orig	2009-06-23 20:51:17.000000000 +0200
+++ xfce4-weather-plugin-0.7.0/panel-plugin/weather-http.c	2009-07-12 20:38:22.000000000 +0200
@@ -463,7 +463,7 @@
   connection->cb_user_data = user_data;
   connection->status = STATUS_NOT_EXECUTED;
   connection->received = NULL;
-  connection->fd = 0;
+  connection->fd = -1;
   connection->counter = 1;
 
   /* start idle function */





More information about the Goodies-dev mailing list