From 45407bbc645a07d1e4bf4f230993f5c78c3706f4 Mon Sep 17 00:00:00 2001 From: roland Date: Fri, 17 Aug 2018 17:13:12 +0200 Subject: [PATCH 1/6] 8209639: assert failure in coalesce.cpp: attempted to spill a non-spillable item Reviewed-by: neliasso, kvn --- .../c2/SubsumingLoadsCauseFlagSpill.java | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 test/hotspot/jtreg/compiler/c2/SubsumingLoadsCauseFlagSpill.java diff --git a/test/hotspot/jtreg/compiler/c2/SubsumingLoadsCauseFlagSpill.java b/test/hotspot/jtreg/compiler/c2/SubsumingLoadsCauseFlagSpill.java new file mode 100644 index 00000000000..9167549f18a --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/SubsumingLoadsCauseFlagSpill.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8209639 + * @summary assert failure in coalesce.cpp: attempted to spill a non-spillable item + * + * @run main/othervm -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,SubsumingLoadsCauseFlagSpill::not_inlined -Xmx1024m SubsumingLoadsCauseFlagSpill + * + */ + +public class SubsumingLoadsCauseFlagSpill { + private static Object field; + private static boolean do_throw; + private static volatile boolean barrier; + + public static void main(String[] args) { + for (int i = 0; i < 20_000; i++) { + do_throw = true; + field = null; + test(0); + do_throw = false; + field = new Object(); + test(0); + } + } + + private static float test(float f) { + Object v = null; + try { + not_inlined(); + v = field; + } catch (MyException me) { + v = field; + barrier = true; + } + if (v == null) { + return f * f; + } + return f; + } + + private static void not_inlined() throws MyException{ + if (do_throw) { + throw new MyException(); + } + } + + private static class MyException extends Throwable { + } +} From aa57d7b2ddee46bb25c6aef6796241029bda55b2 Mon Sep 17 00:00:00 2001 From: dlong Date: Fri, 24 Aug 2018 11:56:14 -0700 Subject: [PATCH 2/6] 8209825: guarantee(false) failed: wrong number of expression stack elements during deopt Reviewed-by: kvn, thartmann --- .../interpreter/TestVerifyStackAfterDeopt.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/compiler/interpreter/TestVerifyStackAfterDeopt.java b/test/hotspot/jtreg/compiler/interpreter/TestVerifyStackAfterDeopt.java index fc5ae5ea2b2..7eddc53f60b 100644 --- a/test/hotspot/jtreg/compiler/interpreter/TestVerifyStackAfterDeopt.java +++ b/test/hotspot/jtreg/compiler/interpreter/TestVerifyStackAfterDeopt.java @@ -25,8 +25,10 @@ /* * @test TestVerifyStackAfterDeopt * @bug 8148871 + * @bug 8209825 * @summary Checks VerifyStack after deoptimization of array allocation slow call * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:TieredStopAtLevel=1 + * -XX:MinTLABSize=1k -XX:TLABSize=1k * -XX:+DeoptimizeALot -XX:+VerifyStack * compiler.interpreter.TestVerifyStackAfterDeopt */ @@ -35,17 +37,19 @@ public class TestVerifyStackAfterDeopt { - private void method(Object[] a) { - + private long method(long l1, long l2, Object[] a) { + return l1 + l2; } + private long result[] = new long[1]; + private void test() { // For the array allocation, C1 emits a slow call into the runtime // that deoptimizes the caller frame due to -XX:+DeoptimizeALot. // The VerifyStack code then gets confused because the following // bytecode instruction is an invoke and the interpreter oop map // generator reports the oop map after execution of that invoke. - method(new Object[0]); + this.result[0] = method(1L, 2L, new Object[0]); } public static void main(String[] args) { From 4ff35b09fb4fbd37a39e097dc9a9acca227ee9c4 Mon Sep 17 00:00:00 2001 From: mikael Date: Fri, 24 Aug 2018 13:23:39 -0700 Subject: [PATCH 3/6] 8209915: Fix license headers Reviewed-by: kvn, pliden --- .../jdk/jfr/internal/OldObjectSample.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/OldObjectSample.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/OldObjectSample.java index 51e3efc71f8..0d41ce40226 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/OldObjectSample.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/OldObjectSample.java @@ -1,3 +1,28 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + package jdk.jfr.internal; import java.util.HashMap; From 7cc5d5914d345b84d9adf750873be687c1cdc87b Mon Sep 17 00:00:00 2001 From: vromero Date: Fri, 24 Aug 2018 13:30:56 -0700 Subject: [PATCH 4/6] 8209173: javac fails with completion exception while reporting an error Reviewed-by: mcimadamore --- .../javac/util/RichDiagnosticFormatter.java | 10 +- .../T8209173/CodeCompletionExceptTest.java | 100 ++++++++++++++++++ 2 files changed, 108 insertions(+), 2 deletions(-) create mode 100644 test/langtools/tools/javac/T8209173/CodeCompletionExceptTest.java diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java index bb17af168e4..19958758523 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -539,7 +539,13 @@ public Void visitClassType(ClassType t, Void ignored) { } nameSimplifier.addUsage(t.tsym); visit(t.getTypeArguments()); - if (t.getEnclosingType() != Type.noType) + Type enclosingType; + try { + enclosingType = t.getEnclosingType(); + } catch (CompletionFailure cf) { + return null; + } + if (enclosingType != Type.noType) visit(t.getEnclosingType()); return null; } diff --git a/test/langtools/tools/javac/T8209173/CodeCompletionExceptTest.java b/test/langtools/tools/javac/T8209173/CodeCompletionExceptTest.java new file mode 100644 index 00000000000..ea2f1ddac2a --- /dev/null +++ b/test/langtools/tools/javac/T8209173/CodeCompletionExceptTest.java @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8209173 + * @summary javac fails with completion exception while reporting an error + * @library /tools/lib + * @modules jdk.jdeps/com.sun.tools.classfile + * jdk.compiler/com.sun.tools.javac.api + * jdk.compiler/com.sun.tools.javac.main + * jdk.compiler/com.sun.tools.javac.util + * jdk.jdeps/com.sun.tools.javap + * @build toolbox.ToolBox toolbox.JavacTask + * @run main CodeCompletionExceptTest + */ + +import java.io.File; + +import toolbox.JavacTask; +import toolbox.Task; +import toolbox.ToolBox; + +public class CodeCompletionExceptTest { + private static final String MyListSource = + "import java.util.List;\n" + + "public interface MyList extends List {}"; + + private static final String C1Source = + "public class C1 {\n" + + " int m(MyList list) {\n" + + " return 0;\n" + + " }\n" + + "}"; + + private static final String C2Source = + "class C2 {\n" + + " void m() {\n" + + " (new C1()).m(1, 2, 3);\n" + + " }\n" + + "}"; + + public static void main(String[] args) throws Exception { + new CodeCompletionExceptTest().run(); + } + + ToolBox tb = new ToolBox(); + + void run() throws Exception { + // first we compile MyList + new JavacTask(tb) + .sources(MyListSource) + .run(); + + // then with MyList.class in the cp we compile C1 + new JavacTask(tb) + .sources(C1Source) + .classpath(System.getProperty("user.dir")) + .run(); + // now we delete MyList.class + tb.deleteFiles(System.getProperty("user.dir") + File.separatorChar + "MyList.class"); + /** and try to compile C2 which uses C1 which uses MyList but, MyList won't be in the + * classpath so its symbol can't be completed while javac is generating the diagnostic error + * the compiler should capture the completion exception and still be able to produce an error + * message without crashing + */ + String javacOut = new JavacTask(tb) + .sources(C2Source) + .classpath(System.getProperty("user.dir")) + .options("-XDrawDiagnostics") + .run(Task.Expect.FAIL) + .writeAll() + .getOutput(Task.OutputKind.DIRECT); + String expectedOuput = + "C2.java:3:19: compiler.err.cant.apply.symbol: kindname.method, m, MyList, int,int,int, kindname.class, C1, (compiler.misc.arg.length.mismatch)"; + if (!javacOut.contains(expectedOuput)) { + throw new Exception("test failed, unexpected output"); + } + } +} From c8c49bdab307cfda020315914e13c1defce4fc1a Mon Sep 17 00:00:00 2001 From: iklam Date: Thu, 23 Aug 2018 21:16:45 -0700 Subject: [PATCH 5/6] 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed Summary: Move different execution modes to IncompatibleOptions_stringDedup.java and IncompatibleOptions_noCompactStrings.java Reviewed-by: jiangli, coleenp --- .../sharedStrings/IncompatibleOptions.java | 44 +++++++++++-------- .../IncompatibleOptions_noCompactStrings.java | 37 ++++++++++++++++ .../IncompatibleOptions_stringDedup.java | 37 ++++++++++++++++ 3 files changed, 99 insertions(+), 19 deletions(-) create mode 100644 test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_noCompactStrings.java create mode 100644 test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_stringDedup.java diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java index 016b8b5b9d6..5861bc341c7 100644 --- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java @@ -29,15 +29,11 @@ * @requires vm.cds.archived.java.heap * @requires (vm.gc=="null") * @library /test/lib /test/hotspot/jtreg/runtime/appcds - * @modules java.base/jdk.internal.misc - * @modules java.management - * jdk.jartool/sun.tools.jar + * @modules jdk.jartool/sun.tools.jar * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission * @build HelloString * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions - * @run main/othervm -XX:+UseStringDeduplication -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions - * @run main/othervm -XX:-CompactStrings -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions */ import jdk.test.lib.Asserts; @@ -59,8 +55,10 @@ public class IncompatibleOptions { "The shared archive file's CompactStrings setting .* does not equal the current CompactStrings setting"; static String appJar; + static String[] globalVmOptions; public static void main(String[] args) throws Exception { + globalVmOptions = args; // specified by "@run main" in IncompatibleOptions_*.java appJar = JarBuilder.build("IncompatibleOptions", "HelloString"); // Uncompressed OOPs @@ -116,14 +114,16 @@ static void testDump(int testCaseNr, String collectorOption, String extraOption, System.out.println("Testcase: " + testCaseNr); OutputAnalyzer output = TestCommon.dump(appJar, TestCommon.list("Hello"), - "-XX:+UseCompressedOops", - collectorOption, - "-XX:SharedArchiveConfigFile=" + TestCommon.getSourceFile("SharedStringsBasic.txt"), - "-Xlog:cds,cds+hashtables", - extraOption); - - if (expectedWarning != null) + TestCommon.concat(globalVmOptions, + "-XX:+UseCompressedOops", + collectorOption, + "-XX:SharedArchiveConfigFile=" + TestCommon.getSourceFile("SharedStringsBasic.txt"), + "-Xlog:cds,cds+hashtables", + extraOption)); + + if (expectedWarning != null) { output.shouldContain(expectedWarning); + } if (expectedToFail) { Asserts.assertNE(output.getExitValue(), 0, @@ -140,19 +140,25 @@ static void testExec(int testCaseNr, String collectorOption, String extraOption, // needed, otherwise system considers empty extra option as a // main class param, and fails with "Could not find or load main class" if (!extraOption.isEmpty()) { - output = TestCommon.exec(appJar, "-XX:+UseCompressedOops", - collectorOption, "-Xlog:cds", extraOption, "HelloString"); + output = TestCommon.exec(appJar, + TestCommon.concat(globalVmOptions, + "-XX:+UseCompressedOops", + collectorOption, "-Xlog:cds", extraOption, "HelloString")); } else { - output = TestCommon.exec(appJar, "-XX:+UseCompressedOops", - collectorOption, "-Xlog:cds", "HelloString"); + output = TestCommon.exec(appJar, + TestCommon.concat(globalVmOptions, + "-XX:+UseCompressedOops", + collectorOption, "-Xlog:cds", "HelloString")); } - if (expectedWarning != null) + if (expectedWarning != null) { output.shouldMatch(expectedWarning); + } - if (expectedToFail) + if (expectedToFail) { Asserts.assertNE(output.getExitValue(), 0); - else + } else { SharedStringsUtils.checkExec(output); + } } } diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_noCompactStrings.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_noCompactStrings.java new file mode 100644 index 00000000000..5d354600608 --- /dev/null +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_noCompactStrings.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * @test + * @summary Test options that are incompatible with use of shared strings + * Also test mismatch in oops encoding between dump time and run time + * @requires vm.cds.archived.java.heap + * @requires (vm.gc=="null") + * @library /test/lib /test/hotspot/jtreg/runtime/appcds + * @modules jdk.jartool/sun.tools.jar + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission + * @build HelloString + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions -XX:-CompactStrings + */ diff --git a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_stringDedup.java b/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_stringDedup.java new file mode 100644 index 00000000000..d22b7ab1406 --- /dev/null +++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_stringDedup.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * @test + * @summary Test options that are incompatible with use of shared strings + * Also test mismatch in oops encoding between dump time and run time + * @requires vm.cds.archived.java.heap + * @requires (vm.gc=="null") + * @library /test/lib /test/hotspot/jtreg/runtime/appcds + * @modules jdk.jartool/sun.tools.jar + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission + * @build HelloString + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions -XX:+UseStringDeduplication + */ From c446d4a2a567384d6a1316697b7d207f1c94238a Mon Sep 17 00:00:00 2001 From: igerasim Date: Fri, 24 Aug 2018 18:56:41 -0700 Subject: [PATCH 6/6] 6474858: CardChannel.transmit(CommandAPDU) throws unexpected ArrayIndexOutOfBoundsException Reviewed-by: valeriep --- .../classes/sun/security/smartcardio/ChannelImpl.java | 10 +++++++--- test/jdk/sun/security/smartcardio/TestTransmit.java | 11 +++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/java.smartcardio/share/classes/sun/security/smartcardio/ChannelImpl.java b/src/java.smartcardio/share/classes/sun/security/smartcardio/ChannelImpl.java index 1d3ec88d1df..adfd39ed4cf 100644 --- a/src/java.smartcardio/share/classes/sun/security/smartcardio/ChannelImpl.java +++ b/src/java.smartcardio/share/classes/sun/security/smartcardio/ChannelImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -188,7 +188,7 @@ private byte[] doTransmit(byte[] command) throws CardException { byte[] response = SCardTransmit (card.cardId, card.protocol, command, 0, n); int rn = response.length; - if (getresponse && (rn >= 2)) { + if (getresponse && (rn >= 2) && (n >= 1)) { // see ISO 7816/2005, 5.1.3 if ((rn == 2) && (response[0] == 0x6c)) { // Resend command using SW2 as short Le field @@ -201,6 +201,11 @@ private byte[] doTransmit(byte[] command) throws CardException { if (rn > 2) { result = concat(result, response, rn - 2); } + if (command.length < 5) { + byte cla = command[0]; + command = new byte[5]; + command[0] = cla; + } command[1] = (byte)0xC0; command[2] = 0; command[3] = 0; @@ -208,7 +213,6 @@ private byte[] doTransmit(byte[] command) throws CardException { n = 5; continue; } - } result = concat(result, response, rn); break; diff --git a/test/jdk/sun/security/smartcardio/TestTransmit.java b/test/jdk/sun/security/smartcardio/TestTransmit.java index e233a4bb163..4dcd816829a 100644 --- a/test/jdk/sun/security/smartcardio/TestTransmit.java +++ b/test/jdk/sun/security/smartcardio/TestTransmit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 6293769 6294527 + * @bug 6293769 6294527 6474858 * @summary test transmit() works * @author Andreas Sterbenz * @modules java.smartcardio/javax.smartcardio @@ -90,6 +90,13 @@ public static void main(String[] args) throws Exception { } // else ignore } + // JDK-6474858 : CardChannel.transmit(CommandAPDU) throws + // unexpected ArrayIndexOutOfBoundsException + { + CommandAPDU capdu2 = new CommandAPDU(0x00, 0xA4, 0x00, 0x00); + channel.transmit(capdu2); + } + // disconnect card.disconnect(true);