Project

General

Profile

Actions

Bug #1584

closed

return from lambda within 2 procs freezes

Added by gleng (Glen Gerstman) almost 15 years ago. Updated almost 13 years ago.

Status:
Closed
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 1 (0 open1 closed)

Has duplicate Backport191 - Bug #2692: Ruby hangs after returning from rescue clause inside the blockClosedko1 (Koichi Sasada)01/30/2010Actions
Actions #1

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

Actions #2

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 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

Actions #3

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
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0