Skip to content

Commit

Permalink
merge revision(s) 66242: [Backport #15387]
Browse files Browse the repository at this point in the history
	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.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@66876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nagachika committed Jan 20, 2019
1 parent 11a64ce commit d6ea20f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions io.c
Expand Up @@ -2935,6 +2935,7 @@ io_write_nonblock(VALUE io, VALUE str, VALUE ex)

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;
Expand Down
6 changes: 3 additions & 3 deletions version.h
@@ -1,10 +1,10 @@
#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"

Expand Down

0 comments on commit d6ea20f

Please sign in to comment.