[
https://issues.apache.org/jira/browse/HADOOP-12106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14602881#comment-14602881
]
Tony Reix commented on HADOOP-12106:
------------------------------------
Adding : inBuffer.position(n); where n comes from last cipher.update()
did fix something:
System.out.println("@ JceAesCtrCryptoCodec.process: BEFORE cipher.doFinal" + "
inBuffer= " + inBuffer.toString() + " outBuffer= " + outBuffer.toString());
inBuffer.position(n);
int m = cipher.doFinal(inBuffer, outBuffer);
System.out.println("@ JceAesCtrCryptoCodec.process: 0" + " m= " + m );
System.out.println("@ JceAesCtrCryptoCodec.process: AFTER cipher.doFinal" + "
inBuffer= " + inBuffer.toString() + " outBuffer= " + outBuffer.toString());
Traces from Maven are:
Error: java.lang.AssertionError: expected:<3206307> but was:<3206304>
was moved in: java.lang.AssertionError: expected:<18> but was:<-1>
Traces from Java code are:
@ JceAesCtrCryptoCodec.process: 1 Typically code will not get here
contextReset= true
@ JceAesCtrCryptoCodec.process: BEFORE cipher.doFinal
inBuffer = java.nio.DirectByteBuffer[pos=6956 lim=6956 cap=8192]
outBuffer= java.nio.DirectByteBuffer[pos=6944 lim=8192 cap=8192]
@ JceAesCtrCryptoCodec.process: 0 m= 24
@ JceAesCtrCryptoCodec.process: AFTER cipher.doFinal
inBuffer = java.nio.DirectByteBuffer[pos=6956 lim=6956 cap=8192]
outBuffer= java.nio.DirectByteBuffer[pos=6968 lim=8192 cap=8192]
and check is now OK :
@ readCheck: n= 3177254 dataLen= 3177254
> JceAesCtrCryptoCodec.java may have an issue with Cypher.update(ByteBuffer,
> ByteBuffer)
> --------------------------------------------------------------------------------------
>
> Key: HADOOP-12106
> URL: https://issues.apache.org/jira/browse/HADOOP-12106
> Project: Hadoop Common
> Issue Type: Bug
> Affects Versions: 2.6.0, 2.7.0
> Environment: Hadoop 2.60 and 2.7+
> - AIX/PowerPC/IBMJVM
> - Ubuntu/i386/IBMJVM
> Reporter: Tony Reix
> Attachments: mvn.Test.TestCryptoStreamsForLocalFS.res20.AIX.Errors,
> mvn.Test.TestCryptoStreamsForLocalFS.res20.Ubuntu-i386.IBMJVM.Errors,
> mvn.Test.TestCryptoStreamsForLocalFS.res22.OpenJDK.Errors
>
>
> On AIX (IBM JVM available only), many sub-tests of :
> org.apache.hadoop.crypto.TestCryptoStreamsForLocalFS
> fail:
> Tests run: 13, Failures: 5, Errors: 1, Skipped:
> - testCryptoIV
> - testSeek
> - testSkip
> - testAvailable
> - testPositionedRead
> When testing SAME exact code on Ubuntu/i386 :
> - with OpenJDK, all tests are OK
> - with IBM JVM, tests randomly fail.
> The issue may be in the IBM JVM, or in some Hadoop code that not perfectly
> handles differences due to different IBM JVM.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)