delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/01/02/23:44:35

X-Recipient: archive-cygwin AT delorie DOT 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 AT gmail DOT com>
To: cygwin AT cygwin DOT 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
References: <d45df6780712191829xaab8c3kc844f16d04d247ad AT mail DOT gmail DOT com> <d45df6780712211913k512c08d4s8d026ecef70dc1cb AT mail DOT gmail DOT com> <Pine DOT GSO DOT 4 DOT 63 DOT 0712221541210 DOT 4432 AT access1 DOT cims DOT nyu DOT edu>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Dec 22, 2007 3:46 PM, Igor Peshansky <pechtcha AT cs DOT nyu DOT 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/

- Raw text -


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