X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <d45df6780801022043i4054a10dpdf88b3c69663ca4e@mail.gmail.com>
Date: Wed, 2 Jan 2008 23:43:51 -0500
From: "Mike Boone" <boonedocks@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Ruby on Rails 2.0.2/Cygwin Bug
In-Reply-To: <Pine.GSO.4.63.0712221541210.4432@access1.cims.nyu.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <d45df6780712191829xaab8c3kc844f16d04d247ad@mail.gmail.com> 	 <d45df6780712211913k512c08d4s8d026ecef70dc1cb@mail.gmail.com> 	 <Pine.GSO.4.63.0712221541210.4432@access1.cims.nyu.edu>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Dec 22, 2007 3:46 PM, Igor Peshansky <pechtcha@cs.nyu.edu> wrote:
> As I mentioned before, I don't use Ruby too often.  But I just realized
> something: to reproduce the error, you needed a "require
> 'nonexistent_file'", which will obviously set errno to ENOENT (which is
> exactly the error you're seeing).  It's possible that File.read checks
> errno and exits right away if it's non-zero, and that nothing resets errno
> before File.read.  Inserting the puts call will likely reset errno, thus
> avoiding the bug.  So, the bug is probably in Ruby code for exception
> handling ("rescue") -- it should reset errno so that subsequent code isn't
> affected (and it's also suspicious that the File.read code checks errno
> without a valid reason, e.g., a non-zero return value).

Looks like you got it right. They just fixed the Ruby source:
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/io.c?r1=13774&r2=14858

I made the change to my io.c in the stable-snapshot and it compiles OK
and runs my test script without the not-found error.

Not sure how long this will take to find its way into Cygwin's ruby
package, but I'm glad it was finally solved.

Mike Boone.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

