Floating point exception (core dumped) ./ruby -ve 'r = 0**-1; p r + r'

e$B0J2<$N$h$&$K$9$k$H!"e(Bfloating point exception e$B$K$J$j$^$9!#e(B

% ./ruby -ve ‘r = 0**-1; p r + r’
ruby 1.9.0 (2008-04-26 revision 16213) [i686-linux]
zsh: floating point exception (core dumped) ./ruby -ve 'r = 0**-1; p r

  • r’
    % gdb ruby core.18246
    GNU gdb 6.4.90-debian
    Copyright © 2006 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you
    are
    welcome to change it and/or distribute copies of it under certain
    conditions.
    Type “show copying” to see the conditions.
    There is absolutely no warranty for GDB. Type “show warranty” for
    details.
    This GDB was configured as “i486-linux-gnu”…Using host libthread_db
    library “/lib/tls/i686/cmov/libthread_db.so.1”.

warning: Can’t read pathname for load map:
e$BF~NOe(B/e$B=PNO%(%i!<$G$9e(B.
Reading symbols from /lib/tls/i686/cmov/libpthread.so.0…done.
Loaded symbols for /lib/tls/i686/cmov/libpthread.so.0
Reading symbols from /lib/tls/i686/cmov/librt.so.1…done.
Loaded symbols for /lib/tls/i686/cmov/librt.so.1
Reading symbols from /lib/tls/i686/cmov/libdl.so.2…done.
Loaded symbols for /lib/tls/i686/cmov/libdl.so.2
Reading symbols from /lib/tls/i686/cmov/libcrypt.so.1…done.
Loaded symbols for /lib/tls/i686/cmov/libcrypt.so.1
Reading symbols from /lib/tls/i686/cmov/libm.so.6…done.
Loaded symbols for /lib/tls/i686/cmov/libm.so.6
Reading symbols from /lib/tls/i686/cmov/libc.so.6…done.
Loaded symbols for /lib/tls/i686/cmov/libc.so.6
Reading symbols from /lib/ld-linux.so.2…Reading symbols from
/usr/lib/debug/lib/ld-2.3.6.so…done.
done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from
/home/akr/ruby/yarvo0/lib/ruby/1.9.0/i686-linux/enc/encdb.so…done.
Loaded symbols for
/home/akr/ruby/yarvo0/lib/ruby/1.9.0/i686-linux/enc/encdb.so
Reading symbols from
/home/akr/ruby/yarvo0/lib/ruby/1.9.0/i686-linux/enc/trans/transdb.so…done.
Loaded symbols for
/home/akr/ruby/yarvo0/lib/ruby/1.9.0/i686-linux/enc/trans/transdb.so
Reading symbols from
/home/akr/ruby/yarvo0/lib/ruby/1.9.0/i686-linux/enc/euc_jp.so…done.
Loaded symbols for
/home/akr/ruby/yarvo0/lib/ruby/1.9.0/i686-linux/enc/euc_jp.so
Core was generated by `./ruby -ve r = 0**-1; p r + r’.
Program terminated with signal 8, Arithmetic exception.
#0 0x080acb6c in f_addsub (self=135969500, anum=3, aden=1, bnum=3,
bden=1, k=43) at rational.c:632
632 VALUE a = f_imul(an, bd / ig);
(gdb) bt
#0 0x080acb6c in f_addsub (self=135969500, anum=3, aden=1, bnum=3,
bden=1, k=43) at rational.c:632
#1 0x080ac9d9 in nurat_add (self=135969500, other=135969500) at
rational.c:686
#2 0x0810af7b in call_cfunc (func=0x80ac8f0 <nurat_add>,
recv=135969500, len=1, argc=1, argv=0xb7abc02c)
at vm_insnhelper.c:288
#3 0x08112a82 in vm_call_cfunc (th=0x81a99c8, reg_cfp=0xb7b3bf60,
num=1, id=43, recv=135969500, klass=136024360, flag=0,
mn=0x81b8f20, blockptr=0x0) at vm_insnhelper.c:372
#4 0x081125cc in vm_call_method (th=0x81a99c8, cfp=0xb7b3bf60, num=1,
blockptr=0x0, flag=0, id=43, mn=0x81b8f0c,
recv=135969500, klass=136024360) at vm_insnhelper.c:504
#5 0x0810f869 in vm_eval (th=0x81a99c8, initial=0) at insns.def:1408
#6 0x08112c5b in vm_eval_body (th=0x81a99c8) at vm.c:1147
#7 0x081132b3 in rb_iseq_eval (iseqval=135969720) at vm.c:1356
#8 0x0805b94f in ruby_exec_node (n=0x81abbb8, file=0x0) at eval.c:227
#9 0x0805b9f2 in ruby_run_node (n=0x81abbb8) at eval.c:255
#10 0x08058a88 in main (argc=3, argv=0xbfa8e464, envp=0xbfa8e474) at
main.c:35
(gdb) p ig
$1 = 0
(gdb) p bd
$2 = 0
(gdb) p an
$3 = 1
(gdb)

e$B0J2<$N$h$&$K$9$k$H!"e(Bfloating point exception e$B$K$J$j$^$9!#e(B

e$BD>$;$?$H;W$$$^$9e(B
(e$B$,!":#2?8N$+%S%k%I$G<:GT$7$F$7$^$$$^$9e(B)e$B!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs