From: Yukihiro Matsumoto Date: 2006-05-06T23:42:56+09:00 Subject: Re: [BUG] segfault on Proc#call after setting a trace_func Hi, In message "Re: [BUG] segfault on Proc#call after setting a trace_func" on Sat, 6 May 2006 20:59:06 +0900, ts writes: |M> l.call | | Not sure, but it seems to be in proc_invoke() | | /* modify current frame */ | ruby_frame->block = &_block; | Unfortunately the old block (ruby_frame->block) is never restored when | ruby leave proc_invoke() That's it. Thank you. Here's the patch to fix this. matz. --- eval.c 23 Feb 2006 04:24:39 -0000 1.890 +++ eval.c 6 May 2006 14:41:49 -0000 @@ -8266,3 +8243,3 @@ proc_invoke(VALUE proc, VALUE args /* OK struct BLOCK _block; - struct BLOCK *data; + struct BLOCK *data, *old_block; volatile VALUE result = Qundef; @@ -8304,2 +8277,3 @@ proc_invoke(VALUE proc, VALUE args /* OK /* modify current frame */ + old_block = ruby_frame->block; ruby_frame->block = &_block; @@ -8316,2 +8290,3 @@ proc_invoke(VALUE proc, VALUE args /* OK POP_TAG(); + ruby_frame->block = old_block; ruby_wrapper = old_wrapper;