delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2001/08/22/22:39:13

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-developers-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com
Date: Wed, 22 Aug 2001 22:39:02 -0400
From: Christopher Faylor <cgf AT redhat DOT com>
To: cygwin-developers AT cygwin DOT com
Subject: Re: Bash chokes up on the tty mode when it terminates.
Message-ID: <20010822223902.B13482@redhat.com>
Reply-To: cygwin-developers AT cygwin DOT com
Mail-Followup-To: cygwin-developers AT cygwin DOT com
References: <s1sd75nhprq DOT fsf AT jaist DOT ac DOT jp>
Mime-Version: 1.0
User-Agent: Mutt/1.3.11i
In-Reply-To: <s1sd75nhprq.fsf@jaist.ac.jp>; from fujieda@jaist.ac.jp on Thu, Aug 23, 2001 at 04:13:13AM +0900

On Thu, Aug 23, 2001 at 04:13:13AM +0900, Kazuhiro Fujieda wrote:
>I found bash choked up on the tty mode when it terminated.
>I tested it on NT4 Sp6a with recent nightly snapshots and the
>latest CVS source. The concrete procedure is:
>1. Insert `set CYGWIN=tty' into the cygwin.bat.
>2. Start Cygwin Bash Shell
>3. Exit immediately from it.
>
>The strace log attached below shows it choked up just after
>it invoked kill_pgrp.

I believe that I've fixed this.  It was caused by Corinna's recent
changes to report a reasonable value when asking how many fds cygwin
can open.

The problem is that bash calls dup2 with the value it gets from
getdtablesize as the second argument.  Then dup2 aborted because the fd
was not within range -- which it shouldn't have done.  I added code
(from a net contributor, I believe) to cause dup2 to extend the fd table
as needed last year but I neglected to eliminate a prior bounds checking
test just before it.

Anyway, I checked in a trivial fix.

cgf

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019