-
Bug
-
Resolution: Fixed
-
P2
-
10
-
b32
-
Verified
Below method seems to be ignoring the length value passed to it. This code change was made when Direct I/O support was added.
src/java.base/share/classes/sun/nio/ch/IOUtil.java
static long read(FileDescriptor fd, ByteBuffer[] bufs, int offset, int length,
NativeDispatcher nd)
throws IOException
{
return read(fd, bufs, offset, bufs.length, false, -1, nd);
}
Internal user reporting issue :
====
Whereas before, the length variable was being used. Now in our case, we are passing an array in bufs, whose length is 2, the first element is not null, second element is null, but the length we pass is 1.
now even though the length being passed is 1, bufs.length is being taken, since the second element is null, a NullPointerException is being thrown in the line "if (buf.isReadOnly())"
====
src/java.base/share/classes/sun/nio/ch/IOUtil.java
static long read(FileDescriptor fd, ByteBuffer[] bufs, int offset, int length,
NativeDispatcher nd)
throws IOException
{
return read(fd, bufs, offset, bufs.length, false, -1, nd);
}
Internal user reporting issue :
====
Whereas before, the length variable was being used. Now in our case, we are passing an array in bufs, whose length is 2, the first element is not null, second element is null, but the length we pass is 1.
now even though the length being passed is 1, bufs.length is being taken, since the second element is null, a NullPointerException is being thrown in the line "if (buf.isReadOnly())"
====
- relates to
-
JDK-8164900 Add support for O_DIRECT
-
- Resolved
-
- links to