Bug #7507
closedlazy.map{}.zip{} causes SEGV
Description
The following program causes SEGV. (Tested on Mac and Ubuntu)
(1..10000).lazy.map{}.zip(){}
/Users/yhara/r/ruby % ./miniruby -e '(1..10000).lazy.map{}.zip(){}'
-e:1: [BUG] Segmentation fault
ruby 2.0.0dev (2012-12-04 trunk 38172) [x86_64-darwin12.2.1]
-- Control frame information -----------------------------------------------
c:0015 p:---- s:0031 e:000030 IFUNC
c:0014 p:---- s:0029 e:000028 IFUNC
c:0013 p:---- s:0027 e:000026 CFUNC :yield
c:0012 p:---- s:0025 e:000024 IFUNC
c:0011 p:---- s:0023 e:000022 CFUNC :each
c:0010 p:---- s:0021 e:000020 IFUNC
c:0009 p:---- s:0019 e:002020 CFUNC :each
c:0008 p:---- s:0017 e:000016 CFUNC :each
c:0007 p:---- s:0015 e:001f70 IFUNC
c:0006 p:---- s:0013 e:001eb0 CFUNC :each
c:0005 p:---- s:0011 e:000010 CFUNC :each
c:0004 p:---- s:0009 e:001e00 CFUNC :zip
c:0003 p:---- s:0007 e:000006 CFUNC :zip
c:0002 p:0012 s:0004 e:001928 EVAL -e:1 [FINISH]
c:0001 p:0000 s:0002 e:001468 TOP [FINISH]
-e:1:in <main>' -e:1:in
zip'
-e:1:in zip' -e:1:in
each'
-e:1:in each' -e:1:in
each'
-e:1:in each' -e:1:in
each'
-e:1:in `yield'
(snip)
Updated by nobu (Nobuyoshi Nakada) about 12 years ago
=begin
Seems a GC issue.
With (({GC.stress=true})), just (({(1..2)})) segfaults.
=end
Updated by nobu (Nobuyoshi Nakada) about 12 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r38213.
Yutaka, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
vm.c: save blockprocval
- vm.c (rb_vm_make_proc): save the proc made from the given block so
that it will not get collected. [ruby-core:50545] [Bug #7507]