Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 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: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.11i In-Reply-To: ; 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