X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <d45df6780712211913k512c08d4s8d026ecef70dc1cb@mail.gmail.com>
Date: Fri, 21 Dec 2007 22:13:14 -0500
From: "Mike Boone" <boonedocks@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Ruby on Rails 2.0.2/Cygwin Bug
In-Reply-To: <d45df6780712191829xaab8c3kc844f16d04d247ad@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <d45df6780712191829xaab8c3kc844f16d04d247ad@mail.gmail.com>
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

I came up with a simple Ruby snippet that reproduces the problem. I'd
appreciate it if other Cygwin users would try it. You can change the
"cause_failure = true" line to say false and it will run.

--urandom_test.rb------
# Test failure of reading /dev/urandom after failed require

# this method is from the Rails' source secret_key_generator.rb
def generate_secret_with_urandom
  return File.read("/dev/urandom", 64).unpack("H*")[0]
end

cause_failure = true

begin
  require 'nonexistent_file'
rescue LoadError
  puts '' unless cause_failure
end

puts generate_secret_with_urandom
-----------------------

So far, the strace output of this is too low level for me to follow.
Perhaps it will be clear to a regular Cygwin hacker.

BTW, I'm running "ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-cygwin]".

Mike Boone
http://boonedocks.net/mike/

--
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/

