ruby-changes:47430
From: usa <ko1@a...>
Date: Wed, 9 Aug 2017 19:32:42 +0900 (JST)
Subject: [ruby-changes:47430] usa:r59546 (ruby_2_3): merge revision(s) 59368: [Backport #13753]
usa 2017-08-09 19:32:37 +0900 (Wed, 09 Aug 2017) New Revision: 59546 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59546 Log: merge revision(s) 59368: [Backport #13753] random.c: ensure initialized * random.c (get_rnd, try_get_rnd): ensure initialized to get rid of crash in forked processes. [ruby-core:82100] [Bug #13753] Modified directories: branches/ruby_2_3/ Modified files: branches/ruby_2_3/ChangeLog branches/ruby_2_3/random.c branches/ruby_2_3/test/ruby/test_rand.rb branches/ruby_2_3/version.h Index: ruby_2_3/random.c =================================================================== --- ruby_2_3/random.c (revision 59545) +++ ruby_2_3/random.c (revision 59546) @@ -361,7 +361,7 @@ get_rnd(VALUE obj) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/random.c#L361 { rb_random_t *ptr; TypedData_Get_Struct(obj, rb_random_t, &random_data_type, ptr); - return ptr; + return rand_start(ptr); } static rb_random_t * @@ -371,7 +371,7 @@ try_get_rnd(VALUE obj) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/random.c#L371 return rand_start(&default_rand); } if (!rb_typeddata_is_kind_of(obj, &random_data_type)) return NULL; - return DATA_PTR(obj); + return rand_start(DATA_PTR(obj)); } /* :nodoc: */ Index: ruby_2_3/ChangeLog =================================================================== --- ruby_2_3/ChangeLog (revision 59545) +++ ruby_2_3/ChangeLog (revision 59546) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1 +Wed Aug 9 19:32:17 2017 Nobuyoshi Nakada <nobu@r...> + + * random.c (get_rnd, try_get_rnd): ensure initialized to get rid + of crash in forked processes. [Bug #13753] + Wed Aug 9 19:30:34 2017 Nobuyoshi Nakada <nobu@r...> * ext/strscan/strscan.c (strscan_aref): fix segfault after Index: ruby_2_3/test/ruby/test_rand.rb =================================================================== --- ruby_2_3/test/ruby/test_rand.rb (revision 59545) +++ ruby_2_3/test/ruby/test_rand.rb (revision 59546) @@ -453,6 +453,10 @@ END https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/ruby/test_rand.rb#L453 assert_fork_status(1, bug5661) {stable.rand(4)} r1, r2 = *assert_fork_status(2, bug5661) {stable.rand} assert_equal(r1, r2, bug5661) + + assert_fork_status(1, '[ruby-core:82100] [Bug #13753]') do + Random::DEFAULT.rand(4) + end rescue NotImplementedError end Index: ruby_2_3/version.h =================================================================== --- ruby_2_3/version.h (revision 59545) +++ ruby_2_3/version.h (revision 59546) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1 #define RUBY_VERSION "2.3.5" #define RUBY_RELEASE_DATE "2017-08-09" -#define RUBY_PATCHLEVEL 356 +#define RUBY_PATCHLEVEL 357 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 8 Index: ruby_2_3 =================================================================== --- ruby_2_3 (revision 59545) +++ ruby_2_3 (revision 59546) Property changes on: ruby_2_3 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r59368 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/