Open Quuxplusone opened 9 years ago
Bugzilla Link | PR23078 |
Status | NEW |
Importance | P normal |
Reported by | surfintheusa@yahoo.com |
Reported on | 2015-03-30 19:46:11 -0700 |
Last modified on | 2015-04-01 12:35:29 -0700 |
Version | 3.5 |
Hardware | Macintosh MacOS X |
CC | llvm-bugs@lists.llvm.org, mclow.lists@gmail.com |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
The problem is actually in basic_filebuf<_CharT, _Traits>::underflow().
Around line 595, it calls fread to fill the filebuf's buffer. (by default, 4096 bytes). this read hangs until it can read an entire buffer-full. When it is talking to a file, and the file doesn't have that much data, it gets a short read. When it is talking to a pipe, it just waits until that much data is available.
[ You can test this with the test program by putting 4K or more data into the pipe ]
Thanks, Marshall, for looking into this.
Is there a possible workaround?
(In reply to comment #2)
> Thanks, Marshall, for looking into this.
>
> Is there a possible workaround?
I don't have one yet.
I suspect that there isn't a "workaround"; the behavior of basic_filebuf will
probably have to be changed.