This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Ruby on Rails 2.0.2/Cygwin Bug
- From: "Mike Boone" <boonedocks at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 2 Jan 2008 23:43:51 -0500
- Subject: Re: Ruby on Rails 2.0.2/Cygwin Bug
- References: <d45df6780712191829xaab8c3kc844f16d04d247ad@mail.gmail.com> <d45df6780712211913k512c08d4s8d026ecef70dc1cb@mail.gmail.com> <Pine.GSO.4.63.0712221541210.4432@access1.cims.nyu.edu>
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/