From: normalperson@... Date: 2017-12-17T22:28:20+00:00 Subject: [ruby-core:84316] [Ruby trunk Bug#14195] [PATCH] IO#pwrite uses tmp buffer to avoid parallel modification 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: