# Return in Fiber dumps core

**URL:** <https://www.ruby-forum.com/t/return-in-fiber-dumps-core/105914>\
**Category:** Development\
**Created:** [June 4, 2007, 5:01pm UTC](https://www.ruby-forum.com/t/return-in-fiber-dumps-core/105914 "2007-06-04T17:01:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sheepman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Post date:** [June 4, 2007, 5:01pm UTC](https://www.ruby-forum.com/t/return-in-fiber-dumps-core/105914/1 "2007-06-04T17:01:54Z")

</div>

e$B$3$s$P$s$O!"e(B sheepman e$B$G$9!#e(B

Fiber e$B$N%V%m%C%/$NCf$Ge(B return e$B$r8F$V$He(B segv e$B$7$^$9!#e(B

$ 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

---

<div class="post-metadata">

**Author:** ![sheepman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Post date:** [June 5, 2007, 10:21am UTC](https://www.ruby-forum.com/t/return-in-fiber-dumps-core/105914/2 "2007-06-05T10:21:38Z")

</div>

e$B$J$+$@$G$9!#e(B

At Tue, 5 Jun 2007 00:00:38 +0900,  
sheepman wrote in [ruby-dev:30888]:

> Fiber e$B$N%V%m%C%/$NCf$Ge(B return e$B$r8F$V$He(B segv e$B$7$^$9!#e(B

[ruby-dev:30889]e$B$b860x$OF1$8$@$H;W$$$^$9!#e(B

# Index: cont.c

— cont.c (revision 12440)  
+++ cont.c (working copy)  
@@ -437,5 +437,5 @@ rb\_fiber\_start(void)

```
 if (state) {

```

- th-\>thrown\_errinfo = th-\>errinfo;

- th-\>thrown\_errinfo = th\_make\_jump\_tag\_but\_local\_jump(state,  
th-\>errinfo);  
th-\>interrupt\_flag = 1;  
}  
Index: eval\_intern.h  
===================================================================  
— eval\_intern.h (revision 12440)  
+++ eval\_intern.h (working copy)  
@@ -123,5 +123,5 @@ char \*strrchr \_((const char \*, const cha  
}   
else { \

- 

```
 rb_fiber_start(th); \

```

- 

```
 rb_fiber_start(); \

```

} while (0)

@@ -194,4 +194,6 @@ VALUE rb\_f\_eval(int argc, VALUE \*argv, V  
VALUE rb\_make\_exception \_((int argc, VALUE \*argv));

+NORETURN(void rb\_fiber\_start(void));  
+  
NORETURN(void rb\_raise\_jump \_((VALUE)));  
NORETURN(void print\_undef \_((VALUE, ID)));  
@@ -204,4 +206,5 @@ NODE \*th\_get\_cref(rb\_thread\_t \*th, rb\_is  
NODE \*th\_cref\_push(rb\_thread\_t \*th, VALUE, int);  
NODE \*th\_set\_special\_cref(rb\_thread\_t \*th, VALUE \*lfp, NODE \*  
cref\_stack);  
+VALUE th\_make\_jump\_tag\_but\_local\_jump(int state, VALUE val);

static rb\_control\_frame\_t \*

---

<div class="post-metadata">

**Author:** ![sheepman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Post date:** [June 5, 2007, 7:49pm UTC](https://www.ruby-forum.com/t/return-in-fiber-dumps-core/105914/3 "2007-06-05T19:49:25Z")

</div>

e$B!!$5$5$@$G$9!#e(B

Nobuyoshi N. e$B$5$s$O=q$-$^$7$?e(B:

> > Fiber e$B$N%V%m%C%/$NCf$Ge(B return e$B$r8F$V$He(B segv e$B$7$^$9!#e(B
> 
> [ruby-dev:30889]e$B$b860x$OF1$8$@$H;W$$$^$9!#e(B

e$B!!$$$d!"0c$C$?$h$&$G$9!#$J$s$G$+$o$+$i$J$$$1$I!"e(Bth-\>tag  
e$B$,%k!\<e(B  
e$B%W$7$F$$$^$7$?!#e(Btag-\>prev == tag  
e$B$K$J$C$F$$$^$7$?!#$J$s$G$@$m$&!#e(B

e$B!!JQ99$O!"%F%9%H$H$H$b$K\<h$j9~$\_$^$7$?!#e(B
