Bug #7507

closed{}.zip{} causes SEGV

Added by yhara (Yutaka HARA) over 9 years ago. Updated over 9 years ago.

Target version:
ruby -v:
ruby 2.0.0dev (2012-12-04 trunk 38172) [x86_64-darwin12.2.1]


The following program causes SEGV. (Tested on Mac and Ubuntu)


/Users/yhara/r/ruby % ./miniruby -e '(1..10000){}.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'

Related issues 2 (0 open2 closed)

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

Updated by nobu (Nobuyoshi Nakada) over 9 years ago

Seems a GC issue.

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

Actions #2

Updated by nobu (Nobuyoshi Nakada) over 9 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]

Also available in: Atom PDF