From eugen@grosbein.pp.ru  Thu Apr 22 09:38:54 2004
Return-Path: <eugen@grosbein.pp.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 0D26E16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 22 Apr 2004 09:38:54 -0700 (PDT)
Received: from grosbein.pp.ru (grgw.svzserv.kemerovo.su [213.184.64.130])
	by mx1.FreeBSD.org (Postfix) with ESMTP id F24BE43D2F
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 22 Apr 2004 09:38:52 -0700 (PDT)
	(envelope-from eugen@grosbein.pp.ru)
Received: from grosbein.pp.ru (eugen@localhost [127.0.0.1])
	by grosbein.pp.ru (8.12.11/8.12.11) with ESMTP id i3MGcpPU001384
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 Apr 2004 00:38:51 +0800 (KRAST)
	(envelope-from eugen@grosbein.pp.ru)
Received: (from eugen@localhost)
	by grosbein.pp.ru (8.12.11/8.12.11/Submit) id i3MGcpot001383;
	Fri, 23 Apr 2004 00:38:51 +0800 (KRAST)
	(envelope-from eugen)
Message-Id: <200404221638.i3MGcpot001383@grosbein.pp.ru>
Date: Fri, 23 Apr 2004 00:38:51 +0800 (KRAST)
From: Eugene Grosbein <eugen@grosbein.pp.ru>
Reply-To: Eugene Grosbein <eugen@grosbein.pp.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: ee(1) endless loop
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         65892
>Category:       bin
>Synopsis:       ee(1) endless loop
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 22 09:40:14 PDT 2004
>Closed-Date:    Fri Nov 05 10:19:33 GMT 2004
>Last-Modified:  Fri Nov 05 10:19:33 GMT 2004
>Originator:     Eugene Grosbein
>Release:        FreeBSD 4.10-BETA i386
>Organization:
Svyaz Service JSC
>Environment:
System: FreeBSD grosbein.pp.ru 4.10-BETA FreeBSD 4.10-BETA #0: Sun Apr 11 15:43:04 KRAST 2004 eu@grosbein.pp.ru:/usr/local/obj/usr/local/src/sys/DADV i386

>Description:
		There are situations when ee(1) starts to eat all CPU cycles.

>How-To-Repeat:
		Try: ee /tmp/file &
		Or: ee /dev/null

		kill -9 is required in the latter case to stop ee.
>Fix:

		Unknown for me.
>Release-Note:
>Audit-Trail:

From: Eugene Grosbein <eugen@grosbein.pp.ru>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: bin/65892: ee(1) endless loop
Date: Fri, 23 Apr 2004 00:47:18 +0800

 Ops, 'ee /dev/null' will not show the problem, but 'ee </dev/null' will.

From: Alex Vasylenko <lxv@omut.org>
To: freebsd-gnats-submit@FreeBSD.org, eugen@grosbein.pp.ru
Cc:  
Subject: Re: bin/65892: ee(1) endless loop
Date: Wed, 23 Jun 2004 17:34:36 -0400

 This is a multi-part message in MIME format.
 --------------090303020200050609060303
 Content-Type: text/plain; charset=us-ascii; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Eugene Grosbein wrote:
  > There are situations when ee(1) starts to eat all CPU cycles.
  > ee /tmp/file &
 
 - the code sets to ignore (SIG_IGN) first 23 signals including SIGTTIN, 
 SIGTTOU;
 
  > ee </dev/null
 
 - the code doesn't check STDIN_FILENO, STDOUT_FILENO for isatty;
 
 Please see the patch.
 
 -- 
 Alex.
 
 
 --------------090303020200050609060303
 Content-Type: text/plain;
  name="ee.c.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="ee.c.diff"
 
 --- ee.c.orig	Mon Jun 30 07:51:21 2003
 +++ ee.c	Wed Jun 23 17:02:28 2004
 @@ -544,10 +544,11 @@ main(argc, argv)		/* beginning of main p
  int argc;
  char *argv[];
  {
 -	int counter;
 -
 -	for (counter = 1; counter < 24; counter++)
 -		signal(counter, SIG_IGN);
 +	/* Always read from (and write to) a terminal. */
 +	if (!isatty(STDIN_FILENO) || !isatty(STDOUT_FILENO)) {
 +		fprintf(stderr, "ee's standard input and output must be a terminal\n");
 +		exit(1);
 +	}
  
  	signal(SIGCHLD, SIG_DFL);
  	signal(SIGSEGV, SIG_DFL);
 
 --------------090303020200050609060303--

From: Eugene Grosbein <eugen@grosbein.pp.ru>
To: bug-followup@freebsd.org
Cc: lxv@omut.org
Subject: Re: bin/65892: ee(1) endless loop
Date: Sun, 8 Aug 2004 21:46:01 +0800

 Hi!
 
 This patch works well, thank you!
 
 Eugene
State-Changed-From-To: open->closed 
State-Changed-By: fjoe 
State-Changed-When: Fri Nov 5 10:19:04 GMT 2004 
State-Changed-Why:  
Thanks! 
Committed to HEAD, MFC after 2 weeks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=65892 
>Unformatted:
