Project

General

Profile

Bug #1584

return from lambda within 2 procs freezes

Added by gleng (Glen Gerstman) over 10 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
ruby -v:
ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-mswin32]
[ruby-core:23736]

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


Related issues

Has duplicate Backport191 - Bug #2692: Ruby hangs after returning from rescue clause inside the blockClosed01/30/2010Actions

History

#1

Updated by runpaint (Run Paint Run Run) over 10 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

#2

Updated by matz (Yukihiro Matsumoto) over 10 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

#3

Updated by mame (Yusuke Endoh) over 9 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

Also available in: Atom PDF