[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Ruby bug reading from /dev/urandom after failed require?

Yukihiro Matsumoto

12/22/2007 3:47:00 PM

Hi,

In message "Re: Ruby bug reading from /dev/urandom after failed require?"
on Sun, 23 Dec 2007 00:20:05 +0900, Mike Boone <boonedocks@gmail.com> writes:
|
|I've been trying to track down a bug that surfaced when trying to
|generate a Rails 2.0.2 app in Cygwin. Reading from /dev/urandom fails
|with "No such file or directory - /dev/urandom" if a failed require
|has been made previously.

Could you describe how it fails for those who don't use Cygwin
platform, like myself?

|The Rails code looks OK, so I thought it might be Cygwin. I came up
|with a simple snippet that fails in Cygwin (see below). Corinna
|Vinschen over at Cygwin ran strace on it and thought it might be a
|Ruby bug...see her thoughts here:
|http://cygwin.com/ml/cygwin/2007-12/msg...
|
|I'm not well versed on the low level strace stuff, but I thought I'd
|try to see this through. I'd appreciate any comments from someone
|knowledgeable about the Ruby source.

The bug must lie between Cygwin and Ruby. We don't call lseek
explicitly. You can clearly see this by doing strace on Linux (or
other platforms), which don't call lseek at all. So, someone (in the
library, I guess) must call lseek weirdly on Cygwin.

I have no clue right now to identify "someone".

matz.

3 Answers

Mike Boone

1/2/2008 8:57:00 PM

0

On Dec 22 2007, 10:47 am, Yukihiro Matsumoto <m...@ruby-lang.org>
wrote:
> The bug must lie between Cygwin and Ruby.  We don't call lseek
> explicitly.  You can clearly see this by doing strace on Linux (or
> other platforms), which don't call lseek at all.  So, someone (in the
> library, I guess) must call lseek weirdly on Cygwin.
>
> I have no clue right now to identify "someone".

Sorry for the late reply. I have done some more experimentation with
the Ruby source in Cygwin.

The current Ruby 1.8.6 does not make in Cygwin, giving an error about
strftime.o. However, the stable-snapshot does make correctly, but my
test script still gives the /dev/urandom error. Interestingly,
compiling Ruby 1.9.0 works fine and the /dev/urandom error goes away.

I have GDB on my Cygwin system, but I am not sure where to begin
tracing the problem. Where would be the best place to set a breakpoint
for tracking the error "No such file or directory - /dev/urandom"?

Thanks,
Mike Boone
http://boonedocks...

Nobuyoshi Nakada

1/3/2008 2:40:00 AM

0

Hi,

At Thu, 3 Jan 2008 06:00:03 +0900,
Mike Boone wrote in [ruby-talk:285706]:
> The current Ruby 1.8.6 does not make in Cygwin, giving an error about
> strftime.o. However, the stable-snapshot does make correctly, but my
> test script still gives the /dev/urandom error. Interestingly,
> compiling Ruby 1.9.0 works fine and the /dev/urandom error goes away.

Sorry that I missed your post. Fixed it just now.

And the make failure is bacause of the change of Cygwin since
1.8.6 has been released.

--
Nobu Nakada

Mike Boone

1/3/2008 4:41:00 AM

0

On Jan 2, 9:39 pm, Nobuyoshi Nakada <n...@ruby-lang.org> wrote:
> Sorry that I missed your post.  Fixed it just now.

Excellent! Thank you.

Mike Boone.