From: Eric Wong <normalperson@...>
Date: 2013-07-23T20:09:07+09:00
Subject: [ruby-core:56126] Re: [ruby-trunk - Bug #8669][Open] outbuf can be "temporarily" locked forever in IO#read

"Glass_saga (Masaki Matsushita)" <glass.saga@gmail.com> wrote:
> Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN

I can confirm the issue under 1.9.3-p448 and 2.0.0-p247

> Following code make outbuf "temporarily" locked forever.
> It is needed to ensure rb_str_unlocktmp().

Nasty bug. I might've hit this soon in new project I'm working on(!)

> I have attached two patches.
> One fixes io_fread(), another does io_getpartial() and rb_io_sysread().
> May I commit these changes?

Untested, but looks correct.  Thanks.