Issue #8669 has been reported by Glass_saga (Masaki Matsushita).

----------------------------------------
Bug #8669: outbuf can be "temporarily" locked forever in IO#read
https://bugs.ruby-lang.org/issues/8669

Author: Glass_saga (Masaki Matsushita)
Status: Open
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: UNKNOWN, 2.0.0: UNKNOWN


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/