RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available

Brian Burkhalter brian.burkhalter at oracle.com
Mon Jul 24 20:37:56 UTC 2023


I think the idea is to treat an IOException thrown by any but the first invocation of readBytes() as equivalent to end-of-file such as described for InputStream::read(byte[],int,int)<https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/io/InputStream.html#read(byte%5B%5D,int,int)> with respect to its invocation of InputStream::read()<https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/io/InputStream.html#read()>.

On Jul 24, 2023, at 8:33 AM, Bernd <ecki at zusammenkunft.net<mailto:ecki at zusammenkunft.net>> wrote:

If you return the short buffer (on IOException), does it need to cache the pending exception or can you just rely on the next read hitting that underlying exception again? (Is there an actual guarantee somewhere that the read position is not altered on IOExceptions or that you always get lending bytes before this report? (If so, does the native code do that as well?)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/security-dev/attachments/20230724/5df088ff/attachment-0001.htm>


More information about the security-dev mailing list