RUBY/dl bug ?

S

Shashank Date

I was trying out the RUBY/DL samples which can be downloaded from:
http://ttsky.net/ruby/ruby-dl-sample/win32/
and while trying out the stream.rb example, I got the following error on
Win XP (Home) using ruby one-click install:
--------------------------------------------------------------
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>cd downloads\_ruby

C:\downloads\_ruby>ruby stream.rb stream.rb
c:/ruby/lib/ruby/1.8/dl/types.rb:73:in `pack': bignum out of range of
unsigned long (RangeError)
from c:/ruby/lib/ruby/1.8/dl/types.rb:73
from c:/ruby/lib/ruby/1.8/dl/types.rb:73:in `call'
from c:/ruby/lib/ruby/1.8/dl/import.rb:210:in `encode_types'
from c:/ruby/lib/ruby/1.8/dl/import.rb:210:in `call'
from c:/ruby/lib/ruby/1.8/dl/import.rb:206:in `encode_types'
from c:/ruby/lib/ruby/1.8/dl/import.rb:206:in `call'
from c:/ruby/lib/ruby/1.8/dl/import.rb:206:in `encode_types'
from c:/ruby/lib/ruby/1.8/dl/import.rb:206:in `call'
from c:/ruby/lib/ruby/1.8/dl/import.rb:206:in `encode_types'
from c:/ruby/lib/ruby/1.8/dl/import.rb:206:in `call'
from c:/ruby/lib/ruby/1.8/dl/import.rb:206:in `encode_types'
from c:/ruby/lib/ruby/1.8/dl/import.rb:206:in `call'
from (eval):8:in `createFile'
from stream.rb:31:in `streams'
from stream.rb:79
from stream.rb:77:in `each'
from stream.rb:77

C:\downloads\_ruby>ruby -v
ruby 1.8.1 (2003-12-25) [i386-mswin32]

C:\downloads\_ruby>
-------------------------------------------------------------------------
 
D

daz

Shashank said:
I was trying out the RUBY/DL samples which can be downloaded from:
http://ttsky.net/ruby/ruby-dl-sample/win32/
and while trying out the stream.rb example, I got the following error on
Win XP (Home) using ruby one-click install:
--------------------------------------------------------------
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>cd downloads\_ruby

C:\downloads\_ruby>ruby stream.rb stream.rb
c:/ruby/lib/ruby/1.8/dl/types.rb:73:in `pack': bignum out of range of
unsigned long (RangeError)
from c:/ruby/lib/ruby/1.8/dl/types.rb:73


Hi Shanko,

I think it's a Ruby bug that was fixed.

Fri Jan 23 02:26:30 2004 Yukihiro Matsumoto

* pack.c (num2i32): pack should not raise RangeError.
[ruby-dev:22654]


As a work-around, try changing line 73 in dl/types.rb
from:
proc{|v| [v].pack("l").unpack("L")[0]}],
to:
proc{|v| [v & 0xffffffff].pack("l").unpack("L")[0]}],


daz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top