Bug #14195
closed[PATCH] IO#pwrite uses tmp buffer to avoid parallel modification
Description
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...
Files
Updated by normalperson (Eric Wong) over 6 years ago
normalperson@yhbt.net wrote:
I think some ext/socket methods (sendmsg, setsockopt) may need this, too;
and fcntl/ioctl/getsockopt will need locktmp for strings...
N/M, *sockopt do not; but I think others do.
Will work on it later.
Updated by Anonymous over 6 years ago
- Status changed from Open to Closed
Applied in changeset trunk|r61376.
io.c: IO#pwrite uses tmp buffer to avoid parallel modification
Since we release GVL, we must freeze and 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}
[Bug #14195]