Bug #9939
closed
segfault by modifying array during Array#combination
Added by nobu (Nobuyoshi Nakada) over 10 years ago.
Updated about 10 years ago.
Description
$ ruby -e 'a = [*0..500]' -e 'a.combination(2) {|*,x| a.clear}'
-e:2: [BUG] Segmentation fault at 0x00000000000000
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
Applied in changeset r46418.
array.c: combination on a shared copy
- array.c (rb_ary_combination): iterate on a shared copy, and use
array of indexes instead of array of chosen objects.
[ruby-core:63149] [Bug #9939]
- Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED to 2.0.0: REQUIRED, 2.1: DONE
r46417 and r46418 were backported into ruby_2_1
branch at r46808.
- Backport changed from 2.0.0: REQUIRED, 2.1: DONE to 2.0.0: DONE, 2.1: DONE
backported into ruby_2_0_0
at r47332.
Also available in: Atom
PDF
Like0
Like0Like0Like0