Project

General

Profile

Bug #14195

[PATCH] IO#pwrite uses tmp buffer to avoid parallel modification

Added by normalperson (Eric Wong) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Target version:
-
[ruby-core:84316]

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

Associated revisions

Revision 3b174fb7
Added by normal over 1 year ago

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]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 61376
Added by normalperson (Eric Wong) over 1 year ago

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]

Revision 61376
Added by normal over 1 year ago

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]

Revision 61376
Added by normal over 1 year ago

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]

History

Updated by normalperson (Eric Wong) over 1 year 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.

#3

Updated by Anonymous over 1 year 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]

Also available in: Atom PDF