[ruby-core:84316] [Ruby trunk Bug#14195] [PATCH] IO#pwrite uses tmp buffer to avoid parallel modification

From: normalperson@...
Date: 2017-12-17 22:28:20 UTC
List: ruby-core #84316
Issue #14195 has been reported by normalperson (Eric Wong).

----------------------------------------
Bug #14195: [PATCH] IO#pwrite uses tmp buffer to avoid parallel modification
https://bugs.ruby-lang.org/issues/14195

* Author: normalperson (Eric Wong)
* Status: Open
* Priority: Normal
* Assignee: nobu (Nobuyoshi Nakada)
* Target version: 
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
Since we release GVL, we must freeze a duplicate the string buffer
to prevent other threads from modifying our buffer while we
are waiting on pwrite(2).

* io.c (rb_io_pwrite): use_rb_str_tmp_frozen_{acquire/release}


Trivial bugfix, will commit before 2.5 final.


I think some ext/socket methods (sendmsg, setsockopt) may need this, too;
and fcntl/ioctl/getsockopt will need locktmp for strings...




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next