Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Apr 2001 16:28:48 +0200 (CEST)
From:      clement@asso.ups-tlse.fr
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/26817: [PATCH] isdnd in fullscreen-mode fails to detect read error from tty
Message-ID:  <200104241428.f3OESm601342@polom.mouarf.org>

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

>Number:         26817
>Category:       bin
>Synopsis:       isdnd in fullscreen-mode fails to detect read error from tty
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 24 06:40:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Clement Ballabriga
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
none
>Environment:
System: FreeBSD polom.mouarf.org 4.3-STABLE FreeBSD 4.3-STABLE #0: Sat Apr 21 21:25:21 CEST 2001 root@polom.mouarf.org:/usr/src/sys/compile/POLOM i386

>Description:
	isdnd, when running in full-screen mode, fails to detect read errors fro
m its controlling tty (for exemple when the tty has been revoke()'d). It happens
 in a loop with a select() in it. The tty is in the read fd_set, and, when the 
tty's fd is no longer readable, isdnd fails to detect it and keep this fd in the
 read fd_set, causing select() to return immediately each time, and making isdnd
 use all CPU resources.

Because of the default value of isdn_fsdev in /etc/defaults/rc.conf, isdnd is 
launched by default in full-screen mode, on terminal /dev/ttyv4. getty(8) uses 
this console, so when getty is started, isdnd can no longer read /dev/ttyv4, 
and the problem described above happens.

>How-To-Repeat:
	Configure isdn in kernel and isdnd, put isdn_enable in /etc/rc.conf.
Do not change the default value for isdn_fsdev, and reboot.

>Fix:
	Here is a patch for isdnd. If it can't read from its controlling termina
l, it puts an error in the log file and exits.(the patch is for the file main.c of isdnd, src/usr.sbin/i4b/isdnd/main.c)


--- main.c.old	Sun Apr 22 23:33:37 2001
+++ main.c	Sun Apr 22 23:37:25 2001
@@ -610,6 +610,12 @@
 {
 	int ch = getch();
 		
+	if (ch == ERR)
+	{
+		log(LL_ERR, "kbdrdhdl: ERROR, read error on controlling tty, errno = %d!", errno);
+		error_exit(1, "kbdrdhdl: ERROR, read error on controlling tty, errno = %d!", errno);
+	}
+	
 	switch(ch)
 	{
 		case 0x0c:	/* control L */
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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