Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Nov 2010 09:13:56 GMT
From:      KOIE Hidetaka <hide@koie.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/152524: hald runs busy after devd stopped.
Message-ID:  <201011230913.oAN9DuW5015620@red.freebsd.org>
Resent-Message-ID: <201011230920.oAN9KCqQ069452@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         152524
>Category:       ports
>Synopsis:       hald runs busy after devd stopped.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 23 09:20:11 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     KOIE Hidetaka
>Release:        9.0-CURRENT
>Organization:
surigiken
>Environment:
FreeBSD guriandgura 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Wed Nov 17 15:11:51 JST 2010     root@guriandgura:/usr/obj/museum/freebsd/sys/GURIANDGURA  amd64

>Description:
Usually devd does not stop, but
hald comsumes CPU 100% after /etc/rc.d/devd stop or restart.
>How-To-Repeat:
/etc/rc.d/devd restart

>Fix:
In /usr/ports/sysutils/hal/work/hal-0.5.14/hald/freebsd/hf-devd.c,
becasue hf_devd_event_cb() does not handle G_IO_STATUS_EOF event,
the event loop runs forever.
this patch stops the event storm.
hald should re-connect to devd if devd restarts.

Patch attached with submission follows:

diff -rpu work/hal-0.5.14/hald/freebsd/hf-devd.c work.koie/hal-0.5.14/hald/freebsd/hf-devd.c
--- work/hal-0.5.14/hald/freebsd/hf-devd.c	2009-08-24 21:42:29.000000000 +0900
+++ work.koie/hal-0.5.14/hald/freebsd/hf-devd.c	2010-11-23 17:07:55.507475429 +0900
@@ -412,6 +412,16 @@ hf_devd_event_cb (GIOChannel *source, GI
 	  return FALSE;
 	}
     }
+  else if (status == G_IO_STATUS_EOF)
+    {
+      int fd;
+
+      HAL_WARNING(("%s was disconnected", HF_DEVD_SOCK_PATH));
+      fd = g_io_channel_unix_get_fd(source);
+      g_io_channel_shutdown(source, FALSE, NULL);
+      close(fd);
+      return FALSE;
+    }
 
   return TRUE;
 }


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011230913.oAN9DuW5015620>