[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Ruby 1.9.0 crash on Kubuntu Hardy Heron

Bug Free

12/17/2008 5:05:00 PM

Hi,

Ruby 1.9.0 crashes on the following code:
======================
class Foo
def Foo.get
return true if defined? @@x && @@x <= 0
end
end
Foo.get
======================

This is the version:
clay:~/tests/ruby/bugs$ ruby1.9 -v
ruby 1.9.0 (2007-12-25 revision 14709) [i486-linux]

This is the stack trace:
clay:~/tests/ruby/bugs$ ruby1.9 crash.rb
crash.rb:7: [BUG] Stack consistency error (sp: 10, bp: 9)
ruby 1.9.0 (2007-12-25 revision 14709) [i486-linux]

-- control frame ----------
c:0004 p:0025 s:0010 b:0009 l:000008 d:000008 METHOD crash.rb:7
c:0003 p:0020 s:0006 b:0006 l:000005 d:000005 TOP crash.rb:10
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH :inherited
c:0001 p:0000 s:0002 b:0002 l:000001 d:000001 TOP <dummy toplevel>:17
---------------------------
DBG> : "crash.rb:10:in `<main>'"
-- backtrace of native function call (Use addr2line) --
0xb7f4560c
0xb7e6d3a6
0xb7e6d402
0xb7f3ed80
0xb7f42d09
0xb7f43382
0xb7e7361b
0xb7e736e3
0x8048752
0xb7c81450
0x8048681
-------------------------------------------------------
Aborted
--
Posted via http://www.ruby-....

1 Answer

Brian Candler

12/17/2008 5:09:00 PM

0

Bug Free wrote:
> Hi,
>
> Ruby 1.9.0 crashes on the following code:
> ======================
> class Foo
> def Foo.get
> return true if defined? @@x && @@x <= 0
> end
> end
> Foo.get
> ======================
>
> This is the version:
> clay:~/tests/ruby/bugs$ ruby1.9 -v
> ruby 1.9.0 (2007-12-25 revision 14709) [i486-linux]

Your program works fine for me on 1.9.1-preview2, under Ubuntu Hardy.

$ ruby19 crash.rb
$ ruby19 -v
ruby 1.9.1 (2008-12-01 revision 20438) [i686-linux]
$

So maybe you just need to upgrade.
--
Posted via http://www.ruby-....