Bug #7507

lazy.map{}.zip{} causes SEGV

Added by Yutaka HARA over 1 year ago. Updated over 1 year ago.

[ruby-core:50545]
Status:Closed
Priority:Normal
Assignee:-
Category:core
Target version:2.0.0
ruby -v:ruby 2.0.0dev (2012-12-04 trunk 38172) [x86_64-darwin12.2.1] Backport:

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)


Related issues

Related to ruby-trunk - Bug #7619: 遅延評価された無限長の Range に map を適用して force しようとすると SEGV Closed 12/24/2012
Related to Backport93 - Backport #7658: Rabbit が Ruby 1.9.3p362 で落ちる Closed

Associated revisions

Revision 38213
Added by Nobuyoshi Nakada over 1 year ago

vm.c: save blockprocval

  • vm.c (rbvmmake_proc): save the proc made from the given block so that it will not get collected. [Bug #7507]

History

#1 Updated by Nobuyoshi Nakada over 1 year ago

=begin
Seems a GC issue.

With (({GC.stress=true})), just (({(1..2)})) segfaults.
=end

#2 Updated by Nobuyoshi Nakada over 1 year 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 (rbvmmake_proc): save the proc made from the given block so that it will not get collected. [Bug #7507]

Also available in: Atom PDF