From: "nagachika (Tomoyuki Chikanaga)" Date: 2013-07-28T21:58:59+09:00 Subject: [ruby-core:56245] [ruby-trunk - Bug #8669] outbuf can be "temporarily" locked forever in IO#read Issue #8669 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 1.9.3: REQUIRED, 2.0.0: REQUIRED to 1.9.3: REQUIRED, 2.0.0: DONE Backported to ruby_2_0_0 at r42216. ---------------------------------------- Bug #8669: outbuf can be "temporarily" locked forever in IO#read https://bugs.ruby-lang.org/issues/8669#change-40739 Author: Glass_saga (Masaki Matsushita) Status: Closed Priority: Normal Assignee: Glass_saga (Masaki Matsushita) Category: core Target version: current: 2.1.0 ruby -v: ruby 2.1.0dev (2013-07-23 trunk 42132) [x86_64-linux] Backport: 1.9.3: REQUIRED, 2.0.0: DONE Following code make outbuf "temporarily" locked forever. It is needed to ensure rb_str_unlocktmp(). str = "" t = Thread.new(str) do |str| r, = IO.pipe r.read(nil, str) end sleep 1 t.raise sleep 1 str.clear #=> can't modify string; temporarily locked (RuntimeError) I have attached two patches. One fixes io_fread(), another does io_getpartial() and rb_io_sysread(). May I commit these changes? -- http://bugs.ruby-lang.org/