Bug #1584
closedreturn from lambda within 2 procs freezes
Description
=begin
I hope this is where to post this?
This will freeze(full cpu) before the end.
puts 'begin'
->{proc{proc{return}.call}.call}.call
puts 'end'
=end
Updated by runpaint (Run Paint Run Run) almost 15 years ago
=begin
Confirmed on trunk (ruby 1.9.2dev (2009-06-14 trunk 23689) [i686-linux]). strace shows it hanging on:
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
=end
Updated by matz (Yukihiro Matsumoto) almost 15 years ago
=begin
まつもと ゆきひろです
In message "Re: [ruby-core:23736] [Bug #1584] return from lambda within 2 procs freezes"
on Sun, 7 Jun 2009 04:45:48 +0900, Glen Gerstman redmine@ruby-lang.org writes:
|I hope this is where to post this?
|
|This will freeze(full cpu) before the end.
|
|puts 'begin'
|->{proc{proc{return}.call}.call}.call
|puts 'end'
以下のようなパッチで報告された問題は発生しなくなりました。また、make
testやtest/ruby/test_*.rbでは新たなエラーは発生していませんが、中身が
よくわからないので、確証が持てません。
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 5b47385..eb1c5da 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1351,6 +1351,9 @@ vm_throw(rb_thread_t *th, rb_control_frame_t *reg_cfp,
dfp = cfp->dfp;
goto valid_return;
}
-
else {
-
dfp = tdfp;
-
} tdfp = GC_GUARDED_PTR_REF((VALUE *)*dfp); } }
=end
Updated by mame (Yusuke Endoh) about 14 years ago
- Status changed from Open to Closed
=begin
Hi,
This ticket was duplicated by #2692, and that was already fixed
by the almost same patch (r26524). Thanks.
--
Yusuke Endoh mame@tsg.ne.jp
=end