[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

irb crash (1.8.2, WinXP

Its Me

12/8/2004 6:10:00 PM

The last instance_variable_set in the following makes irb 0.9 on Ruby 1.8.2
(2004-11-06) crash on WinXP.

>irb --version
irb 0.9(02/07/03)

>irb
irb(main):004:0> class A
irb(main):005:1> @@N = 0
irb(main):006:1> def initialize
irb(main):007:2> @n = (@@N += 1)
irb(main):008:2> end
irb(main):009:1> end
=> nil
irb(main):010:0> A.new
=> #<A:0x2ae1af8 @n=1>
irb(main):011:0> A.new
=> #<A:0x2ae0190 @n=2>
irb(main):012:0> class A
irb(main):013:1> def bar
irb(main):014:2> yield
irb(main):015:2> end
irb(main):016:1> def foo (a)
irb(main):017:2> a.bar { @n }
irb(main):018:2> end
irb(main):019:1> end
=> nil
irb(main):020:0> a1 = A.new
=> #<A:0x2acfc78 @n=3>
irb(main):021:0> A2 = A.new
=> #<A:0x2acda10 @n=4>
irb(main):023:0> A2.foo a1
=> 4
irb(main):024:0> a1.foo A2
=> 3
irb(main):025:0> class A
irb(main):026:1> def baz a
irb(main):027:2> a.bar { @nnn }
irb(main):028:2> end
irb(main):029:1> end
=> nil
irb(main):030:0> a1.baz A2
=> nil
irb(main):031:0> A2.baz a1
=> nil
irb(main):032:0> A2.instance_variable_set("@nnn", 9)
C:/ruby/lib/ruby/1.8/irb/input-method.rb:97: [BUG] Segmentation fault
ruby 1.8.2 (2004-11-06) [i386-mswin32]


This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.


3 Answers

gabriele renzi

12/8/2004 10:49:00 PM

0

itsme213 ha scritto:
> The last instance_variable_set in the following makes irb 0.9 on Ruby 1.8.2
> (2004-11-06) crash on WinXP.

I tried (I think I have the same setup, given that your winxp is pro
with service pack2, ruby and irb are the same), but I could not
reproduce it

linus sellberg

12/10/2004 11:19:00 PM

0

itsme213 wrote:
> The last instance_variable_set in the following makes irb 0.9 on Ruby 1.8.2
> (2004-11-06) crash on WinXP.
>>irb --version
> irb 0.9(02/07/03)
>>irb
> C:/ruby/lib/ruby/1.8/irb/input-method.rb:97: [BUG] Segmentation fault

I can attest that something is fishy in irb under windows (XP, SP2 if
that matters).

D:\>irb --version
irb 0.9(02/07/03)
D:\>irb
irb(main):001:0> c:/ruby/lib/ruby/1.8/irb/input-method.rb:97: [BUG]
Segmentation
fault
ruby 1.8.2 (2004-11-06) [i386-mswin32]

What I did? I pressed tab twice. My belief is that there is some bug in
readline, though I am not entiredly certain. Another thing to note is
that the error doesn't appear on all installations of ruby on windows.



gabriele renzi

12/10/2004 11:28:00 PM

0

linus sellberg ha scritto:


> What I did? I pressed tab twice. My belief is that there is some bug in
> readline, though I am not entiredly certain. Another thing to note is
> that the error doesn't appear on all installations of ruby on windows.

there is already a bug report for it, I guess curt hibbs would love to
see a patch :)
http://rubyforge.org/tracker/index.php?func=detail&aid=876&group_id=167&am...