-
Bug
-
Resolution: Fixed
-
P2
-
1.4.0
-
beta
-
sparc
-
solaris_7
-
Verified
Scattering Read operation gets incorrect data on Windows NT.
This was working as of Merlin beta B-53.
The test was excluded on following builds due to bug number 4420794.
Steps:
1. Create a file of 256 bytes containing data -128 to +127 (in that order)
2. scattering read the data in 3 different byte buffers of
capacity 3 each.
------- part of test code ------------------------------------
// ScatteringRead.java : readScatteringTest01()
// perform read operation
// verify return value is correct
if ((bytesRead = fc.read(dstBuffers)) != TotalReadCapacity) {
return TestHelper.testFail(testName +
" FAIL (pos=" + pos + "): bytesRead expected = " + TotalReadCapacity +
", actual = " + bytesRead) ;
}
// for each buffer that received scattered data
for (int i = 0 ; i < numBuffers ; i ++) {
// make the buffer ready for get operation
dstBuffers[i].flip() ;
// get data into the buffer
dstBuffers[i].get(dstData[i]) ;
for (int j = 0 ; j < bufferCapacity ; j ++) {
System.out.println(
"dstData[" + pos + "," + i +"," + j +
" ):" + dstData[i][j]) ;
}
------- result on windows NT (incorrect) ----------->>>>
java ScatteringRead
dstData[0,0,0 ):0
dstData[0,0,1 ):0
dstData[0,0,2 ):0
dstData[0,1,0 ):2
dstData[0,1,1 ):0
dstData[0,1,2 ):0
dstData[0,2,0 ):-1
dstData[0,2,1 ):-1
dstData[0,2,2 ):-1
dstData[9,0,0 ):0
dstData[9,0,1 ):0
dstData[9,0,2 ):0
dstData[9,1,0 ):2
:
:
dstData[243,0,1 ):4
dstData[243,0,2 ):87
dstData[243,1,0 ):0
dstData[243,1,1 ):0
dstData[243,1,2 ):0
dstData[243,2,0 ):0
dstData[243,2,1 ):4
dstData[243,2,2 ):81
-------- correct result on Solaris / Linux --------->>>>>
java ScatteringRead
dstData[0,0,0 ):-128
dstData[0,0,1 ):-127
dstData[0,0,2 ):-126
dstData[0,1,0 ):-125
dstData[0,1,1 ):-124
dstData[0,1,2 ):-123
dstData[0,2,0 ):-122
dstData[0,2,1 ):-121
dstData[0,2,2 ):-120
dstData[9,0,0 ):-119
dstData[9,0,1 ):-118
dstData[9,0,2 ):-117
dstData[9,1,0 ):-116
:
:
dstData[234,1,0 ):109
dstData[234,1,1 ):110
dstData[234,1,2 ):111
dstData[234,2,0 ):112
dstData[234,2,1 ):113
dstData[234,2,2 ):114
dstData[243,0,0 ):115
dstData[243,0,1 ):116
dstData[243,0,2 ):117
dstData[243,1,0 ):118
dstData[243,1,1 ):119
dstData[243,1,2 ):120
dstData[243,2,0 ):121
dstData[243,2,1 ):122
------------------------------------
build 1.4.0-beta-b62
This was working as of Merlin beta B-53.
The test was excluded on following builds due to bug number 4420794.
Steps:
1. Create a file of 256 bytes containing data -128 to +127 (in that order)
2. scattering read the data in 3 different byte buffers of
capacity 3 each.
------- part of test code ------------------------------------
// ScatteringRead.java : readScatteringTest01()
// perform read operation
// verify return value is correct
if ((bytesRead = fc.read(dstBuffers)) != TotalReadCapacity) {
return TestHelper.testFail(testName +
" FAIL (pos=" + pos + "): bytesRead expected = " + TotalReadCapacity +
", actual = " + bytesRead) ;
}
// for each buffer that received scattered data
for (int i = 0 ; i < numBuffers ; i ++) {
// make the buffer ready for get operation
dstBuffers[i].flip() ;
// get data into the buffer
dstBuffers[i].get(dstData[i]) ;
for (int j = 0 ; j < bufferCapacity ; j ++) {
System.out.println(
"dstData[" + pos + "," + i +"," + j +
" ):" + dstData[i][j]) ;
}
------- result on windows NT (incorrect) ----------->>>>
java ScatteringRead
dstData[0,0,0 ):0
dstData[0,0,1 ):0
dstData[0,0,2 ):0
dstData[0,1,0 ):2
dstData[0,1,1 ):0
dstData[0,1,2 ):0
dstData[0,2,0 ):-1
dstData[0,2,1 ):-1
dstData[0,2,2 ):-1
dstData[9,0,0 ):0
dstData[9,0,1 ):0
dstData[9,0,2 ):0
dstData[9,1,0 ):2
:
:
dstData[243,0,1 ):4
dstData[243,0,2 ):87
dstData[243,1,0 ):0
dstData[243,1,1 ):0
dstData[243,1,2 ):0
dstData[243,2,0 ):0
dstData[243,2,1 ):4
dstData[243,2,2 ):81
-------- correct result on Solaris / Linux --------->>>>>
java ScatteringRead
dstData[0,0,0 ):-128
dstData[0,0,1 ):-127
dstData[0,0,2 ):-126
dstData[0,1,0 ):-125
dstData[0,1,1 ):-124
dstData[0,1,2 ):-123
dstData[0,2,0 ):-122
dstData[0,2,1 ):-121
dstData[0,2,2 ):-120
dstData[9,0,0 ):-119
dstData[9,0,1 ):-118
dstData[9,0,2 ):-117
dstData[9,1,0 ):-116
:
:
dstData[234,1,0 ):109
dstData[234,1,1 ):110
dstData[234,1,2 ):111
dstData[234,2,0 ):112
dstData[234,2,1 ):113
dstData[234,2,2 ):114
dstData[243,0,0 ):115
dstData[243,0,1 ):116
dstData[243,0,2 ):117
dstData[243,1,0 ):118
dstData[243,1,1 ):119
dstData[243,1,2 ):120
dstData[243,2,0 ):121
dstData[243,2,1 ):122
------------------------------------
build 1.4.0-beta-b62
- relates to
-
JDK-4456276 (fs) FileChannel scattering read throws IOException with -d64 Flag
-
- Closed
-