Projects
Home     Blog     Install     New Ticket     View Tickets     Browse Source

Ticket #7 (closed defect: fixed)

Opened 11 months ago

Last modified 10 months ago

crash when doing [NSDecimalNumber -decimalValue]

Reported by: jordan.breeding@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby 0.1
Component: MacRuby Keywords:
Cc:

Description

Not actually that useful (intValue and floatValue are much more useful), but still I didn't expect MacRuby to go down so hard:

irb(main):001:0> framework('Cocoa') => true irb(main):002:0> testVar = NSDecimalNumber.numberWithInt(5) => #<NSDecimalNumber:0x12968e0> irb(main):003:0> p NSDecimalNumber NSDecimalNumber => NSDecimalNumber irb(main):004:0> p testVar #<NSDecimalNumber:0x12968e0> => #<NSDecimalNumber:0x12968e0> irb(main):005:0> print(testVar) #<NSDecimalNumber:0x12968e0>=> nil irb(main):006:0> testVar.floatValue => 5.0 irb(main):007:0> testVar.intvalue NoMethodError: undefined method `intvalue' for #<NSDecimalNumber:0x12968e0>

from (irb):7 from /usr/local/lib/ruby/1.9.0/irb.rb:149:in `block (2 levels) in eval_input' from /usr/local/lib/ruby/1.9.0/irb.rb:262:in `signal_status' from /usr/local/lib/ruby/1.9.0/irb.rb:146:in `block in eval_input' from /usr/local/lib/ruby/1.9.0/irb.rb:145:in `eval_input' from /usr/local/lib/ruby/1.9.0/irb.rb:69:in `block in start' from /usr/local/lib/ruby/1.9.0/irb.rb:68:in `catch' from /usr/local/lib/ruby/1.9.0/irb.rb:68:in `start' from /usr/local/bin/irb:12:in `<main>'

irb(main):008:0> testVar.intValue => 5 irb(main):009:0> testVar.doubleValue => 5.0 irb(main):010:0> testVar.decimalValue (irb):10: [BUG] Unrecognized octype `{?=b8b4b1b1b18[8S]}' MacRuby version 0.1 (ruby 1.9.0 2008-02-18 revision 0) [i686-darwin9.2.0]

-- control frame ---------- c:0024 p:---- s:0073 b:0073 l:000072 d:000072 CFUNC :decimalValue c:0023 p:0009 s:0070 b:0070 l:000ad4 d:000069 EVAL (irb):10 c:0022 p:---- s:0069 b:0069 l:000068 d:000068 FINISH :empty? c:0021 p:---- s:0067 b:0067 l:000066 d:000066 CFUNC :eval c:0020 p:0023 s:0060 b:0060 l:000059 d:000059 METHOD /usr/local/lib/ruby/1.9.0/irb/workspace.rb:80 c:0019 p:0025 s:0053 b:0052 l:000051 d:000051 METHOD /usr/local/lib/ruby/1.9.0/irb/context.rb:218 c:0018 p:0024 s:0047 b:0047 l:002254 d:000046 BLOCK /usr/local/lib/ruby/1.9.0/irb.rb:149 c:0017 p:0025 s:0040 b:0040 l:000039 d:000039 METHOD /usr/local/lib/ruby/1.9.0/irb.rb:262 c:0016 p:0009 s:0035 b:0035 l:002254 d:000034 BLOCK /usr/local/lib/ruby/1.9.0/irb.rb:146 c:0015 p:0093 s:0032 b:0032 l:000021 d:000031 BLOCK /usr/local/lib/ruby/1.9.0/irb/ruby-lex.rb:243 c:0014 p:---- s:0032 b:0032 l:000031 d:000031 FINISH :block_given? c:0013 p:---- s:0030 b:0030 l:000029 d:000029 CFUNC :loop c:0012 p:0007 s:0027 b:0027 l:000021 d:000026 BLOCK /usr/local/lib/ruby/1.9.0/irb/ruby-lex.rb:230 c:0011 p:---- s:0028 b:0028 l:000027 d:000027 FINISH :each c:0010 p:---- s:0026 b:0026 l:000025 d:000025 CFUNC :catch c:0009 p:0017 s:0022 b:0022 l:000021 d:000021 METHOD /usr/local/lib/ruby/1.9.0/irb/ruby-lex.rb:229 c:0008 p:0034 s:0019 b:0019 l:002254 d:002254 METHOD /usr/local/lib/ruby/1.9.0/irb.rb:145 c:0007 p:0009 s:0016 b:0016 l:00217c d:000015 BLOCK /usr/local/lib/ruby/1.9.0/irb.rb:69 c:0006 p:---- s:0017 b:0017 l:000016 d:000016 FINISH :(null) c:0005 p:---- s:0015 b:0015 l:000014 d:000014 CFUNC :catch c:0004 p:0152 s:0011 b:0011 l:00217c d:00217c METHOD /usr/local/lib/ruby/1.9.0/irb.rb:68 c:0003 p:0033 s:0006 b:0006 l:000005 d:000005 TOP /usr/local/bin/irb:12 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


DBG> : "(irb):10:in `irb_binding'" DBG> : "/usr/local/lib/ruby/1.9.0/irb/workspace.rb:80:in `eval'" DBG> : "/usr/local/lib/ruby/1.9.0/irb/workspace.rb:80:in `evaluate'" DBG> : "/usr/local/lib/ruby/1.9.0/irb/context.rb:218:in `evaluate'" DBG> : "/usr/local/lib/ruby/1.9.0/irb.rb:149:in `block (2 levels) in eval_input'" DBG> : "/usr/local/lib/ruby/1.9.0/irb.rb:262:in `signal_status'" DBG> : "/usr/local/lib/ruby/1.9.0/irb.rb:146:in `block in eval_input'" DBG> : "/usr/local/lib/ruby/1.9.0/irb/ruby-lex.rb:243:in `block (2 levels) in each_top_level_statement'" DBG> : "/usr/local/lib/ruby/1.9.0/irb/ruby-lex.rb:230:in `loop'" DBG> : "/usr/local/lib/ruby/1.9.0/irb/ruby-lex.rb:230:in `block in each_top_level_statement'" DBG> : "/usr/local/lib/ruby/1.9.0/irb/ruby-lex.rb:229:in `catch'" DBG> : "/usr/local/lib/ruby/1.9.0/irb/ruby-lex.rb:229:in `each_top_level_statement'" DBG> : "/usr/local/lib/ruby/1.9.0/irb.rb:145:in `eval_input'" DBG> : "/usr/local/lib/ruby/1.9.0/irb.rb:69:in `block in start'" DBG> : "/usr/local/lib/ruby/1.9.0/irb.rb:68:in `catch'" DBG> : "/usr/local/lib/ruby/1.9.0/irb.rb:68:in `start'" DBG> : "/usr/local/bin/irb:12:in `<main>'" -- backtrace of native function call (Use addr2line) -- 0x297c66 0x1cda1c 0x1cda5b 0x29e488 0x2a0f69 0x95c7b424 0x296030 0x295f5f 0x28f8a8 0x29524c 0x1d5807 0x1d5ba6 0x288325 0x296030 0x28f8a8 0x29524c 0x29580d 0x1d176a 0x1d1829 0x1d1987 0x296030 0x28f8a8 0x29524c 0x29580d 0x1d36d0 0x288325 0x296030 0x28f8a8 0x29524c 0x29580d 0x1d36d0 0x288325 0x296030 0x28f8a8 0x29524c 0x295521 0x1d1434 0x1d6a0f 0x1fdf 0x1f46


zsh: abort /usr/local/bin/irb

Change History

Changed 11 months ago by lsansonetti@…

  • milestone set to MacRuby 1.0

It's because MacRuby doesn't read the bridge support class/method annotations.

Changed 11 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed

Fixed in r25/trunk.

$ ./miniruby -e "framework 'foundation'; p NSNumber.numberWithFloat(3.14).decimalValue" #<NSDecimal>

Changed 10 months ago by lsansonetti@…

  • milestone changed from MacRuby 1.0 to MacRuby 0.1
Note: See TracTickets for help on using tickets.