こんばんは、 sheepman です。

Fiber のブロックの中で return を呼ぶと segv します。

$ cat f2.rb
Fiber.new do
  return
end.yield

$ ruby-1.9 -v f2.rb
ruby 1.9.0 (2007-06-04 patchlevel 0) [i686-linux]
f2.rb:1: -- stack frame ------------
0000 (0x40202008): 00000000
0001 (0x4020200c): 00000004
0002 (0x40202010): 00000001
0003 (0x40202014): 00000004
0004 (0x40202018): 402a6350
-- control frame ----------
c:0003 p:0019 s:0005 b:0005 l:0x0a14 d:0x0a14 TOP    f2.rb:1
c:0002 p:---- s:0003 b:0003 l:000002 d:000002 FINISH :inherited
c:0001 p:---- s:0001 b:-001 l:000000 d:000000 ------
---------------------------
-- backtrace of native function call (Use addr2line) --
0x80c1b40
0x80d5119
0x80a08cf
0x4002fe8e
0x400ef908
0x8057bb3
0x8057bf7
0x805ac8d
0x805b009
0x8056f28
0x8059d39
0x805a008
0x80c38e5
0x80bf841
0x80c04d2
0x80c0867
0x80c1ca4
0x805954d
0x8059578
0x80595b3
0x8056df8
0x400dcc1f
0x8056d3d
-------------------------------------------------------
[BUG] Segmentation fault
ruby 1.9.0 (2007-06-04) [i686-linux]

zsh: abort      ruby-1.9 -v f2.rb

(gdb) bt
#0  0x400efc11 in kill () from /lib/i686/libc.so.6
#1  0x4002d341 in pthread_kill () from /lib/i686/libpthread.so.0
#2  0x4002d6bb in raise () from /lib/i686/libpthread.so.0
#3  0x400ef8a4 in raise () from /lib/i686/libc.so.6
#4  0x400f1008 in abort () from /lib/i686/libc.so.6
#5  0x080d5112 in rb_bug (fmt=0x8101eb2 "Segmentation fault") at ../ruby/error.c:233
#6  0x080a08cf in sigsegv () at ../ruby/signal.c:533
#7  0x4002fe8e in __pthread_clock_settime () from /lib/i686/libpthread.so.0
#8  0x400ef908 in killpg () from /lib/i686/libc.so.6
#9  0x08057bb3 in search_method (klass=1073949572, id=3221217820, klassp=0x0) at eval_method.h:203
#10 0x08057bf7 in rb_get_method_body (klass=135692633, id=5056, idp=0xbfffe618)
    at eval_method.h:230
#11 0x0805ac8d in rb_call (klass=135692633, recv=1076519640, mid=5056, argc=0, argv=0x0, scope=3)
    at ../ruby/eval.c:1380
#12 0x0805b009 in rb_funcall (recv=1076519640, mid=5056, n=0) at ruby.h:772
#13 0x08056f28 in get_backtrace (info=1076519640) at eval_error.h:54
#14 0x08059d39 in rb_longjmp (tag=6, mesg=1076519640) at ../ruby/eval.c:679
#15 0x0805a008 in rb_exc_fatal (mesg=1076519640) at ../ruby/eval.c:724
#16 0x080c38e5 in rb_thread_execute_interrupts () at ../ruby/thread.c:717
#17 0x080bf841 in th_eval (th=0x8133f78, initial=0) at insns.def:2263
#18 0x080c04d2 in th_eval_body (th=0x8133f78) at ../ruby/vm.c:1631
#19 0x080c0867 in rb_thread_eval (th=0x8133f78, iseqval=1076520500) at ../ruby/vm.c:1837
#20 0x080c1ca4 in yarvcore_eval_iseq (iseq=1076520500) at ../ruby/yarvcore.c:98
#21 0x0805954d in ruby_exec_internal () at ../ruby/eval.c:212
#22 0x08059578 in ruby_exec () at ../ruby/eval.c:227
#23 0x080595b3 in ruby_run () at ../ruby/eval.c:246
#24 0x08056df8 in th_get_ruby_level_cfp (th=0x8168159, cfp=0x6) at ../ruby/main.c:47
#25 0x400dcc1f in __libc_start_main () from /lib/i686/libc.so.6

-- 
sheepman / TAMURA Takashi
sheepman / sheepman.sakura.ne.jp