X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: Date: Wed, 2 Jan 2008 23:43:51 -0500 From: "Mike Boone" To: cygwin AT cygwin DOT com Subject: Re: Ruby on Rails 2.0.2/Cygwin Bug In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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 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/