Project

General

Profile

Actions

Bug #14195

closed

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

Added by normalperson (Eric Wong) over 6 years ago. Updated over 6 years ago.

Status:
Closed
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

Updated by normalperson (Eric Wong) over 6 years ago

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.

Actions #3

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]
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0