ruby-changes:54660
From: nagachika <ko1@a...>
Date: Sun, 20 Jan 2019 13:47:54 +0900 (JST)
Subject: [ruby-changes:54660] nagachika:r66876 (ruby_2_5): merge revision(s) 66242: [Backport #15387]
nagachika 2019-01-20 13:47:51 +0900 (Sun, 20 Jan 2019) New Revision: 66876 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66876 Log: merge revision(s) 66242: [Backport #15387] io.c (io_write_nonblock): add RB_GC_GUARD, io_fflush may switch threads Since io_fflush may block on mutex or rb_io_wait_readable and switch threads, we need to ensure the `str' VALUE returned by `rb_obj_as_string` is visible to GC. Modified directories: branches/ruby_2_5/ Modified files: branches/ruby_2_5/io.c branches/ruby_2_5/version.h Index: ruby_2_5/version.h =================================================================== --- ruby_2_5/version.h (revision 66875) +++ ruby_2_5/version.h (revision 66876) @@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_5/version.h#L1 #define RUBY_VERSION "2.5.4" -#define RUBY_RELEASE_DATE "2019-01-17" -#define RUBY_PATCHLEVEL 131 +#define RUBY_RELEASE_DATE "2019-01-20" +#define RUBY_PATCHLEVEL 132 #define RUBY_RELEASE_YEAR 2019 #define RUBY_RELEASE_MONTH 1 -#define RUBY_RELEASE_DAY 17 +#define RUBY_RELEASE_DAY 20 #include "ruby/version.h" Index: ruby_2_5/io.c =================================================================== --- ruby_2_5/io.c (revision 66875) +++ ruby_2_5/io.c (revision 66876) @@ -2935,6 +2935,7 @@ io_write_nonblock(VALUE io, VALUE str, V https://github.com/ruby/ruby/blob/trunk/ruby_2_5/io.c#L2935 rb_io_set_nonblock(fptr); n = write(fptr->fd, RSTRING_PTR(str), RSTRING_LEN(str)); + RB_GC_GUARD(str); if (n == -1) { int e = errno; Index: ruby_2_5 =================================================================== --- ruby_2_5 (revision 66875) +++ ruby_2_5 (revision 66876) Property changes on: ruby_2_5 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r66242 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/