ruby deep recursion dumps core

Dominic Mitchell dom at happygiraffe.net
Wed Nov 9 02:05:38 PST 2005


I was wondering if anybody else had seen this behaviour:

    % irb
    irb(main):001:0> def foo ; foo ; end
    => nil
    irb(main):002:0> foo
    zsh: illegal hardware instruction (core dumped)  irb

This is on 6.0-STABLE, using ruby-1.8.2_5.  I tried it on a Linux box
and it raised a SystemStackError instead, which seems to be correct
behaviour.

The gdb backtrace isn't particularly helpful:

    #0  0x2809cf8e in rb_eval () from /usr/local/lib/libruby18.so.18
    #1  0x280a0dfb in rb_call0 () from /usr/local/lib/libruby18.so.18
    #2  0x280a1d7e in rb_call () from /usr/local/lib/libruby18.so.18
    #3  0x2809d4b6 in rb_eval () from /usr/local/lib/libruby18.so.18
    #4  0x280a0dfb in rb_call0 () from /usr/local/lib/libruby18.so.18
    ...
    #4951 0x280a0dfb in rb_call0 () from /usr/local/lib/libruby18.so.18
    #4952 0x280a1d7e in rb_call () from /usr/local/lib/libruby18.so.18
    #4953 0x2809d350 in rb_eval () from /usr/local/lib/libruby18.so.18
    #4954 0x280aa10b in ruby_exec_internal () from /usr/local/lib/libruby18.so.18
    #4955 0x280aa152 in ruby_exec () from /usr/local/lib/libruby18.so.18
    #4956 0x280ab22f in ruby_run () from /usr/local/lib/libruby18.so.18
    #4957 0x08048634 in main ()

Has anybody else seen this?

-Dom


More information about the freebsd-ports mailing list