[MacRuby] #695: Bitwise operations on Float results in Seg fault
#695: Bitwise operations on Float results in Seg fault -------------------------------+-------------------------------------------- Reporter: niklas@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: -------------------------------+-------------------------------------------- MacRuby allows bitwise operations on Float but crashes with a segmentation fault when called: {{{ irb(main):001:0> (1.2 | 1) unknown: [BUG] Segmentation fault MacRuby version 0.6 (ruby 1.9.0) [universal-darwin10.0, x86_64] zsh: abort macirb niklas@FNH-MacBook:~/ > macirb irb(main):001:0> ~1.2 unknown: [BUG] Segmentation fault MacRuby version 0.6 (ruby 1.9.0) [universal-darwin10.0, x86_64] zsh: abort macirb irb(main):001:0> (1.2 < 1) unknown: [BUG] Segmentation fault MacRuby version 0.6 (ruby 1.9.0) [universal-darwin10.0, x86_64] zsh: abort macirb niklas@FNH-MacBook:~/ > macirb irb(main):001:0> (1.2 ^ 1) unknown: [BUG] Segmentation fault MacRuby version 0.6 (ruby 1.9.0) [universal-darwin10.0, x86_64] zsh: abort macirb }}} Although there is no use in calling a bitwise operator on Float it shouldn't end in a segmentation fault but in a NoMethodError. Tested on MacRuby 0.6 on 10.6.3 -- Ticket URL: <http://www.macruby.org/trac/ticket/695> MacRuby <http://macruby.org/>
#695: Bitwise operations on Float results in Seg fault -------------------------------+-------------------------------------------- Reporter: niklas@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: -------------------------------+-------------------------------------------- Comment(by lsansonetti@…): Looks like these operations should not be callable on floats. However, on my environment I cannot reproduce the crashes: {{{ $ ./miniruby -e "p (1.2 | 1)" 1.20000000000003 $ ./miniruby -e "p ~1.2" -3.59999999999999 $ ./miniruby -e "p (1.2 < 1)" false $ ./miniruby -e "p (1.2 ^ 1)" 1.19999999999997 }}} Do you have a backtrace or crash report to share? -- Ticket URL: <http://www.macruby.org/trac/ticket/695#comment:1> MacRuby <http://macruby.org/>
#695: Bitwise operations on Float results in Seg fault -------------------------------+-------------------------------------------- Reporter: niklas@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: -------------------------------+-------------------------------------------- Comment(by martinlagardette@…): I reproduced on 10.6.3. Here is the backtrace: {{{ Thread 0 Crashed: Dispatch queue: com.apple.main-thread 0 libSystem.B.dylib 0x00007fff849a6886 __kill + 10 1 libSystem.B.dylib 0x00007fff84a46eae abort + 83 2 miniruby 0x000000010003dd7d rb_bug + 205 (error.c:229) 3 miniruby 0x00000001000b1920 sigbus + 0 (signal.c:378) 4 libSystem.B.dylib 0x00007fff849b880a _sigtramp + 26 5 libobjc.A.dylib 0x00007fff82c3310a objc_msgSend + 22 6 miniruby 0x000000010016f846 nsnumber_or + 38 (NSNumber.m:271) 7 miniruby 0x000000010013b29a rb_vm_dispatch + 6826 (dispatcher.cpp:146) 8 ??? 0x0000000100e4c062 0 + 4309958754 9 miniruby 0x000000010014c6fc rb_vm_run + 348 (vm.cpp:4003) 10 miniruby 0x000000010003ffd9 ruby_run_node + 73 (eval.c:202) 11 miniruby 0x00000001000e6c48 main + 152 (main.cpp:40) 12 miniruby 0x0000000100019628 start + 52 }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/695#comment:2> MacRuby <http://macruby.org/>
#695: Bitwise operations on Float results in Seg fault -------------------------------+-------------------------------------------- Reporter: niklas@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.7 Component: MacRuby | Resolution: fixed Keywords: | -------------------------------+-------------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.7 Comment: Should be fixed in r4036. {{{ $ ./miniruby -e "p (1.2 | 1)" /Users/lrz/src/MacRuby-trunk/-e:1:in `<main>': undefined method `|' for 1.2:Float (NoMethodError) $ ./miniruby -e "p ~1.2" /Users/lrz/src/MacRuby-trunk/-e:1:in `<main>': undefined method `~' for 1.2:Float (NoMethodError) $ ./miniruby -e "p (1.2 < 1)" false $ ./miniruby -e "p (1.2 ^ 1)" /Users/lrz/src/MacRuby-trunk/-e:1:in `<main>': undefined method `^' for 1.2:Float (NoMethodError) }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/695#comment:3> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby