in reply to Generating a readline error

On linux I created a small file system on a loop device, filled it with a single file then truncated the underlying file. After deleting and recreating the loop device (I suppose this flushed cashed data), reading the contained file resulted in several successful reads followed by a read failure with EBADF.