From 092282841563852890343164d22d695de21b5e25 Mon Sep 17 00:00:00 2001 From: Jean Christophe Beyler Date: Tue, 10 Jul 2018 15:29:25 -0700 Subject: [PATCH 01/32] 8205643: HeapMonitorGCCMSTest fails with Graal Do not run HeapMonitorGCCMSTest with Graal Reviewed-by: amenkov, sspitsyn --- test/hotspot/jtreg/ProblemList.txt | 1 - .../jvmti/HeapMonitor/MyPackage/HeapMonitorGCCMSTest.java | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index e3703c2cd65..3806b6177e5 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -81,7 +81,6 @@ runtime/CompressedOops/UseCompressedOops.java 8079353 generic-all serviceability/sa/TestRevPtrsForInvokeDynamic.java 8191270 generic-all serviceability/sa/sadebugd/SADebugDTest.java 8163805 generic-all -serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorGCCMSTest.java 8205643 generic-all serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.java 8205541 generic-all serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatRateTest.java 8205652 generic-all diff --git a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorGCCMSTest.java b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorGCCMSTest.java index b2f7a42a00b..104876caba3 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorGCCMSTest.java +++ b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorGCCMSTest.java @@ -28,6 +28,7 @@ package MyPackage; * @summary Verifies the JVMTI Heap Monitor Statistics using CMS GC * @build Frame HeapMonitor * @requires vm.gc == "ConcMarkSweep" | vm.gc == "null" + * @requires !vm.graal.enabled * @compile HeapMonitorGCCMSTest.java * @run main/othervm/native -agentlib:HeapMonitorTest -XX:+UseConcMarkSweepGC MyPackage.HeapMonitorGCTest */ From fa3591db424baa0204044e7930f047d60b93d8e5 Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Wed, 11 Jul 2018 14:47:43 -0700 Subject: [PATCH 02/32] 8206980: ZonedDateTime could not parse timezone name with zh_CN locale correctly Reviewed-by: rriggs --- .../util/cldr/CLDRTimeZoneNameProviderImpl.java | 3 ++- .../time/format/TestZoneTextPrinterParser.java | 15 +++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/java.base/share/classes/sun/util/cldr/CLDRTimeZoneNameProviderImpl.java b/src/java.base/share/classes/sun/util/cldr/CLDRTimeZoneNameProviderImpl.java index 3802eb14571..fa7a05f060c 100644 --- a/src/java.base/share/classes/sun/util/cldr/CLDRTimeZoneNameProviderImpl.java +++ b/src/java.base/share/classes/sun/util/cldr/CLDRTimeZoneNameProviderImpl.java @@ -130,7 +130,8 @@ public class CLDRTimeZoneNameProviderImpl extends TimeZoneNameProviderImpl { // Fill in for the empty names. // English names are prefilled for performance. - if (locale.getLanguage() != "en") { + if (!locale.equals(Locale.ENGLISH) && + !locale.equals(Locale.US)) { for (int zoneIndex = 0; zoneIndex < ret.length; zoneIndex++) { deriveFallbackNames(ret[zoneIndex], locale); } diff --git a/test/jdk/java/time/test/java/time/format/TestZoneTextPrinterParser.java b/test/jdk/java/time/test/java/time/format/TestZoneTextPrinterParser.java index dd3799ac8a7..77ccf37ad56 100644 --- a/test/jdk/java/time/test/java/time/format/TestZoneTextPrinterParser.java +++ b/test/jdk/java/time/test/java/time/format/TestZoneTextPrinterParser.java @@ -49,7 +49,7 @@ import org.testng.annotations.Test; /* * @test - * @bug 8081022 8151876 8166875 8189784 + * @bug 8081022 8151876 8166875 8189784 8206980 * @key randomness */ @@ -156,12 +156,15 @@ public class TestZoneTextPrinterParser extends AbstractTestPrinterParser { {"America/Chicago", "CST", none, Locale.ENGLISH, TextStyle.SHORT}, {"Asia/Taipei", "CST", preferred, Locale.ENGLISH, TextStyle.SHORT}, {"Australia/South", "ACST", preferred_s, Locale.ENGLISH, TextStyle.SHORT}, - {"America/Chicago", "CDT", none, Locale.ENGLISH, TextStyle.SHORT}, + {"America/Chicago", "CDT", none, Locale.ENGLISH, TextStyle.SHORT}, {"Asia/Shanghai", "CDT", preferred_s, Locale.ENGLISH, TextStyle.SHORT}, - {"America/Juneau", "AKST", none, Locale.ENGLISH, TextStyle.SHORT}, - {"America/Juneau", "AKDT", none, Locale.ENGLISH, TextStyle.SHORT}, - {"Pacific/Honolulu", "HST", none, Locale.ENGLISH, TextStyle.SHORT}, - {"America/Halifax", "AST", none, Locale.ENGLISH, TextStyle.SHORT}, + {"America/Juneau", "AKST", none, Locale.ENGLISH, TextStyle.SHORT}, + {"America/Juneau", "AKDT", none, Locale.ENGLISH, TextStyle.SHORT}, + {"Pacific/Honolulu", "HST", none, Locale.ENGLISH, TextStyle.SHORT}, + {"America/Halifax", "AST", none, Locale.ENGLISH, TextStyle.SHORT}, + {"Z", "Z", none, Locale.ENGLISH, TextStyle.SHORT}, + {"Z", "Z", none, Locale.US, TextStyle.SHORT}, + {"Z", "Z", none, Locale.CANADA, TextStyle.SHORT}, }; } From 3bbfd2f3013a1316bc06b632ac8b6f66576bd587 Mon Sep 17 00:00:00 2001 From: Rajan Halade Date: Wed, 11 Jul 2018 14:54:35 -0700 Subject: [PATCH 03/32] 8207068: Add Entrust root certificates Reviewed-by: weijun --- src/java.base/share/lib/security/cacerts | Bin 85358 -> 93412 bytes .../lib/security/cacerts/VerifyCACerts.java | 20 ++- .../certification/EntrustCA.java | 169 ++++++++++++++++++ 3 files changed, 187 insertions(+), 2 deletions(-) create mode 100644 test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EntrustCA.java diff --git a/src/java.base/share/lib/security/cacerts b/src/java.base/share/lib/security/cacerts index 350636c26f1a54b406db61cc45f0d56219a7ef34..9adede1ddabbfca30343e99ab04a409c1ceb9233 100644 GIT binary pat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SFiS z9+97sr#l}hjq8o3gc~Z8UyBBP0VouiU+?S+U%>IEF^Otoa=AR!gFL7#Z|&(6Jm=N6 zwA%HYfzIXD{)kn>Z$t7pgPZt>_&CnrO<_+|3kCs%r4m8S| zT{%Xt==NO0)M7JM}$$2E8LGO)V7etzRY+3(v)vmE|&(erA6u$ZcK2 zK0KEP;n{lo?%424FfkE`=w8HQAmS1BDIE`Hzo;B1AbbE%_;G?YcC?legd2ZWlWTu5 zFN7Ij45xQanQ_X0U>yD;)-iwO`)T!^=q8UNZ2LEl4_y6?P*PP8v@$o`aPFs-8TF(o8Vxx-rmQJS&G&3VQA2@H_qqc+g??{i zQORxLo}U=ZyU>O5Md0Mq=y#HR7J*UczGO>1) z7Ib@@7;|uyLM@pL(H3!SvjmYLq!z3|be@LZj6Q*do-?tiT9te(zlnV5tl6^fe*t|Y BQ^f!P delta 102 zcmV-s0Ga>f*#+*J1q}Y}{_Ow&00IC2086n9zaq2uCA|r=4m9H-m&Gvw53_Ju0Y$U- zqFNub&c|g0v$@YXCbKH|OIEiiR{>B2w>47%^8>ecTLD=S6kPW!WPiKfw3FHLrAy~5 Ia>6qK@Wxmy!2kdN diff --git a/test/jdk/lib/security/cacerts/VerifyCACerts.java b/test/jdk/lib/security/cacerts/VerifyCACerts.java index 7fe87ea374a..b702ec68cbb 100644 --- a/test/jdk/lib/security/cacerts/VerifyCACerts.java +++ b/test/jdk/lib/security/cacerts/VerifyCACerts.java @@ -24,7 +24,7 @@ /** * @test - * @bug 8189131 8198240 8191844 8189949 8191031 8196141 8204923 + * @bug 8189131 8198240 8191844 8189949 8191031 8196141 8204923 8195774 * @requires java.runtime.name ~= "OpenJDK.*" * @summary Check root CA entries in cacerts file */ @@ -42,7 +42,7 @@ public class VerifyCACerts { + File.separator + "security" + File.separator + "cacerts"; // The numbers of certs now. - private static final int COUNT = 75; + private static final int COUNT = 83; // map of cert alias to SHA-256 fingerprint private static final Map FINGERPRINT_MAP @@ -198,6 +198,22 @@ public class VerifyCACerts { "14:65:FA:20:53:97:B8:76:FA:A6:F0:A9:95:8E:55:90:E4:0F:CC:7F:AA:4F:B7:C2:C8:67:75:21:FB:5F:B6:58"); put("starfieldrootg2ca [jdk]", "2C:E1:CB:0B:F9:D2:F9:E1:02:99:3F:BE:21:51:52:C3:B2:DD:0C:AB:DE:1C:68:E5:31:9B:83:91:54:DB:B7:F5"); + put("entrustrootcaec1 [jdk]", + "02:ED:0E:B2:8C:14:DA:45:16:5C:56:67:91:70:0D:64:51:D7:FB:56:F0:B2:AB:1D:3B:8E:B0:70:E5:6E:DF:F5"); + put("entrust2048ca [jdk]", + "6D:C4:71:72:E0:1C:BC:B0:BF:62:58:0D:89:5F:E2:B8:AC:9A:D4:F8:73:80:1E:0C:10:B9:C8:37:D2:1E:B1:77"); + put("entrustrootcag2 [jdk]", + "43:DF:57:74:B0:3E:7F:EF:5F:E4:0D:93:1A:7B:ED:F1:BB:2E:6B:42:73:8C:4E:6D:38:41:10:3D:3A:A7:F3:39"); + put("entrustevca [jdk]", + "73:C1:76:43:4F:1B:C6:D5:AD:F4:5B:0E:76:E7:27:28:7C:8D:E5:76:16:C1:E6:E6:14:1A:2B:2C:BC:7D:8E:4C"); + put("affirmtrustnetworkingca [jdk]", + "0A:81:EC:5A:92:97:77:F1:45:90:4A:F3:8D:5D:50:9F:66:B5:E2:C5:8F:CD:B5:31:05:8B:0E:17:F3:F0:B4:1B"); + put("affirmtrustpremiumca [jdk]", + "70:A7:3F:7F:37:6B:60:07:42:48:90:45:34:B1:14:82:D5:BF:0E:69:8E:CC:49:8D:F5:25:77:EB:F2:E9:3B:9A"); + put("affirmtrustcommercialca [jdk]", + "03:76:AB:1D:54:C5:F9:80:3C:E4:B2:E2:01:A0:EE:7E:EF:7B:57:B6:36:E8:A9:3C:9B:8D:48:60:C9:6F:5F:A7"); + put("affirmtrustpremiumeccca [jdk]", + "BD:71:FD:F6:DA:97:E4:CF:62:D1:64:7A:DD:25:81:B0:7D:79:AD:F8:39:7E:B4:EC:BA:9C:5E:84:88:82:14:23"); } }; diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EntrustCA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EntrustCA.java new file mode 100644 index 00000000000..d8d6d4f5f8f --- /dev/null +++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EntrustCA.java @@ -0,0 +1,169 @@ +/* + * 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 8195774 + * @summary Interoperability tests with Entrust EC CA + * @build ValidatePathWithParams + * @run main/othervm -Djava.security.debug=certpath EntrustCA OCSP + * @run main/othervm -Djava.security.debug=certpath EntrustCA CRL + */ + +/* + * Obtain test artifacts for Entrust EC CA from: + * + * Valid https://validec.entrust.net + * + * Revoked https://revokedec.entrust.net + */ +public class EntrustCA { + + // Owner: CN=Entrust Certification Authority - L1J, OU="(c) 2016 Entrust, Inc. - for authorized use only", + // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US + // Issuer: CN=Entrust Root Certification Authority - EC1, OU="(c) 2012 Entrust, Inc. - for authorized use only", + // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US + private static final String INT = "-----BEGIN CERTIFICATE-----\n" +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"cm9vdC5jcmwwOwYDVR0gBDQwMjAwBgRVHSAAMCgwJgYIKwYBBQUHAgEWGmh0dHA6\n" + + "Ly93d3cuZW50cnVzdC5uZXQvcnBhMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEF\n" + + "BQcDAjAdBgNVHQ4EFgQUw/lFA77I+Qs8RTXz63Ls5+jrlJswHwYDVR0jBBgwFoAU\n" + + "t2PnGt2N6QimVYOk4GpQQWURQkkwCgYIKoZIzj0EAwMDaQAwZgIxAPnVAOqxKDd7\n" + + "v37EBmpPqWCCWBFPKW6HpRx3GUWc9caeQIw8rO2HXYgf92pb/TsJYAIxAJhI0MpR\n" + + "z5L42xF1R9UIPfQxCMwgsnWBqIqcfMrMO+2DxQy6GIP3cFFj9gRyxguKWw==\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN=validec.entrust.net, SERIALNUMBER=D15576572, OID.2.5.4.15=Private Organization, O="Entrust, Inc.", + // OID.1.3.6.1.4.1.311.60.2.1.2=Maryland, OID.1.3.6.1.4.1.311.60.2.1.3=US, L=Kanata, ST=Ontario, C=CA + // Issuer: CN=Entrust Certification Authority - L1J, OU="(c) 2016 Entrust, Inc. - for authorized use only", + // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US + private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + + "MIIFrTCCBTKgAwIBAgIQYtgW4DLwh74AAAAAVqBXkTAKBggqhkjOPQQDAjCBujEL\n" + + "MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1Nl\n" + + "ZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDE2\n" + + "IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEuMCwGA1UE\n" + + "AxMlRW50cnVzdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEwxSjAeFw0xODA2\n" + + "M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DvnD+PUOf8PzPevsWkuxNqcQwDgYDVR0PAQH/BAQDAgeAMB0GA1Ud\n" + + "JQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBjBggrBgEFBQcBAQRXMFUwIwYIKwYB\n" + + "BQUHMAGGF2h0dHA6Ly9vY3NwLmVudHJ1c3QubmV0MC4GCCsGAQUFBzAChiJodHRw\n" + + "Oi8vYWlhLmVudHJ1c3QubmV0L2wxai1lYzEuY2VyMDMGA1UdHwQsMCowKKAmoCSG\n" + + "Imh0dHA6Ly9jcmwuZW50cnVzdC5uZXQvbGV2ZWwxai5jcmwwSgYDVR0gBEMwQTA2\n" + + "BgpghkgBhvpsCgECMCgwJgYIKwYBBQUHAgEWGmh0dHA6Ly93d3cuZW50cnVzdC5u\n" + + "ZXQvcnBhMAcGBWeBDAEBMB8GA1UdIwQYMBaAFMP5RQO+yPkLPEU18+ty7Ofo65Sb\n" + + "MB0GA1UdDgQWBBT+J7OhS6gskCanmOGnx10DPSF8ATAJBgNVHRMEAjAAMAoGCCqG\n" + + "SM49BAMCA2kAMGYCMQCQLUQABT74TmdHzAtB97uNF5+Zy15wzkmlKeRSOXCIf2C5\n" + + "YKjsgdkR1OdzZXcpjNgCMQDfWcdPhodNXZC4l1lLPOPaTzPPw6uVqqoITQlc6r1t\n" + + "dRkkD6K9ii/X8EtwoFp7s80=\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN=revokedec.entrust.net, SERIALNUMBER=115868500, OID.2.5.4.15=Private Organization, O="Entrust, Inc.", + // OID.1.3.6.1.4.1.311.60.2.1.2=Texas, OID.1.3.6.1.4.1.311.60.2.1.3=US, L=Kanata, ST=Ontario, C=CA + // Issuer: CN=Entrust Certification Authority - L1J, OU="(c) 2016 Entrust, Inc. - for authorized use only", + // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US + private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + + "MIIGJzCCBaygAwIBAgIRAM0WDfag1taIAAAAAFagJ5gwCgYI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oQSNKrBPBfGz2AQVLHAXsxvIlGhKZAQtM49zxA8AdFy/agwIxAMEjJH6A\n" + + "4UbcGZc40eYu6wUbAxiUDD3gwSElNQ8Z6IhNLPCCdMM6KZORyaagAcXn4A==\n" + + "-----END CERTIFICATE-----"; + + public static void main(String[] args) throws Exception { + + ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); + + if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { + pathValidator.enableCRLCheck(); + } else { + // OCSP check by default + pathValidator.enableOCSPCheck(); + } + + // Validate valid + pathValidator.validate(new String[]{VALID, INT}, + ValidatePathWithParams.Status.GOOD, null, System.out); + + // Validate Revoked + pathValidator.validate(new String[]{REVOKED, INT}, + ValidatePathWithParams.Status.REVOKED, + "Wed May 24 10:39:28 PDT 2017", System.out); + } + +} From 11e4fac62bf2d492c01300ab61bd39f1dbd49851 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Thu, 12 Jul 2018 08:44:39 +0800 Subject: [PATCH 04/32] 8206189: sun/security/pkcs12/EmptyPassword.java fails with Sequence tag error Reviewed-by: xuelei --- .../sun/security/pkcs12/PKCS12KeyStore.java | 125 +++++++++--------- 1 file changed, 64 insertions(+), 61 deletions(-) diff --git a/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java b/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java index 7d98cbb20e5..28b5b3635fa 100644 --- a/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java +++ b/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java @@ -296,6 +296,9 @@ public final class PKCS12KeyStore extends KeyStoreSpi { } catch (Exception e) { if (password.length == 0) { // Retry using an empty password with a NUL terminator. + if (debug != null) { + debug.println("Retry with a NUL password"); + } return f.tryOnce(new char[1]); } throw e; @@ -376,7 +379,7 @@ public final class PKCS12KeyStore extends KeyStoreSpi { try { PBEParameterSpec pbeSpec; - int ic = 0; + int ic; if (algParams != null) { try { @@ -390,65 +393,69 @@ public final class PKCS12KeyStore extends KeyStoreSpi { if (ic > MAX_ITERATION_COUNT) { throw new IOException("PBE iteration count too large"); } + } else { + ic = 0; } - byte[] keyInfo = RetryWithZero.run(pass -> { + key = RetryWithZero.run(pass -> { // Use JCE SecretKey skey = getPBEKey(pass); Cipher cipher = Cipher.getInstance( mapPBEParamsToAlgorithm(algOid, algParams)); cipher.init(Cipher.DECRYPT_MODE, skey, algParams); - return cipher.doFinal(encryptedKey); + byte[] keyInfo = cipher.doFinal(encryptedKey); + /* + * Parse the key algorithm and then use a JCA key factory + * to re-create the key. + */ + DerValue val = new DerValue(keyInfo); + DerInputStream in = val.toDerInputStream(); + int i = in.getInteger(); + DerValue[] value = in.getSequence(2); + AlgorithmId algId = new AlgorithmId(value[0].getOID()); + String keyAlgo = algId.getName(); + + // decode private key + if (entry instanceof PrivateKeyEntry) { + KeyFactory kfac = KeyFactory.getInstance(keyAlgo); + PKCS8EncodedKeySpec kspec = new PKCS8EncodedKeySpec(keyInfo); + Key tmp = kfac.generatePrivate(kspec); + + if (debug != null) { + debug.println("Retrieved a protected private key at alias" + + " '" + alias + "' (" + + new AlgorithmId(algOid).getName() + + " iterations: " + ic + ")"); + } + return tmp; + // decode secret key + } else { + byte[] keyBytes = in.getOctetString(); + SecretKeySpec secretKeySpec = + new SecretKeySpec(keyBytes, keyAlgo); + + // Special handling required for PBE: needs a PBEKeySpec + Key tmp; + if (keyAlgo.startsWith("PBE")) { + SecretKeyFactory sKeyFactory = + SecretKeyFactory.getInstance(keyAlgo); + KeySpec pbeKeySpec = + sKeyFactory.getKeySpec(secretKeySpec, PBEKeySpec.class); + tmp = sKeyFactory.generateSecret(pbeKeySpec); + } else { + tmp = secretKeySpec; + } + + if (debug != null) { + debug.println("Retrieved a protected secret key at alias " + + "'" + alias + "' (" + + new AlgorithmId(algOid).getName() + + " iterations: " + ic + ")"); + } + return tmp; + } }, password); - /* - * Parse the key algorithm and then use a JCA key factory - * to re-create the key. - */ - DerValue val = new DerValue(keyInfo); - DerInputStream in = val.toDerInputStream(); - int i = in.getInteger(); - DerValue[] value = in.getSequence(2); - AlgorithmId algId = new AlgorithmId(value[0].getOID()); - String keyAlgo = algId.getName(); - - // decode private key - if (entry instanceof PrivateKeyEntry) { - KeyFactory kfac = KeyFactory.getInstance(keyAlgo); - PKCS8EncodedKeySpec kspec = new PKCS8EncodedKeySpec(keyInfo); - key = kfac.generatePrivate(kspec); - - if (debug != null) { - debug.println("Retrieved a protected private key at alias" + - " '" + alias + "' (" + - new AlgorithmId(algOid).getName() + - " iterations: " + ic + ")"); - } - - // decode secret key - } else { - byte[] keyBytes = in.getOctetString(); - SecretKeySpec secretKeySpec = - new SecretKeySpec(keyBytes, keyAlgo); - - // Special handling required for PBE: needs a PBEKeySpec - if (keyAlgo.startsWith("PBE")) { - SecretKeyFactory sKeyFactory = - SecretKeyFactory.getInstance(keyAlgo); - KeySpec pbeKeySpec = - sKeyFactory.getKeySpec(secretKeySpec, PBEKeySpec.class); - key = sKeyFactory.generateSecret(pbeKeySpec); - } else { - key = secretKeySpec; - } - - if (debug != null) { - debug.println("Retrieved a protected secret key at alias " + - "'" + alias + "' (" + - new AlgorithmId(algOid).getName() + - " iterations: " + ic + ")"); - } - } } catch (Exception e) { UnrecoverableKeyException uke = new UnrecoverableKeyException("Get Key failed: " + @@ -2019,7 +2026,6 @@ public final class PKCS12KeyStore extends KeyStoreSpi { * Spin over the ContentInfos. */ for (int i = 0; i < count; i++) { - byte[] safeContentsData; ContentInfo safeContents; DerInputStream sci; byte[] eAlgId = null; @@ -2027,14 +2033,13 @@ public final class PKCS12KeyStore extends KeyStoreSpi { sci = new DerInputStream(safeContentsArray[i].toByteArray()); safeContents = new ContentInfo(sci); contentType = safeContents.getContentType(); - safeContentsData = null; if (contentType.equals(ContentInfo.DATA_OID)) { if (debug != null) { debug.println("Loading PKCS#7 data"); } - safeContentsData = safeContents.getData(); + loadSafeContents(new DerInputStream(safeContents.getData())); } else if (contentType.equals(ContentInfo.ENCRYPTED_DATA_OID)) { if (password == null) { @@ -2058,7 +2063,7 @@ public final class PKCS12KeyStore extends KeyStoreSpi { if (seq[2].isConstructed()) newTag |= 0x20; seq[2].resetTag(newTag); - safeContentsData = seq[2].getOctetString(); + byte[] rawData = seq[2].getOctetString(); // parse Algorithm parameters DerInputStream in = seq[1].toDerInputStream(); @@ -2089,14 +2094,14 @@ public final class PKCS12KeyStore extends KeyStoreSpi { " iterations: " + ic + ")"); } - byte[] rawData = safeContentsData; try { - safeContentsData = RetryWithZero.run(pass -> { + RetryWithZero.run(pass -> { // Use JCE SecretKey skey = getPBEKey(pass); Cipher cipher = Cipher.getInstance(algOid.toString()); cipher.init(Cipher.DECRYPT_MODE, skey, algParams); - return cipher.doFinal(rawData); + loadSafeContents(new DerInputStream(cipher.doFinal(rawData))); + return null; }, password); } catch (Exception e) { throw new IOException("keystore password was incorrect", @@ -2107,8 +2112,6 @@ public final class PKCS12KeyStore extends KeyStoreSpi { throw new IOException("public key protected PKCS12" + " not supported"); } - DerInputStream sc = new DerInputStream(safeContentsData); - loadSafeContents(sc, password); } // The MacData is optional. @@ -2242,7 +2245,7 @@ public final class PKCS12KeyStore extends KeyStoreSpi { else return null; } - private void loadSafeContents(DerInputStream stream, char[] password) + private void loadSafeContents(DerInputStream stream) throws IOException, NoSuchAlgorithmException, CertificateException { DerValue[] safeBags = stream.getSequence(2); From 39a27d11150c799be683c9e9ca1145ac29c780c5 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Thu, 12 Jul 2018 09:13:55 +0200 Subject: [PATCH 05/32] 8207006: serviceability/sa/TestUniverse.java#id0 crashes with EpsilonGC and AOT Reviewed-by: twisti, kvn --- src/hotspot/share/aot/aotCodeHeap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/aot/aotCodeHeap.cpp b/src/hotspot/share/aot/aotCodeHeap.cpp index d4825e89582..6d8972ba464 100644 --- a/src/hotspot/share/aot/aotCodeHeap.cpp +++ b/src/hotspot/share/aot/aotCodeHeap.cpp @@ -549,7 +549,7 @@ void AOTCodeHeap::link_global_lib_symbols() { _lib_symbols_initialized = true; CollectedHeap* heap = Universe::heap(); - SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_card_table_address", address, ci_card_table_address()); + SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_card_table_address", address, (BarrierSet::barrier_set()->is_a(BarrierSet::CardTableBarrierSet) ? ci_card_table_address() : NULL)); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_heap_top_address", address, (heap->supports_inline_contig_alloc() ? heap->top_addr() : NULL)); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_heap_end_address", address, (heap->supports_inline_contig_alloc() ? heap->end_addr() : NULL)); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_polling_page", address, os::get_polling_page()); From bad72aa13c517506ccb5329c1a1a06adf2ade55e Mon Sep 17 00:00:00 2001 From: Manajit Halder Date: Thu, 12 Jul 2018 15:17:18 +0530 Subject: [PATCH 06/32] 8204860: The frame could be resized by dragging a corner of the frame with the mouse Reviewed-by: prr, psadhukhan --- .../sun/lwawt/macosx/CPlatformWindow.java | 28 +++++--- .../UnfocusableMaximizedFrameResizablity.java | 69 +++++++++++++++++-- 2 files changed, 81 insertions(+), 16 deletions(-) diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java index 9bcd46c9fc5..fc69ff3995c 100644 --- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java +++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java @@ -378,7 +378,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo // Either java.awt.Frame or java.awt.Dialog can be resizable, however java.awt.Window is never resizable { - final boolean resizable = isFrame ? ((Frame)target).isResizable() : (isDialog ? ((Dialog)target).isResizable() : false); + final boolean resizable = isTargetResizable() && isNativelyFocusableWindow(); styleBits = SET(styleBits, RESIZABLE, resizable); if (!resizable) { styleBits = SET(styleBits, ZOOMABLE, false); @@ -482,6 +482,16 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo return styleBits; } + private boolean isTargetResizable() { + if (target instanceof Frame) { + return ((Frame)target).isResizable(); + } else if (target instanceof Dialog) { + return ((Dialog)target).isResizable(); + } + + return false; + } + // this is the counter-point to -[CWindow _nativeSetStyleBit:] private void setStyleBits(final int mask, final boolean value) { execute(ptr -> nativeSetNSWindowStyleBits(ptr, mask, value ? mask : 0)); @@ -676,10 +686,9 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo // Manage the extended state when showing if (visible) { /* Frame or Dialog should be set property WINDOW_FULLSCREENABLE to true if the - Frame or Dialog is resizable. + Frame or Dialog is resizable and focusable. **/ - final boolean resizable = (target instanceof Frame) ? ((Frame)target).isResizable() : - ((target instanceof Dialog) ? ((Dialog)target).isResizable() : false); + final boolean resizable = isTargetResizable() && isNativelyFocusableWindow(); if (resizable) { setCanFullscreen(true); } @@ -814,9 +823,10 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo @Override public void setResizable(final boolean resizable) { - setCanFullscreen(resizable); - setStyleBits(RESIZABLE, resizable); - setStyleBits(ZOOMABLE, resizable); + final boolean windowResizable = resizable && isNativelyFocusableWindow(); + setCanFullscreen(windowResizable); + setStyleBits(RESIZABLE, windowResizable); + setStyleBits(ZOOMABLE, windowResizable); } @Override @@ -858,8 +868,8 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo @Override public void updateFocusableWindowState() { - final boolean isFocusable = isNativelyFocusableWindow(); - setStyleBits(SHOULD_BECOME_KEY | SHOULD_BECOME_MAIN | RESIZABLE, isFocusable); // set bits at once + setStyleBits(SHOULD_BECOME_KEY | SHOULD_BECOME_MAIN | RESIZABLE, + (isNativelyFocusableWindow() && isTargetResizable())); } @Override diff --git a/test/jdk/java/awt/Frame/UnfocusableMaximizedFrameResizablity/UnfocusableMaximizedFrameResizablity.java b/test/jdk/java/awt/Frame/UnfocusableMaximizedFrameResizablity/UnfocusableMaximizedFrameResizablity.java index 84c9240c918..bc412d14b51 100644 --- a/test/jdk/java/awt/Frame/UnfocusableMaximizedFrameResizablity/UnfocusableMaximizedFrameResizablity.java +++ b/test/jdk/java/awt/Frame/UnfocusableMaximizedFrameResizablity/UnfocusableMaximizedFrameResizablity.java @@ -24,7 +24,7 @@ /* @test @key headful - @bug 4980161 7158623 + @bug 4980161 7158623 8204860 @summary Setting focusable window state to false makes the maximized frame resizable @compile UnfocusableMaximizedFrameResizablity.java @run main UnfocusableMaximizedFrameResizablity @@ -36,29 +36,84 @@ import java.awt.Rectangle; import java.awt.AWTException; import java.awt.event.InputEvent; import java.awt.Robot; +import javax.swing.JFrame; +import javax.swing.SwingUtilities; public class UnfocusableMaximizedFrameResizablity { private static Frame frame; + private static JFrame jframe; private static Robot robot; private static boolean isProgInterruption = false; private static Thread mainThread = null; private static int sleepTime = 300000; - private static void createAndShowFrame() { + private static void createAndShowFrame() throws Exception { //The MAXIMIZED_BOTH state is not supported by the toolkit. Nothing to test. if (!Toolkit.getDefaultToolkit().isFrameStateSupported(Frame.MAXIMIZED_BOTH)) { return; } - frame = new Frame("Unfocusable frame"); + //Case 1: Setting frame resizable to true followed by focusable to false + frame = createFrame("Resizable Unfocusable frame"); + frame.setResizable(true); + frame.setFocusableWindowState(false); + tryToResizeFrame(frame); + + //Case 2: Setting frame focusable to false followed by resizable to true + frame = createFrame("Unfocusable Resizable frame"); + frame.setFocusableWindowState(false); + frame.setResizable(true); + tryToResizeFrame(frame); + + //Case 3: Testing JFrame fullscreen behaviour only on Mac OS + if (System.getProperty("os.name").toLowerCase().startsWith("mac")) { + SwingUtilities.invokeAndWait(new Runnable() { + + Override + public void run() { + jframe = createJFrame("Unfocusable Resizable JFrame"); + jframe.setFocusableWindowState(false); + jframe.setResizable(true); + Object prop1 = jframe.getRootPane().getClientProperty("apple.awt.fullscreenable"); + jframe.setVisible(false); + jframe.setVisible(true); + Object prop2 = jframe.getRootPane().getClientProperty("apple.awt.fullscreenable"); + + if((prop1 != null && prop2 != null) && (!prop1.equals(prop2))) { + jframe.dispose(); + cleanup(); + throw new RuntimeException("Non-focusable resizable JFrame is fullscreenable!!"); + } + } + }); + } + + cleanup(); + } + + private static JFrame createJFrame(String title) { + JFrame jframe = new JFrame(title); + jframe.setMaximizedBounds(new Rectangle(0, 0, 300, 300)); + jframe.setSize(200, 200); + jframe.setVisible(true); + jframe.setExtendedState(Frame.MAXIMIZED_BOTH); + + return jframe; + } + + private static Frame createFrame(String title) { + Frame frame = new Frame(title); frame.setMaximizedBounds(new Rectangle(0, 0, 300, 300)); frame.setSize(200, 200); frame.setVisible(true); frame.setExtendedState(Frame.MAXIMIZED_BOTH); - frame.setFocusableWindowState(false); + return frame; + } + + private static void tryToResizeFrame(Frame frame) { try { robot = new Robot(); } catch (AWTException e) { @@ -89,16 +144,16 @@ public class UnfocusableMaximizedFrameResizablity { cleanup(); throw new RuntimeException("The maximized unfocusable frame can be resized."); } - cleanup(); + + frame.dispose(); } private static void cleanup() { - frame.dispose(); isProgInterruption = true; mainThread.interrupt(); } - public static void main(String args[]) throws InterruptedException { + public static void main(String args[]) throws Exception { mainThread = Thread.currentThread(); From 1f09843a0dbc239804acd75c6a996cf3e2fa5d4e Mon Sep 17 00:00:00 2001 From: Jesper Wilhelmsson Date: Thu, 12 Jul 2018 13:40:20 +0200 Subject: [PATCH 07/32] Added tag jdk-11+22 for changeset 9937ef7499dc --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index aab977f2b05..cf8858e7840 100644 --- a/.hgtags +++ b/.hgtags @@ -495,3 +495,4 @@ fb8b3f4672774e15654958295558a1af1b576919 jdk-11+19 36ca515343e00b021dcfc902e986d26ec994a2e5 jdk-11+19 9816d7cc655e53ba081f938b656e31971b8f097a jdk-11+20 14708e1acdc3974f4539027cbbcfa6d69f83cf51 jdk-11+21 +9937ef7499dcd7673714517fd5e450410c14ba4e jdk-11+22 From 03d9e25265bef4fffd5e1bfdc0f0924b46350647 Mon Sep 17 00:00:00 2001 From: Krishna Addepalli Date: Thu, 12 Jul 2018 17:34:36 +0530 Subject: [PATCH 08/32] 8206238: Aspect ratio is not maintained when Image is scaled in JEditorPane Reviewed-by: prr, sveerabhadra --- .../javax/swing/text/html/ImageView.java | 52 +++++++++++-- .../JEditorPane/8195095/ImageViewTest.java | 78 ++++++++++++++----- 2 files changed, 103 insertions(+), 27 deletions(-) diff --git a/src/java.desktop/share/classes/javax/swing/text/html/ImageView.java b/src/java.desktop/share/classes/javax/swing/text/html/ImageView.java index 45bbe42f395..eab1a7e1507 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/ImageView.java +++ b/src/java.desktop/share/classes/javax/swing/text/html/ImageView.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -24,13 +24,41 @@ */ package javax.swing.text.html; -import java.awt.*; +import java.awt.Rectangle; +import java.awt.Image; +import java.awt.Container; +import java.awt.Color; +import java.awt.Shape; +import java.awt.Graphics; +import java.awt.Toolkit; + import java.awt.image.ImageObserver; -import java.net.*; +import java.net.URL; +import java.net.MalformedURLException; + import java.util.Dictionary; -import javax.swing.*; -import javax.swing.text.*; -import javax.swing.event.*; + +import javax.swing.GrayFilter; +import javax.swing.ImageIcon; +import javax.swing.Icon; +import javax.swing.UIManager; +import javax.swing.SwingUtilities; + +import javax.swing.text.JTextComponent; +import javax.swing.text.StyledDocument; +import javax.swing.text.View; +import javax.swing.text.AttributeSet; +import javax.swing.text.Element; +import javax.swing.text.ViewFactory; +import javax.swing.text.Position; +import javax.swing.text.Segment; +import javax.swing.text.Highlighter; +import javax.swing.text.LayeredHighlighter; +import javax.swing.text.AbstractDocument; +import javax.swing.text.Document; +import javax.swing.text.BadLocationException; + +import javax.swing.event.DocumentEvent; /** * View of an Image, intended to support the HTML <IMG> tag. @@ -744,12 +772,22 @@ public class ImageView extends View { // anything that might cause the image to be loaded, and thus the // ImageHandler to be called. newWidth = getIntAttr(HTML.Attribute.WIDTH, -1); + newHeight = getIntAttr(HTML.Attribute.HEIGHT, -1); + if (newWidth > 0) { newState |= WIDTH_FLAG; + if (newHeight <= 0) { + newHeight = newWidth; + newState |= HEIGHT_FLAG; + } } - newHeight = getIntAttr(HTML.Attribute.HEIGHT, -1); + if (newHeight > 0) { newState |= HEIGHT_FLAG; + if (newWidth <= 0) { + newWidth = newHeight; + newState |= WIDTH_FLAG; + } } if (newWidth <= 0) { diff --git a/test/jdk/javax/swing/JEditorPane/8195095/ImageViewTest.java b/test/jdk/javax/swing/JEditorPane/8195095/ImageViewTest.java index 7c98a882a83..4a23e8995b1 100644 --- a/test/jdk/javax/swing/JEditorPane/8195095/ImageViewTest.java +++ b/test/jdk/javax/swing/JEditorPane/8195095/ImageViewTest.java @@ -24,7 +24,7 @@ /** * @test * @key headful - * @bug 8195095 + * @bug 8195095 8206238 * @summary Tests if Images are scaled correctly in JEditorPane. * @run main ImageViewTest */ @@ -40,22 +40,16 @@ import javax.swing.WindowConstants; public class ImageViewTest { - private static final int WIDTH = 200; - private static final int HEIGHT = 200; private static JFrame f; - private static JEditorPane editorPane1; - private static JEditorPane editorPane2; - private static JEditorPane editorPane3; - private static JEditorPane editorPane4; - - private static void test(Robot r, JEditorPane editorPane) throws Exception { + private static void test(Robot r, JEditorPane editorPane, + final int WIDTH, final int HEIGHT ) throws Exception { SwingUtilities.invokeAndWait(() -> { f = new JFrame(); editorPane.setEditable(false); f.add(editorPane); - f.setSize(220,240); + f.setSize(WIDTH + 20, HEIGHT + 40); f.setLocationRelativeTo(null); f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); @@ -109,34 +103,78 @@ public class ImageViewTest { Robot r = new Robot(); + final JEditorPane[] editorPanes = new JEditorPane[11]; + SwingUtilities.invokeAndWait(() -> { - editorPane1 = new JEditorPane("text/html", + editorPanes[0] = new JEditorPane("text/html", " Date: Thu, 12 Jul 2018 07:14:30 -0700 Subject: [PATCH 09/32] 8206903: Unable to build Client VM with JVMCI Reviewed-by: erikj, kvn --- make/autoconf/hotspot.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/autoconf/hotspot.m4 b/make/autoconf/hotspot.m4 index 58210c4cf89..2439cba07be 100644 --- a/make/autoconf/hotspot.m4 +++ b/make/autoconf/hotspot.m4 @@ -500,7 +500,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES], # Enable features depending on variant. JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal" - JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci" + JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES" JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES" JVM_FEATURES_minimal="compiler1 minimal serialgc $JVM_FEATURES $JVM_FEATURES_link_time_opt" JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES" From 89f13ef117ca3a4747e240608e8074a8371e5481 Mon Sep 17 00:00:00 2001 From: Ralf Schmelter Date: Thu, 12 Jul 2018 16:30:47 +0200 Subject: [PATCH 10/32] 8207001: *.obj.log files get truncated causing unreliable incremental builds on Windows Reviewed-by: erikj, tbell --- make/common/MakeBase.gmk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk index d397fe6f9c8..a2cdb1028ed 100644 --- a/make/common/MakeBase.gmk +++ b/make/common/MakeBase.gmk @@ -1015,7 +1015,7 @@ ExecuteWithLog = \ $(call LogCmdlines, Exececuting: [$(strip $2)]) \ $(call MakeDir, $(dir $(strip $1))) \ $(call WriteFile, $2, $(strip $1).cmdline) \ - ( $(strip $2) > >($(TEE) $(strip $1).log) 2> >($(TEE) $(strip $1).log >&2) || \ + ( $(RM) $(strip $1).log && $(strip $2) > >($(TEE) -a $(strip $1).log) 2> >($(TEE) -a $(strip $1).log >&2) || \ ( exitcode=$(DOLLAR)? && \ $(CP) $(strip $1).log $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(OUTPUTDIR)/%,%,$(strip $1))).log && \ $(CP) $(strip $1).cmdline $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(OUTPUTDIR)/%,%,$(strip $1))).cmdline && \ From 8a9b0134a8d1e958114ae06e366fcef923d8b62d Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 11 Jul 2018 16:11:10 +0200 Subject: [PATCH 11/32] 8206977: Minor improvements of runtime code Reviewed-by: coleenp, lfoltan --- src/hotspot/cpu/x86/vm_version_ext_x86.cpp | 9 +++---- src/hotspot/cpu/x86/vm_version_ext_x86.hpp | 1 + src/hotspot/os/linux/os_linux.cpp | 16 +++++++----- src/hotspot/os/linux/perfMemory_linux.cpp | 5 ++-- src/hotspot/share/classfile/moduleEntry.cpp | 3 ++- .../share/classfile/systemDictionary.cpp | 22 ++++++++-------- .../classfile/systemDictionaryShared.cpp | 5 ++-- src/hotspot/share/classfile/verifier.cpp | 3 ++- src/hotspot/share/logging/logOutput.cpp | 7 ++--- src/hotspot/share/memory/filemap.cpp | 4 ++- src/hotspot/share/memory/metaspace.cpp | 4 ++- src/hotspot/share/memory/virtualspace.cpp | 26 +++++++++---------- src/hotspot/share/prims/jvmtiEnvBase.cpp | 2 +- src/hotspot/share/runtime/flags/jvmFlag.cpp | 4 +++ src/hotspot/share/services/writeableFlags.cpp | 2 +- src/hotspot/share/utilities/ostream.cpp | 3 ++- .../gtest/logging/logTestUtils.inline.hpp | 3 ++- test/hotspot/gtest/memory/test_metachunk.cpp | 4 +-- 18 files changed, 68 insertions(+), 55 deletions(-) diff --git a/src/hotspot/cpu/x86/vm_version_ext_x86.cpp b/src/hotspot/cpu/x86/vm_version_ext_x86.cpp index a5d60aebe2e..3cc775d7ec1 100644 --- a/src/hotspot/cpu/x86/vm_version_ext_x86.cpp +++ b/src/hotspot/cpu/x86/vm_version_ext_x86.cpp @@ -470,8 +470,8 @@ int VM_Version_Ext::cpu_extended_brand_string(char* const buf, size_t buf_len) { } size_t VM_Version_Ext::cpu_write_support_string(char* const buf, size_t buf_len) { - assert(buf != NULL, "buffer is NULL!"); - assert(buf_len > 0, "buffer len not enough!"); + guarantee(buf != NULL, "buffer is NULL!"); + guarantee(buf_len > 0, "buffer len not enough!"); unsigned int flag = 0; unsigned int fi = 0; @@ -481,8 +481,7 @@ size_t VM_Version_Ext::cpu_write_support_string(char* const buf, size_t buf_len) #define WRITE_TO_BUF(string) \ { \ int res = jio_snprintf(&buf[written], buf_len - written, "%s%s", prefix, string); \ - if (res < 0 || (size_t) res >= buf_len - 1) { \ - buf[buf_len-1] = '\0'; \ + if (res < 0) { \ return buf_len - 1; \ } \ written += res; \ @@ -592,7 +591,7 @@ int VM_Version_Ext::cpu_detailed_description(char* const buf, size_t buf_len) { _cpuid_info.ext_cpuid1_edx); if (outputLen < 0 || (size_t) outputLen >= buf_len - 1) { - buf[buf_len-1] = '\0'; + if (buf_len > 0) { buf[buf_len-1] = '\0'; } return OS_ERR; } diff --git a/src/hotspot/cpu/x86/vm_version_ext_x86.hpp b/src/hotspot/cpu/x86/vm_version_ext_x86.hpp index de35616b6e2..78fb001cb39 100644 --- a/src/hotspot/cpu/x86/vm_version_ext_x86.hpp +++ b/src/hotspot/cpu/x86/vm_version_ext_x86.hpp @@ -63,6 +63,7 @@ class VM_Version_Ext : public VM_Version { static bool cpu_is_em64t(void); static bool is_netburst(void); + // Returns bytes written excluding termninating null byte. static size_t cpu_write_support_string(char* const buf, size_t buf_len); static void resolve_cpu_information_details(void); static jlong max_qualified_cpu_freq_from_brand_string(void); diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index c48888e678c..bc1f3d45dc6 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -2108,7 +2108,9 @@ void os::get_summary_os_info(char* buf, size_t buflen) { // special case for debian if (file_exists("/etc/debian_version")) { strncpy(buf, "Debian ", buflen); - parse_os_info(&buf[7], buflen-7, "/etc/debian_version"); + if (buflen > 7) { + parse_os_info(&buf[7], buflen-7, "/etc/debian_version"); + } } else { strncpy(buf, "Linux", buflen); } @@ -2820,8 +2822,8 @@ int os::numa_get_group_id() { } int os::Linux::get_existing_num_nodes() { - size_t node; - size_t highest_node_number = Linux::numa_max_node(); + int node; + int highest_node_number = Linux::numa_max_node(); int num_nodes = 0; // Get the total number of nodes in the system including nodes without memory. @@ -2834,14 +2836,14 @@ int os::Linux::get_existing_num_nodes() { } size_t os::numa_get_leaf_groups(int *ids, size_t size) { - size_t highest_node_number = Linux::numa_max_node(); + int highest_node_number = Linux::numa_max_node(); size_t i = 0; - // Map all node ids in which is possible to allocate memory. Also nodes are + // Map all node ids in which it is possible to allocate memory. Also nodes are // not always consecutively available, i.e. available from 0 to the highest // node number. - for (size_t node = 0; node <= highest_node_number; node++) { - if (Linux::isnode_in_configured_nodes(node)) { + for (int node = 0; node <= highest_node_number; node++) { + if (Linux::isnode_in_configured_nodes((unsigned int)node)) { ids[i++] = node; } } diff --git a/src/hotspot/os/linux/perfMemory_linux.cpp b/src/hotspot/os/linux/perfMemory_linux.cpp index a4ebc03afe4..86e75d81510 100644 --- a/src/hotspot/os/linux/perfMemory_linux.cpp +++ b/src/hotspot/os/linux/perfMemory_linux.cpp @@ -534,15 +534,14 @@ static char* get_user_name_slow(int vmid, int nspid, TRAPS) { // directory search char* oldest_user = NULL; time_t oldest_ctime = 0; - char buffer[TMP_BUFFER_LEN]; + char buffer[MAXPATHLEN + 1]; int searchpid; char* tmpdirname = (char *)os::get_temp_directory(); assert(strlen(tmpdirname) == 4, "No longer using /tmp - update buffer size"); if (nspid == -1) { searchpid = vmid; - } - else { + } else { jio_snprintf(buffer, MAXPATHLEN, "/proc/%d/root%s", vmid, tmpdirname); tmpdirname = buffer; searchpid = nspid; diff --git a/src/hotspot/share/classfile/moduleEntry.cpp b/src/hotspot/share/classfile/moduleEntry.cpp index a29783de7b8..dad3016a8fa 100644 --- a/src/hotspot/share/classfile/moduleEntry.cpp +++ b/src/hotspot/share/classfile/moduleEntry.cpp @@ -387,7 +387,8 @@ ModuleEntry* ModuleEntryTable::new_entry(unsigned int hash, Handle module_handle entry->set_is_patched(); if (log_is_enabled(Trace, module, patch)) { ResourceMark rm; - log_trace(module, patch)("Marked module %s as patched from --patch-module", name->as_C_string()); + log_trace(module, patch)("Marked module %s as patched from --patch-module", + name != NULL ? name->as_C_string() : UNNAMED_MODULE); } } diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp index 7ad9601dd39..d6627d0d7ac 100644 --- a/src/hotspot/share/classfile/systemDictionary.cpp +++ b/src/hotspot/share/classfile/systemDictionary.cpp @@ -1364,18 +1364,18 @@ InstanceKlass* SystemDictionary::load_shared_class(InstanceKlass* ik, // notify a class loaded from shared object ClassLoadingService::notify_class_loaded(ik, true /* shared class */); - } - ik->set_has_passed_fingerprint_check(false); - if (UseAOT && ik->supers_have_passed_fingerprint_checks()) { - uint64_t aot_fp = AOTLoader::get_saved_fingerprint(ik); - uint64_t cds_fp = ik->get_stored_fingerprint(); - if (aot_fp != 0 && aot_fp == cds_fp) { - // This class matches with a class saved in an AOT library - ik->set_has_passed_fingerprint_check(true); - } else { - ResourceMark rm; - log_info(class, fingerprint)("%s : expected = " PTR64_FORMAT " actual = " PTR64_FORMAT, ik->external_name(), aot_fp, cds_fp); + ik->set_has_passed_fingerprint_check(false); + if (UseAOT && ik->supers_have_passed_fingerprint_checks()) { + uint64_t aot_fp = AOTLoader::get_saved_fingerprint(ik); + uint64_t cds_fp = ik->get_stored_fingerprint(); + if (aot_fp != 0 && aot_fp == cds_fp) { + // This class matches with a class saved in an AOT library + ik->set_has_passed_fingerprint_check(true); + } else { + ResourceMark rm; + log_info(class, fingerprint)("%s : expected = " PTR64_FORMAT " actual = " PTR64_FORMAT, ik->external_name(), aot_fp, cds_fp); + } } } return ik; diff --git a/src/hotspot/share/classfile/systemDictionaryShared.cpp b/src/hotspot/share/classfile/systemDictionaryShared.cpp index 2d6a29941b7..962c1da6c67 100644 --- a/src/hotspot/share/classfile/systemDictionaryShared.cpp +++ b/src/hotspot/share/classfile/systemDictionaryShared.cpp @@ -766,10 +766,11 @@ bool SystemDictionaryShared::add_verification_constraint(Klass* k, Symbol* name, SharedDictionaryEntry* entry = ((SharedDictionary*)(k->class_loader_data()->dictionary()))->find_entry_for(k); ResourceMark rm; // Lambda classes are not archived and will be regenerated at runtime. - if (entry == NULL && strstr(k->name()->as_C_string(), "Lambda$") != NULL) { + if (entry == NULL) { + guarantee(strstr(k->name()->as_C_string(), "Lambda$") != NULL, + "class should be in dictionary before being verified"); return true; } - assert(entry != NULL, "class should be in dictionary before being verified"); entry->add_verification_constraint(name, from_name, from_field_is_protected, from_is_array, from_is_object); if (entry->is_builtin()) { diff --git a/src/hotspot/share/classfile/verifier.cpp b/src/hotspot/share/classfile/verifier.cpp index 2e76c0ecd95..3efecb0e184 100644 --- a/src/hotspot/share/classfile/verifier.cpp +++ b/src/hotspot/share/classfile/verifier.cpp @@ -719,7 +719,8 @@ void ClassVerifier::verify_method(const methodHandle& m, TRAPS) { ResourceMark rm(THREAD); LogStream ls(lt); current_frame.print_on(&ls); - lt.print("offset = %d, opcode = %s", bci, Bytecodes::name(opcode)); + lt.print("offset = %d, opcode = %s", bci, + opcode == Bytecodes::_illegal ? "illegal" : Bytecodes::name(opcode)); } // Make sure wide instruction is in correct format diff --git a/src/hotspot/share/logging/logOutput.cpp b/src/hotspot/share/logging/logOutput.cpp index d3e9670ea7d..a857f425477 100644 --- a/src/hotspot/share/logging/logOutput.cpp +++ b/src/hotspot/share/logging/logOutput.cpp @@ -262,7 +262,9 @@ void LogOutput::update_config_string(const size_t on_level[LogLevel::Count]) { while (n_deviates > 0) { size_t prev_deviates = n_deviates; int max_score = 0; - const LogSelection* best_selection = NULL; + + guarantee(n_selections > 0, "Cannot find maximal selection."); + const LogSelection* best_selection = &selections[0]; for (size_t i = 0; i < n_selections; i++) { // Give the selection a score based on how many deviating tag sets it selects (with correct level) @@ -287,13 +289,12 @@ void LogOutput::update_config_string(const size_t on_level[LogLevel::Count]) { // Pick the selection with the best score, or in the case of a tie, the one with fewest tags if (score > max_score || - (score == max_score && best_selection != NULL && selections[i].ntags() < best_selection->ntags())) { + (score == max_score && selections[i].ntags() < best_selection->ntags())) { max_score = score; best_selection = &selections[i]; } } - assert(best_selection != NULL, "must always find a maximal selection"); add_to_config_string(*best_selection); // Remove all deviates that this selection covered diff --git a/src/hotspot/share/memory/filemap.cpp b/src/hotspot/share/memory/filemap.cpp index 991033613a9..181c2d05568 100644 --- a/src/hotspot/share/memory/filemap.cpp +++ b/src/hotspot/share/memory/filemap.cpp @@ -631,7 +631,9 @@ void FileMapInfo::write_region(int region, char* base, size_t size, si->_read_only = read_only; si->_allow_exec = allow_exec; si->_crc = ClassLoader::crc32(0, base, (jint)size); - write_bytes_aligned(base, (int)size); + if (base != NULL) { + write_bytes_aligned(base, (int)size); + } } // Write out the given archive heap memory regions. GC code combines multiple diff --git a/src/hotspot/share/memory/metaspace.cpp b/src/hotspot/share/memory/metaspace.cpp index 40ff2c7091c..de2a7afc692 100644 --- a/src/hotspot/share/memory/metaspace.cpp +++ b/src/hotspot/share/memory/metaspace.cpp @@ -1260,7 +1260,9 @@ MetaWord* Metaspace::allocate(ClassLoaderData* loader_data, size_t word_size, tty->print_cr("Please increase MaxMetaspaceSize (currently " SIZE_FORMAT " bytes).", MaxMetaspaceSize); vm_exit(1); } - report_metadata_oome(loader_data, word_size, type, mdtype, CHECK_NULL); + report_metadata_oome(loader_data, word_size, type, mdtype, THREAD); + assert(HAS_PENDING_EXCEPTION, "sanity"); + return NULL; } // Zero initialize. diff --git a/src/hotspot/share/memory/virtualspace.cpp b/src/hotspot/share/memory/virtualspace.cpp index d5764d351ad..590704bdcc6 100644 --- a/src/hotspot/share/memory/virtualspace.cpp +++ b/src/hotspot/share/memory/virtualspace.cpp @@ -70,6 +70,18 @@ ReservedSpace::ReservedSpace(size_t size, size_t alignment, initialize(size, alignment, large, NULL, executable); } +ReservedSpace::ReservedSpace(char* base, size_t size, size_t alignment, + bool special, bool executable) : _fd_for_heap(-1) { + assert((size % os::vm_allocation_granularity()) == 0, + "size not allocation aligned"); + _base = base; + _size = size; + _alignment = alignment; + _noaccess_prefix = 0; + _special = special; + _executable = executable; +} + // Helper method static void unmap_or_release_memory(char* base, size_t size, bool is_file_mapped) { if (is_file_mapped) { @@ -218,20 +230,6 @@ void ReservedSpace::initialize(size_t size, size_t alignment, bool large, } } - -ReservedSpace::ReservedSpace(char* base, size_t size, size_t alignment, - bool special, bool executable) { - assert((size % os::vm_allocation_granularity()) == 0, - "size not allocation aligned"); - _base = base; - _size = size; - _alignment = alignment; - _noaccess_prefix = 0; - _special = special; - _executable = executable; -} - - ReservedSpace ReservedSpace::first_part(size_t partition_size, size_t alignment, bool split, bool realloc) { assert(partition_size <= size(), "partition failed"); diff --git a/src/hotspot/share/prims/jvmtiEnvBase.cpp b/src/hotspot/share/prims/jvmtiEnvBase.cpp index 75c71b02645..8002cbd040c 100644 --- a/src/hotspot/share/prims/jvmtiEnvBase.cpp +++ b/src/hotspot/share/prims/jvmtiEnvBase.cpp @@ -1219,7 +1219,7 @@ VM_GetMultipleStackTraces::fill_frames(jthread jt, JavaThread *thr, oop thread_o } infop->state = state; - if (thr != NULL || (state & JVMTI_THREAD_STATE_ALIVE) != 0) { + if (thr != NULL && (state & JVMTI_THREAD_STATE_ALIVE) != 0) { infop->frame_buffer = NEW_RESOURCE_ARRAY(jvmtiFrameInfo, max_frame_count()); env()->get_stack_trace(thr, 0, max_frame_count(), infop->frame_buffer, &(infop->frame_count)); diff --git a/src/hotspot/share/runtime/flags/jvmFlag.cpp b/src/hotspot/share/runtime/flags/jvmFlag.cpp index ae12ef34e5e..841a876ecb9 100644 --- a/src/hotspot/share/runtime/flags/jvmFlag.cpp +++ b/src/hotspot/share/runtime/flags/jvmFlag.cpp @@ -939,6 +939,10 @@ JVMFlag* JVMFlag::fuzzy_match(const char* name, size_t length, bool allow_locked } } + if (match == NULL) { + return NULL; + } + if (!(match->is_unlocked() || match->is_unlocker())) { if (!allow_locked) { return NULL; diff --git a/src/hotspot/share/services/writeableFlags.cpp b/src/hotspot/share/services/writeableFlags.cpp index fee4e68b51f..780df4c5884 100644 --- a/src/hotspot/share/services/writeableFlags.cpp +++ b/src/hotspot/share/services/writeableFlags.cpp @@ -79,7 +79,7 @@ static void print_flag_error_message_if_needed(JVMFlag::Error error, const char* case JVMFlag::NON_WRITABLE: buffer_concat(buffer, "flag is not writeable."); break; case JVMFlag::OUT_OF_BOUNDS: - print_flag_error_message_bounds(name, buffer); break; + if (name != NULL) { print_flag_error_message_bounds(name, buffer); } break; case JVMFlag::VIOLATES_CONSTRAINT: buffer_concat(buffer, "value violates its flag's constraint."); break; case JVMFlag::INVALID_FLAG: diff --git a/src/hotspot/share/utilities/ostream.cpp b/src/hotspot/share/utilities/ostream.cpp index 5364c7407c4..ed9b43cf82e 100644 --- a/src/hotspot/share/utilities/ostream.cpp +++ b/src/hotspot/share/utilities/ostream.cpp @@ -531,7 +531,8 @@ void fileStream::write(const char* s, size_t len) { long fileStream::fileSize() { long size = -1; if (_file != NULL) { - long pos = ::ftell(_file); + long pos = ::ftell(_file); + if (pos < 0) return pos; if (::fseek(_file, 0, SEEK_END) == 0) { size = ::ftell(_file); } diff --git a/test/hotspot/gtest/logging/logTestUtils.inline.hpp b/test/hotspot/gtest/logging/logTestUtils.inline.hpp index bc9d37af0c8..5e97882b975 100644 --- a/test/hotspot/gtest/logging/logTestUtils.inline.hpp +++ b/test/hotspot/gtest/logging/logTestUtils.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -95,6 +95,7 @@ static inline char* read_line(FILE* fp) { int buflen = 512; char* buf = NEW_RESOURCE_ARRAY(char, buflen); long pos = ftell(fp); + if (pos < 0) return NULL; char* ret = fgets(buf, buflen, fp); while (ret != NULL && buf[strlen(buf) - 1] != '\n' && !feof(fp)) { diff --git a/test/hotspot/gtest/memory/test_metachunk.cpp b/test/hotspot/gtest/memory/test_metachunk.cpp index 1a00aa510fa..49dbd8cd6af 100644 --- a/test/hotspot/gtest/memory/test_metachunk.cpp +++ b/test/hotspot/gtest/memory/test_metachunk.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -60,7 +60,7 @@ TEST(Metachunk, basic) { // Check sizes EXPECT_EQ(metachunk->size(), metachunk->word_size()); EXPECT_EQ(pointer_delta(metachunk->end(), metachunk->bottom(), - sizeof (MetaWord*)), + sizeof (MetaWord)), metachunk->word_size()); // Check usage From d80868459234e77035adf70440eceafa3e370f75 Mon Sep 17 00:00:00 2001 From: Paul Sandoz Date: Wed, 11 Jul 2018 15:35:47 -0700 Subject: [PATCH 12/32] 8207027: Lookup.accessClass fails for an array type in the same package when assertions are enabled Reviewed-by: redestad, mchung --- .../share/classes/sun/invoke/util/VerifyAccess.java | 1 - .../java/lang/invoke/t8150782/TestAccessClass.java | 11 +++++++++-- test/jdk/java/lang/invoke/t8150782/TestFindClass.java | 11 +++++++++-- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java b/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java index 7bbbee49857..23a28be1ccd 100644 --- a/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java +++ b/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java @@ -333,7 +333,6 @@ public class VerifyAccess { * @return whether they are in the same package */ public static boolean isSamePackage(Class class1, Class class2) { - assert(!class1.isArray() && !class2.isArray()); if (class1 == class2) return true; if (class1.getClassLoader() != class2.getClassLoader()) diff --git a/test/jdk/java/lang/invoke/t8150782/TestAccessClass.java b/test/jdk/java/lang/invoke/t8150782/TestAccessClass.java index 5acf3f3bee0..c3e01c922cb 100644 --- a/test/jdk/java/lang/invoke/t8150782/TestAccessClass.java +++ b/test/jdk/java/lang/invoke/t8150782/TestAccessClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -24,6 +24,7 @@ */ /* @test + * @bug 8150782 8207027 * @compile TestAccessClass.java TestCls.java * @run testng/othervm -ea -esa test.java.lang.invoke.t8150782.TestAccessClass */ @@ -54,11 +55,17 @@ public class TestAccessClass { } @Test - public void returnsSameClass() throws IllegalAccessException, ClassNotFoundException { + public void returnsSameClassInSamePackage() throws IllegalAccessException, ClassNotFoundException { Class aClass = lookup().accessClass(Class1.class); assertEquals(Class1.class, aClass); } + @Test + public void returnsSameArrayClassInSamePackage() throws IllegalAccessException, ClassNotFoundException { + Class aClass = lookup().accessClass(Class1[].class); + assertEquals(Class1[].class, aClass); + } + @DataProvider Object[][] illegalAccessAccess() { return new Object[][] { diff --git a/test/jdk/java/lang/invoke/t8150782/TestFindClass.java b/test/jdk/java/lang/invoke/t8150782/TestFindClass.java index b49118c2b16..afd16dfcd64 100644 --- a/test/jdk/java/lang/invoke/t8150782/TestFindClass.java +++ b/test/jdk/java/lang/invoke/t8150782/TestFindClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -24,6 +24,7 @@ */ /* @test + * @bug 8150782 8207027 * @compile TestFindClass.java TestCls.java * @run testng/othervm -ea -esa test.java.lang.invoke.t8150782.TestFindClass */ @@ -56,11 +57,17 @@ public class TestFindClass { } @Test - public void returnsRequestedClass() throws IllegalAccessException, ClassNotFoundException { + public void returnsRequestedClassInSamePackage() throws IllegalAccessException, ClassNotFoundException { Class aClass = lookup().findClass(PACKAGE_PREFIX + "TestFindClass$Class1"); assertEquals(Class1.class, aClass); } + @Test + public void returnsRequestedArrayClassInSamePackage() throws IllegalAccessException, ClassNotFoundException { + Class aClass = lookup().findClass("[L" + PACKAGE_PREFIX + "TestFindClass$Class1;"); + assertEquals(Class1[].class, aClass); + } + @Test(expectedExceptions = {ClassNotFoundException.class}) public void classNotFoundExceptionTest() throws IllegalAccessException, ClassNotFoundException { lookup().findClass(PACKAGE_PREFIX + "TestFindClass$NonExistent"); From 0df02a4cb8ab4967044f4613523a3a398cb0de81 Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Thu, 12 Jul 2018 11:24:10 -0700 Subject: [PATCH 13/32] 8207152: Placeholder for Japanese new era should be two characters Reviewed-by: rriggs --- .../share/classes/sun/text/resources/ext/FormatData_ja.java | 2 +- .../sun/text/resources/ext/JavaTimeSupplementary_ja.java | 2 +- test/jdk/java/util/Calendar/JapaneseEraNameTest.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_ja.java b/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_ja.java index e169b3b7a6a..1d25c34fe1b 100644 --- a/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_ja.java +++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_ja.java @@ -91,7 +91,7 @@ public class FormatData_ja extends ParallelListResourceBundle { "\u5927\u6b63", // Taisho "\u662d\u548c", // Showa "\u5e73\u6210", // Heisei - "\u65b0\u5143\u53f7", // NewEra + "\u5143\u53f7", // NewEra }; final String[] rocEras = { "\u6c11\u56fd\u524d", diff --git a/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_ja.java b/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_ja.java index 84e0e1f3143..97ce4d222ad 100644 --- a/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_ja.java +++ b/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_ja.java @@ -154,7 +154,7 @@ public class JavaTimeSupplementary_ja extends OpenListResourceBundle { "\u5927\u6b63", "\u662d\u548c", "\u5e73\u6210", - "\u65b0\u5143\u53f7", // NewEra + "\u5143\u53f7", // NewEra }; final String[] sharedJavaTimeShortEras = { diff --git a/test/jdk/java/util/Calendar/JapaneseEraNameTest.java b/test/jdk/java/util/Calendar/JapaneseEraNameTest.java index ce643106f80..a11c77c6cff 100644 --- a/test/jdk/java/util/Calendar/JapaneseEraNameTest.java +++ b/test/jdk/java/util/Calendar/JapaneseEraNameTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8202088 + * @bug 8202088 8207152 * @summary Test the localized Japanese new era name (May 1st. 2019-) * is retrieved no matter CLDR provider contains the name or not. * @modules jdk.localedata @@ -51,7 +51,7 @@ public class JapaneseEraNameTest { Object[][] names() { return new Object[][] { // type, locale, name - { LONG, JAPAN, "\u65b0\u5143\u53f7" }, // NewEra + { LONG, JAPAN, "\u5143\u53f7" }, // NewEra { LONG, US, "NewEra" }, { SHORT, JAPAN, "N" }, { SHORT, US, "N" }, From dbb21a2a92da3b978504ad330c546acae7625be3 Mon Sep 17 00:00:00 2001 From: Vladimir Kozlov Date: Thu, 12 Jul 2018 11:57:06 -0700 Subject: [PATCH 14/32] 8206953: compiler/profiling/TestTypeProfiling.java fails when JVMCI build disabled Restore original behavior when C2 is used Reviewed-by: thartmann, mdoerr, dnsimon, gdub --- src/hotspot/share/runtime/deoptimization.cpp | 2 +- .../compiler/profiling/TestTypeProfiling.java | 15 ++++----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/hotspot/share/runtime/deoptimization.cpp b/src/hotspot/share/runtime/deoptimization.cpp index 256a07a478f..e224ee9a938 100644 --- a/src/hotspot/share/runtime/deoptimization.cpp +++ b/src/hotspot/share/runtime/deoptimization.cpp @@ -2044,7 +2044,7 @@ Deoptimization::update_method_data_from_interpreter(MethodData* trap_mdo, int tr bool ignore_maybe_prior_recompile; assert(!reason_is_speculate(reason), "reason speculate only used by compiler"); // JVMCI uses the total counts to determine if deoptimizations are happening too frequently -> do not adjust total counts - bool update_total_counts = JVMCI_ONLY(false) NOT_JVMCI(true); + bool update_total_counts = true JVMCI_ONLY( && !UseJVMCICompiler); query_update_method_data(trap_mdo, trap_bci, (DeoptReason)reason, update_total_counts, diff --git a/test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java b/test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java index 5d41c83d0fa..4eae4a7c24f 100644 --- a/test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java +++ b/test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java @@ -117,22 +117,15 @@ public class TestTypeProfiling { } // should deoptimize for speculative type check + // Intepreter will also add actual type check trap information into MDO + // when it throw ClassCastException if (!deoptimize(method, src_obj)) { throw new RuntimeException(method.getName() + " is not deoptimized"); } // compile again - WHITE_BOX.enqueueMethodForCompilation(method, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); - if (!WHITE_BOX.isMethodCompiled(method)) { - throw new RuntimeException(method.getName() + " is not recompiled"); - } - - // should deoptimize for actual type check - if (!deoptimize(method, src_obj)) { - throw new RuntimeException(method.getName() + " is not deoptimized (should deoptimize for actual type check)"); - } - - // compile once again + // c2 will generate throw instead of uncommon trap because + // actual type check trap information is present in MDO WHITE_BOX.enqueueMethodForCompilation(method, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); if (!WHITE_BOX.isMethodCompiled(method)) { throw new RuntimeException(method.getName() + " is not recompiled"); From 1292187b28e233aba6c33ca65b14d99741998128 Mon Sep 17 00:00:00 2001 From: Jean Christophe Beyler Date: Thu, 12 Jul 2018 12:00:52 -0700 Subject: [PATCH 15/32] 8206960: HeapMonitor tests fail with Graal Remove checking lines and disable VMEventsTest when using Graal Reviewed-by: amenkov, sspitsyn --- .../HeapMonitor/MyPackage/HeapMonitor.java | 44 ++++++++++++++++--- .../MyPackage/HeapMonitorVMEventsTest.java | 2 + .../jvmti/HeapMonitor/libHeapMonitorTest.c | 44 +++++++++++-------- 3 files changed, 66 insertions(+), 24 deletions(-) diff --git a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitor.java b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitor.java index c235909f505..a7c77756269 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitor.java +++ b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitor.java @@ -23,9 +23,13 @@ package MyPackage; +import java.lang.management.ManagementFactory; import java.util.ArrayList; import java.util.List; +import com.sun.management.HotSpotDiagnosticMXBean; +import com.sun.management.VMOption; + /** API for handling the underlying heap sampling monitoring system. */ public class HeapMonitor { private static int[][] arrays; @@ -56,7 +60,7 @@ public class HeapMonitor { int sum = 0; List frames = new ArrayList(); allocate(frames); - frames.add(new Frame("allocate", "()Ljava/util/List;", "HeapMonitor.java", 58)); + frames.add(new Frame("allocate", "()Ljava/util/List;", "HeapMonitor.java", 62)); return frames; } @@ -65,8 +69,8 @@ public class HeapMonitor { for (int j = 0; j < allocationIterations; j++) { sum += actuallyAllocate(); } - frames.add(new Frame("actuallyAllocate", "()I", "HeapMonitor.java", 93)); - frames.add(new Frame("allocate", "(Ljava/util/List;)V", "HeapMonitor.java", 66)); + frames.add(new Frame("actuallyAllocate", "()I", "HeapMonitor.java", 97)); + frames.add(new Frame("allocate", "(Ljava/util/List;)V", "HeapMonitor.java", 70)); } public static List repeatAllocate(int max) { @@ -74,7 +78,7 @@ public class HeapMonitor { for (int i = 0; i < max; i++) { frames = allocate(); } - frames.add(new Frame("repeatAllocate", "(I)Ljava/util/List;", "HeapMonitor.java", 75)); + frames.add(new Frame("repeatAllocate", "(I)Ljava/util/List;", "HeapMonitor.java", 79)); return frames; } @@ -152,14 +156,42 @@ public class HeapMonitor { } public native static int sampledEvents(); - public native static boolean obtainedEvents(Frame[] frames); - public native static boolean garbageContains(Frame[] frames); + public native static boolean obtainedEvents(Frame[] frames, boolean checkLines); + public native static boolean garbageContains(Frame[] frames, boolean checkLines); public native static boolean eventStorageIsEmpty(); public native static void resetEventStorage(); public native static int getEventStorageElementCount(); public native static void forceGarbageCollection(); public native static boolean enableVMEvents(); + private static boolean getCheckLines() { + boolean checkLines = true; + + // Do not check lines for Graal since it is not always "precise" with BCIs at uncommon traps. + try { + HotSpotDiagnosticMXBean bean = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class); + + VMOption enableJVMCI = bean.getVMOption("EnableJVMCI"); + VMOption useJVMCICompiler = bean.getVMOption("UseJVMCICompiler"); + String compiler = System.getProperty("jvmci.Compiler"); + + checkLines = !(enableJVMCI.getValue().equals("true") + && useJVMCICompiler.getValue().equals("true") && compiler.equals("graal")); + } catch (Exception e) { + // NOP. + } + + return checkLines; + } + + public static boolean obtainedEvents(Frame[] frames) { + return obtainedEvents(frames, getCheckLines()); + } + + public static boolean garbageContains(Frame[] frames) { + return garbageContains(frames, getCheckLines()); + } + public static boolean statsHaveExpectedNumberSamples(int expected, int acceptedErrorPercentage) { double actual = getEventStorageElementCount(); double diffPercentage = Math.abs(actual - expected) / expected; diff --git a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorVMEventsTest.java b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorVMEventsTest.java index e8b42e6a944..18f2018d581 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorVMEventsTest.java +++ b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorVMEventsTest.java @@ -26,11 +26,13 @@ package MyPackage; import java.util.ArrayList; import java.util.List; +// Graal is not tested here due to Graal not supporting DisableIntrinsic. /** * @test * @summary Verifies that when the VM event is sent, sampled events are also collected. * @build Frame HeapMonitor * @compile HeapMonitorVMEventsTest.java + * @requires !vm.graal.enabled * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions * -XX:DisableIntrinsic=_clone * -agentlib:HeapMonitorTest MyPackage.HeapMonitorVMEventsTest diff --git a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.c b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.c index a4d6271ac79..0ff03ffed65 100644 --- a/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.c +++ b/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.c @@ -208,6 +208,7 @@ static jboolean check_sample_content(JNIEnv* env, ObjectTrace* trace, ExpectedContentFrame *expected, size_t expected_count, + jboolean check_lines, int print_out_comparisons) { jvmtiFrameInfo* frames; size_t i; @@ -224,6 +225,7 @@ static jboolean check_sample_content(JNIEnv* env, char *name = NULL, *signature = NULL, *file_name = NULL; jclass declaring_class; int line_number; + jboolean differ; jvmtiError err; if (bci < 0 && expected[i].line_number != -1) { @@ -258,23 +260,21 @@ static jboolean check_sample_content(JNIEnv* env, return FALSE; } + differ = (strcmp(name, expected[i].name) || + strcmp(signature, expected[i].signature) || + strcmp(file_name, expected[i].file_name) || + (check_lines && line_number != expected[i].line_number)); + if (print_out_comparisons) { - fprintf(stderr, "\tComparing:\n"); + fprintf(stderr, "\tComparing: (check_lines: %d)\n", check_lines); fprintf(stderr, "\t\tNames: %s and %s\n", name, expected[i].name); fprintf(stderr, "\t\tSignatures: %s and %s\n", signature, expected[i].signature); fprintf(stderr, "\t\tFile name: %s and %s\n", file_name, expected[i].file_name); fprintf(stderr, "\t\tLines: %d and %d\n", line_number, expected[i].line_number); - fprintf(stderr, "\t\tResult is %d\n", - (strcmp(name, expected[i].name) || - strcmp(signature, expected[i].signature) || - strcmp(file_name, expected[i].file_name) || - line_number != expected[i].line_number)); + fprintf(stderr, "\t\tResult is %d\n", differ); } - if (strcmp(name, expected[i].name) || - strcmp(signature, expected[i].signature) || - strcmp(file_name, expected[i].file_name) || - line_number != expected[i].line_number) { + if (differ) { return FALSE; } } @@ -388,14 +388,15 @@ static double event_storage_get_average_rate(EventStorage* storage) { static jboolean event_storage_contains(JNIEnv* env, EventStorage* storage, ExpectedContentFrame* frames, - size_t size) { + size_t size, + jboolean check_lines) { int i; event_storage_lock(storage); fprintf(stderr, "Checking storage count %d\n", storage->live_object_count); for (i = 0; i < storage->live_object_count; i++) { ObjectTrace* trace = storage->live_objects[i]; - if (check_sample_content(env, trace, frames, size, PRINT_OUT)) { + if (check_sample_content(env, trace, frames, size, check_lines, PRINT_OUT)) { event_storage_unlock(storage); return TRUE; } @@ -407,7 +408,8 @@ static jboolean event_storage_contains(JNIEnv* env, static jboolean event_storage_garbage_contains(JNIEnv* env, EventStorage* storage, ExpectedContentFrame* frames, - size_t size) { + size_t size, + jboolean check_lines) { int i; event_storage_lock(storage); fprintf(stderr, "Checking garbage storage count %d\n", @@ -419,7 +421,7 @@ static jboolean event_storage_garbage_contains(JNIEnv* env, continue; } - if (check_sample_content(env, trace, frames, size, PRINT_OUT)) { + if (check_sample_content(env, trace, frames, size, check_lines, PRINT_OUT)) { event_storage_unlock(storage); return TRUE; } @@ -876,7 +878,9 @@ Java_MyPackage_HeapMonitor_disableSamplingEvents(JNIEnv* env, jclass cls) { } JNIEXPORT jboolean JNICALL -Java_MyPackage_HeapMonitor_obtainedEvents(JNIEnv* env, jclass cls, jobjectArray frames) { +Java_MyPackage_HeapMonitor_obtainedEvents(JNIEnv* env, jclass cls, + jobjectArray frames, + jboolean check_lines) { jboolean result; jsize size = (*env)->GetArrayLength(env, frames); ExpectedContentFrame *native_frames = malloc(size * sizeof(*native_frames)); @@ -886,14 +890,17 @@ Java_MyPackage_HeapMonitor_obtainedEvents(JNIEnv* env, jclass cls, jobjectArray } fill_native_frames(env, frames, native_frames, size); - result = event_storage_contains(env, &global_event_storage, native_frames, size); + result = event_storage_contains(env, &global_event_storage, native_frames, + size, check_lines); free(native_frames), native_frames = NULL; return result; } JNIEXPORT jboolean JNICALL -Java_MyPackage_HeapMonitor_garbageContains(JNIEnv* env, jclass cls, jobjectArray frames) { +Java_MyPackage_HeapMonitor_garbageContains(JNIEnv* env, jclass cls, + jobjectArray frames, + jboolean check_lines) { jboolean result; jsize size = (*env)->GetArrayLength(env, frames); ExpectedContentFrame *native_frames = malloc(size * sizeof(*native_frames)); @@ -903,7 +910,8 @@ Java_MyPackage_HeapMonitor_garbageContains(JNIEnv* env, jclass cls, jobjectArray } fill_native_frames(env, frames, native_frames, size); - result = event_storage_garbage_contains(env, &global_event_storage, native_frames, size); + result = event_storage_garbage_contains(env, &global_event_storage, + native_frames, size, check_lines); free(native_frames), native_frames = NULL; return result; From cc004b437e41fbc2cf8226654db1f88601bb8e7c Mon Sep 17 00:00:00 2001 From: Mikael Vidstedt Date: Thu, 12 Jul 2018 15:02:41 -0700 Subject: [PATCH 16/32] 8207210: Problem list javax/sound/sampled/Clip/AutoCloseTimeCheck.java Reviewed-by: prr --- test/jdk/ProblemList.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 0710e9318ec..02c0cae0c92 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -672,6 +672,7 @@ sun/security/pkcs11/tls/TestPremaster.java 8204203 windows- javax/sound/sampled/DirectAudio/bug6372428.java 8055097 generic-all javax/sound/sampled/Clip/bug5070081.java 8055097 generic-all javax/sound/sampled/DataLine/LongFramePosition.java 8055097 generic-all +javax/sound/sampled/Clip/AutoCloseTimeCheck.java 8207150 generic-all javax/sound/sampled/Clip/Drain/ClipDrain.java 7062792 generic-all From 47819594ed497ea2e82d9a788488f61748dc26f6 Mon Sep 17 00:00:00 2001 From: Mikael Vidstedt Date: Thu, 12 Jul 2018 17:32:37 -0700 Subject: [PATCH 17/32] 8207217: Problem list java/lang/management/ThreadMXBean/AllThreadIds.java Reviewed-by: dholmes --- test/jdk/ProblemList.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 02c0cae0c92..a81348bbc2d 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -520,6 +520,7 @@ java/lang/management/MemoryMXBean/Pending.java 8158837 generic- java/lang/management/MemoryMXBean/PendingAllGC.sh 8158837 generic-all java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java 8081652 generic-all +java/lang/management/ThreadMXBean/AllThreadIds.java 8131745 generic-all ############################################################################ From f508eb1370225fe8e54d7882bf7b775065f5fb77 Mon Sep 17 00:00:00 2001 From: Felix Yang Date: Fri, 13 Jul 2018 11:21:55 +0800 Subject: [PATCH 18/32] 8202481: RegisterDuringSelect.java fails with java.util.concurrent.ExecutionException: java.nio.channels.ClosedSelectorException 8207023: Add trace info to java/nio/channels/Selector/RegisterDuringSelect.java Reviewed-by: alanb --- .../java/nio/channels/Selector/RegisterDuringSelect.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/jdk/java/nio/channels/Selector/RegisterDuringSelect.java b/test/jdk/java/nio/channels/Selector/RegisterDuringSelect.java index bb1791b6905..ca681d6a156 100644 --- a/test/jdk/java/nio/channels/Selector/RegisterDuringSelect.java +++ b/test/jdk/java/nio/channels/Selector/RegisterDuringSelect.java @@ -28,6 +28,7 @@ */ import java.io.IOException; +import java.nio.channels.ClosedSelectorException; import java.nio.channels.Pipe; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; @@ -44,9 +45,14 @@ public class RegisterDuringSelect { @Override public Void call() throws IOException { for (;;) { - sel.select(); + try { + sel.select(); + } catch (ClosedSelectorException ignore) { + return null; + } if (sel.isOpen()) { barrier.arriveAndAwaitAdvance(); + System.out.println("selectLoop advanced ..."); } else { // closed return null; @@ -107,3 +113,4 @@ public class RegisterDuringSelect { } } + From 2e682fa3cd445f998f6085eee3e4ca1c6babf2f7 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 12 Jul 2018 16:31:28 +0200 Subject: [PATCH 19/32] 8207049: Minor improvements of compiler code Reviewed-by: kvn, mdoerr --- src/hotspot/cpu/x86/x86.ad | 3 +- src/hotspot/share/adlc/archDesc.cpp | 12 ++++--- src/hotspot/share/adlc/arena.cpp | 4 +-- src/hotspot/share/adlc/dfa.cpp | 24 +++++++------ src/hotspot/share/adlc/filebuff.cpp | 5 ++- src/hotspot/share/adlc/formssel.cpp | 14 +++++--- src/hotspot/share/adlc/main.cpp | 10 +++--- src/hotspot/share/adlc/output_c.cpp | 35 +++++++++++-------- src/hotspot/share/asm/codeBuffer.cpp | 15 ++++---- src/hotspot/share/c1/c1_IR.cpp | 4 +-- src/hotspot/share/c1/c1_LinearScan.cpp | 7 ++-- src/hotspot/share/code/codeCache.cpp | 18 +++++----- src/hotspot/share/compiler/compileLog.cpp | 12 ++++--- src/hotspot/share/compiler/disassembler.cpp | 2 +- src/hotspot/share/compiler/methodLiveness.cpp | 4 +-- src/hotspot/share/compiler/oopMap.cpp | 6 ++-- .../share/jvmci/jvmciCodeInstaller.cpp | 2 ++ src/hotspot/share/jvmci/jvmciCompilerToVM.cpp | 4 ++- src/hotspot/share/opto/arraycopynode.cpp | 3 +- src/hotspot/share/opto/bytecodeInfo.cpp | 8 ++--- src/hotspot/share/opto/callnode.cpp | 1 + src/hotspot/share/opto/compile.cpp | 4 +-- src/hotspot/share/opto/gcm.cpp | 1 + src/hotspot/share/opto/ifnode.cpp | 1 + src/hotspot/share/opto/indexSet.cpp | 6 ++-- src/hotspot/share/opto/lcm.cpp | 2 +- src/hotspot/share/opto/loopPredicate.cpp | 3 +- src/hotspot/share/opto/loopTransform.cpp | 5 +-- src/hotspot/share/opto/macro.cpp | 4 +-- src/hotspot/share/opto/memnode.cpp | 8 ++--- src/hotspot/share/opto/node.hpp | 3 +- src/hotspot/share/opto/output.cpp | 2 +- src/hotspot/share/opto/parse1.cpp | 4 +-- src/hotspot/share/opto/reg_split.cpp | 4 +-- src/hotspot/share/opto/runtime.cpp | 7 +++- src/hotspot/share/opto/type.cpp | 21 ++++++----- .../share/runtime/simpleThresholdPolicy.cpp | 5 +-- 37 files changed, 158 insertions(+), 115 deletions(-) diff --git a/src/hotspot/cpu/x86/x86.ad b/src/hotspot/cpu/x86/x86.ad index 3fd148bceda..44f0de1371e 100644 --- a/src/hotspot/cpu/x86/x86.ad +++ b/src/hotspot/cpu/x86/x86.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2011, 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 @@ -1444,6 +1444,7 @@ const bool Matcher::match_rule_supported_vector(int opcode, int vlen) { case Op_CMoveVF: if (vlen != 8) ret_value = false; + break; case Op_CMoveVD: if (vlen != 4) ret_value = false; diff --git a/src/hotspot/share/adlc/archDesc.cpp b/src/hotspot/share/adlc/archDesc.cpp index 15e4029fb4d..ba61aa4c02d 100644 --- a/src/hotspot/share/adlc/archDesc.cpp +++ b/src/hotspot/share/adlc/archDesc.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 1997, 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 @@ -543,14 +543,18 @@ void ArchDesc::buildMList(MatchNode *node, const char *rootOp, } // Identify index position among ideal operands - intptr_t index = _last_opcode; - const char *indexStr = node ? node->_opType : (char *) " "; - index = (intptr_t)_idealIndex[indexStr]; + intptr_t index = _last_opcode; + const char *indexStr = node ? node->_opType : (char *) " "; + index = (intptr_t)_idealIndex[indexStr]; if (index == 0) { fprintf(stderr, "error: operand \"%s\" not found\n", indexStr); assert(0, "fatal error"); } + if (node == NULL) { + fprintf(stderr, "error: node is NULL\n"); + assert(0, "fatal error"); + } // Build MatchLists for children // Check each child for an internal operand name, and use that name // for the parent's matchlist entry if it exists diff --git a/src/hotspot/share/adlc/arena.cpp b/src/hotspot/share/adlc/arena.cpp index d7e4fc6eb44..140f511ffe7 100644 --- a/src/hotspot/share/adlc/arena.cpp +++ b/src/hotspot/share/adlc/arena.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -43,7 +43,7 @@ void Chunk::chop() { while( k ) { Chunk *tmp = k->_next; // clear out this chunk (to detect allocation bugs) - memset(k, 0xBAADBABE, k->_len); + memset(k, 0xBE, k->_len); free(k); // Free chunk (was malloc'd) k = tmp; } diff --git a/src/hotspot/share/adlc/dfa.cpp b/src/hotspot/share/adlc/dfa.cpp index 80ef1af3602..a671a5525d1 100644 --- a/src/hotspot/share/adlc/dfa.cpp +++ b/src/hotspot/share/adlc/dfa.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -502,9 +502,11 @@ class dfa_shared_preds { case '"': // such as: #line 10 "myfile.ad"\n mypredicate return true; case '|': - if( prev != pred && *(prev-1) == '|' ) return true; + if (prev != pred && *(prev-1) == '|') return true; + break; case '&': - if( prev != pred && *(prev-1) == '&' ) return true; + if (prev != pred && *(prev-1) == '&') return true; + break; default: return false; } @@ -717,21 +719,21 @@ const char *Expr::compute_external(const Expr *c1, const Expr *c2) { // Preserve use of external name which has a zero value if( c1->_external_name != NULL ) { - sprintf( string_buffer, "%s", c1->as_string()); + sprintf(string_buffer, "%s", c1->as_string()); if( !c2->is_zero() ) { - strcat( string_buffer, "+"); - strcat( string_buffer, c2->as_string()); + strncat(string_buffer, "+", STRING_BUFFER_LENGTH); + strncat(string_buffer, c2->as_string(), STRING_BUFFER_LENGTH); } result = strdup(string_buffer); } else if( c2->_external_name != NULL ) { if( !c1->is_zero() ) { - sprintf( string_buffer, "%s", c1->as_string()); - strcat( string_buffer, " + "); + sprintf(string_buffer, "%s", c1->as_string()); + strncat(string_buffer, " + ", STRING_BUFFER_LENGTH); } else { string_buffer[0] = '\0'; } - strcat( string_buffer, c2->_external_name ); + strncat(string_buffer, c2->_external_name, STRING_BUFFER_LENGTH); result = strdup(string_buffer); } return result; @@ -741,8 +743,8 @@ const char *Expr::compute_expr(const Expr *c1, const Expr *c2) { if( !c1->is_zero() ) { sprintf( string_buffer, "%s", c1->_expr); if( !c2->is_zero() ) { - strcat( string_buffer, "+"); - strcat( string_buffer, c2->_expr); + strncat(string_buffer, "+", STRING_BUFFER_LENGTH); + strncat(string_buffer, c2->_expr, STRING_BUFFER_LENGTH); } } else if( !c2->is_zero() ) { diff --git a/src/hotspot/share/adlc/filebuff.cpp b/src/hotspot/share/adlc/filebuff.cpp index 107d5182445..b130e3e5d78 100644 --- a/src/hotspot/share/adlc/filebuff.cpp +++ b/src/hotspot/share/adlc/filebuff.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -95,8 +95,11 @@ void FileBuff::file_error(int flag, int linenum, const char *fmt, ...) va_start(args, fmt); switch (flag) { case 0: _AD._warnings += _AD.emit_msg(0, flag, linenum, fmt, args); + break; case 1: _AD._syntax_errs += _AD.emit_msg(0, flag, linenum, fmt, args); + break; case 2: _AD._semantic_errs += _AD.emit_msg(0, flag, linenum, fmt, args); + break; default: assert(0, ""); break; } va_end(args); diff --git a/src/hotspot/share/adlc/formssel.cpp b/src/hotspot/share/adlc/formssel.cpp index cb0c0798325..f2d894459b5 100644 --- a/src/hotspot/share/adlc/formssel.cpp +++ b/src/hotspot/share/adlc/formssel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -3634,7 +3634,7 @@ int MatchNode::cisc_spill_match(FormDict& globals, RegisterForm* registers, Matc && (is_load_from_memory(mRule2->_opType) == data_type) // reg vs. (load memory) && (name_left != NULL) // NOT (load) && (name_right == NULL) ) { // NOT (load memory foo) - const Form *form2_left = name_left ? globals[name_left] : NULL; + const Form *form2_left = globals[name_left]; if( form2_left && form2_left->is_cisc_mem(globals) ) { cisc_spillable = Is_cisc_spillable; operand = _name; @@ -3645,7 +3645,7 @@ int MatchNode::cisc_spill_match(FormDict& globals, RegisterForm* registers, Matc } } // Detect reg vs memory - else if( form->is_cisc_reg(globals) && form2->is_cisc_mem(globals) ) { + else if (form->is_cisc_reg(globals) && form2 != NULL && form2->is_cisc_mem(globals)) { cisc_spillable = Is_cisc_spillable; operand = _name; reg_type = _result; @@ -3710,8 +3710,12 @@ int MatchRule::matchrule_cisc_spill_match(FormDict& globals, RegisterForm* regi } // Check right operands: recursive walk to identify reg->mem operand - if( (_rChild == NULL) && (mRule2->_rChild == NULL) ) { - right_spillable = Maybe_cisc_spillable; + if (_rChild == NULL) { + if (mRule2->_rChild == NULL) { + right_spillable = Maybe_cisc_spillable; + } else { + assert(0, "_rChild should not be NULL"); + } } else { right_spillable = _rChild->cisc_spill_match(globals, registers, mRule2->_rChild, operand, reg_type); } diff --git a/src/hotspot/share/adlc/main.cpp b/src/hotspot/share/adlc/main.cpp index ab091cba40d..7a6341ee43a 100644 --- a/src/hotspot/share/adlc/main.cpp +++ b/src/hotspot/share/adlc/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -142,7 +142,7 @@ int main(int argc, char *argv[]) const char *base = strip_ext(strdup(argv[i])); char *temp = base_plus_suffix("dfa_",base); AD._DFA_file._name = base_plus_suffix(temp,".cpp"); - delete temp; + delete[] temp; temp = base_plus_suffix("ad_",base); AD._CPP_file._name = base_plus_suffix(temp,".cpp"); AD._CPP_CLONE_file._name = base_plus_suffix(temp,"_clone.cpp"); @@ -153,13 +153,13 @@ int main(int argc, char *argv[]) AD._CPP_PEEPHOLE_file._name = base_plus_suffix(temp,"_peephole.cpp"); AD._CPP_PIPELINE_file._name = base_plus_suffix(temp,"_pipeline.cpp"); AD._HPP_file._name = base_plus_suffix(temp,".hpp"); - delete temp; + delete[] temp; temp = base_plus_suffix("adGlobals_",base); AD._VM_file._name = base_plus_suffix(temp,".hpp"); - delete temp; + delete[] temp; temp = base_plus_suffix("bugs_",base); AD._bug_file._name = base_plus_suffix(temp,".out"); - delete temp; + delete[] temp; } // End of files vs options... } // End of while have command line arguments diff --git a/src/hotspot/share/adlc/output_c.cpp b/src/hotspot/share/adlc/output_c.cpp index d8906ed0bc3..dc62021b8e6 100644 --- a/src/hotspot/share/adlc/output_c.cpp +++ b/src/hotspot/share/adlc/output_c.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -1936,6 +1936,7 @@ public: _AD.syntax_err( _ins_encode._linenum, "Parameter %s not passed to enc_class %s from instruct %s.\n", rep_var, _encoding._name, _inst._ident); + assert(false, "inst_rep_var == NULL, cannot continue."); } // Check if instruction's actual parameter is a local name in the instruction @@ -1976,8 +1977,8 @@ public: } else { // Check for unimplemented functionality before hard failure - assert( strcmp(opc->_ident,"label")==0, "Unimplemented() Label"); - assert( false, "ShouldNotReachHere()"); + assert(opc != NULL && strcmp(opc->_ident, "label") == 0, "Unimplemented Label"); + assert(false, "ShouldNotReachHere()"); } } // done checking which operand this is. } else { @@ -2450,8 +2451,8 @@ private: } else { // Check for unimplemented functionality before hard failure - assert( strcmp(opc->_ident,"label")==0, "Unimplemented() Label"); - assert( false, "ShouldNotReachHere()"); + assert(opc != NULL && strcmp(opc->_ident, "label") == 0, "Unimplemented Label"); + assert(false, "ShouldNotReachHere()"); } // all done } @@ -3305,9 +3306,11 @@ void ArchDesc::defineClasses(FILE *fp) { // Output the definitions for machine node specific pipeline data _machnodes.reset(); - for ( ; (machnode = (MachNodeForm*)_machnodes.iter()) != NULL; ) { - fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %sNode::pipeline() const { return (&pipeline_class_%03d); }\n", - machnode->_ident, ((class PipeClassForm *)_pipeline->_classdict[machnode->_machnode_pipe])->_num); + if (_pipeline != NULL) { + for ( ; (machnode = (MachNodeForm*)_machnodes.iter()) != NULL; ) { + fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %sNode::pipeline() const { return (&pipeline_class_%03d); }\n", + machnode->_ident, ((class PipeClassForm *)_pipeline->_classdict[machnode->_machnode_pipe])->_num); + } } fprintf(_CPP_PIPELINE_file._fp, "\n"); @@ -3315,13 +3318,15 @@ void ArchDesc::defineClasses(FILE *fp) { // Output the definitions for instruction pipeline static data references _instructions.reset(); - for ( ; (instr = (InstructForm*)_instructions.iter()) != NULL; ) { - if (instr->_ins_pipe && _pipeline->_classlist.search(instr->_ins_pipe)) { - fprintf(_CPP_PIPELINE_file._fp, "\n"); - fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %*sNode::pipeline_class() { return (&pipeline_class_%03d); }\n", - max_ident_len, instr->_ident, ((class PipeClassForm *)_pipeline->_classdict[instr->_ins_pipe])->_num); - fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %*sNode::pipeline() const { return (&pipeline_class_%03d); }\n", - max_ident_len, instr->_ident, ((class PipeClassForm *)_pipeline->_classdict[instr->_ins_pipe])->_num); + if (_pipeline != NULL) { + for ( ; (instr = (InstructForm*)_instructions.iter()) != NULL; ) { + if (instr->_ins_pipe && _pipeline->_classlist.search(instr->_ins_pipe)) { + fprintf(_CPP_PIPELINE_file._fp, "\n"); + fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %*sNode::pipeline_class() { return (&pipeline_class_%03d); }\n", + max_ident_len, instr->_ident, ((class PipeClassForm *)_pipeline->_classdict[instr->_ins_pipe])->_num); + fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %*sNode::pipeline() const { return (&pipeline_class_%03d); }\n", + max_ident_len, instr->_ident, ((class PipeClassForm *)_pipeline->_classdict[instr->_ins_pipe])->_num); + } } } } diff --git a/src/hotspot/share/asm/codeBuffer.cpp b/src/hotspot/share/asm/codeBuffer.cpp index a2fdabb3363..70574e664b8 100644 --- a/src/hotspot/share/asm/codeBuffer.cpp +++ b/src/hotspot/share/asm/codeBuffer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -187,7 +187,7 @@ void CodeBuffer::freeze_section(CodeSection* cs) { cs->_limit = new_limit; cs->_locs_limit = new_locs_limit; cs->_frozen = true; - if (!next_cs->is_allocated() && !next_cs->is_frozen()) { + if (next_cs != NULL && !next_cs->is_allocated() && !next_cs->is_frozen()) { // Give remaining buffer space to the following section. next_cs->initialize(new_limit, old_limit - new_limit); next_cs->initialize_shared_locs(new_locs_limit, @@ -494,10 +494,13 @@ void CodeBuffer::compute_final_layout(CodeBuffer* dest) const { // Compute initial padding; assign it to the previous non-empty guy. // Cf. figure_expanded_capacities. csize_t padding = cs->align_at_start(buf_offset) - buf_offset; - if (padding != 0) { - buf_offset += padding; - assert(prev_dest_cs != NULL, "sanity"); - prev_dest_cs->_limit += padding; + if (prev_dest_cs != NULL) { + if (padding != 0) { + buf_offset += padding; + prev_dest_cs->_limit += padding; + } + } else { + guarantee(padding == 0, "In first iteration no padding should be needed."); } #ifdef ASSERT if (prev_cs != NULL && prev_cs->is_frozen() && n < (SECT_LIMIT - 1)) { diff --git a/src/hotspot/share/c1/c1_IR.cpp b/src/hotspot/share/c1/c1_IR.cpp index 69d4ec1291f..10eda7f1646 100644 --- a/src/hotspot/share/c1/c1_IR.cpp +++ b/src/hotspot/share/c1/c1_IR.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -1386,7 +1386,7 @@ void SubstitutionResolver::block_do(BlockBegin* block) { n->values_do(this); // need to remove this instruction from the instruction stream if (n->subst() != n) { - assert(last != NULL, "must have last"); + guarantee(last != NULL, "must have last"); last->set_next(n->next()); } else { last = n; diff --git a/src/hotspot/share/c1/c1_LinearScan.cpp b/src/hotspot/share/c1/c1_LinearScan.cpp index 859e6ab9204..853ee05b7bb 100644 --- a/src/hotspot/share/c1/c1_LinearScan.cpp +++ b/src/hotspot/share/c1/c1_LinearScan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2017, 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 @@ -3954,7 +3954,7 @@ void MoveResolver::resolve_mappings() { if (!processed_interval) { // no move could be processed because there is a cycle in the move list // (e.g. r1 -> r2, r2 -> r1), so one interval must be spilled to memory - assert(spill_candidate != -1, "no interval in register for spilling found"); + guarantee(spill_candidate != -1, "no interval in register for spilling found"); // create a new spill interval and assign a stack slot to it Interval* from_interval = _mapping_from.at(spill_candidate); @@ -6301,7 +6301,8 @@ void ControlFlowOptimizer::delete_unnecessary_jumps(BlockList* code) { assert(prev_branch->cond() == prev_cmp->condition(), "should be the same"); } } - assert(prev_cmp != NULL, "should have found comp instruction for branch"); + // Guarantee because it is dereferenced below. + guarantee(prev_cmp != NULL, "should have found comp instruction for branch"); if (prev_branch->block() == code->at(i + 1) && prev_branch->info() == NULL) { TRACE_LINEAR_SCAN(3, tty->print_cr("Negating conditional branch and deleting unconditional branch at end of block B%d", block->block_id())); diff --git a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp index aad185e2cab..d4c2b1e1ac9 100644 --- a/src/hotspot/share/code/codeCache.cpp +++ b/src/hotspot/share/code/codeCache.cpp @@ -1363,22 +1363,22 @@ void CodeCache::report_codemem_full(int code_blob_type, bool print) { const char *msg1 = msg1_stream.as_string(); const char *msg2 = msg2_stream.as_string(); - log_warning(codecache)(msg1); - log_warning(codecache)(msg2); - warning(msg1); - warning(msg2); + log_warning(codecache)("%s", msg1); + log_warning(codecache)("%s", msg2); + warning("%s", msg1); + warning("%s", msg2); } else { const char *msg1 = "CodeCache is full. Compiler has been disabled."; const char *msg2 = "Try increasing the code cache size using -XX:ReservedCodeCacheSize="; - log_warning(codecache)(msg1); - log_warning(codecache)(msg2); - warning(msg1); - warning(msg2); + log_warning(codecache)("%s", msg1); + log_warning(codecache)("%s", msg2); + warning("%s", msg1); + warning("%s", msg2); } ResourceMark rm; stringStream s; - // Dump code cache into a buffer before locking the tty, + // Dump code cache into a buffer before locking the tty. { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); print_summary(&s); diff --git a/src/hotspot/share/compiler/compileLog.cpp b/src/hotspot/share/compiler/compileLog.cpp index de8cbd1b080..eb52c5f5fb1 100644 --- a/src/hotspot/share/compiler/compileLog.cpp +++ b/src/hotspot/share/compiler/compileLog.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -217,14 +217,17 @@ void CompileLog::finish_log_on_error(outputStream* file, char* buf, int buflen) file->print_raw_cr("'>"); size_t nr; // number read into buf from partial log + // In case of unsuccessful completion, read returns -1. + ssize_t bytes_read; // Copy data up to the end of the last element: julong to_read = log->_file_end; while (to_read > 0) { if (to_read < (julong)buflen) nr = (size_t)to_read; else nr = buflen; - nr = read(partial_fd, buf, (int)nr); - if (nr <= 0) break; + bytes_read = read(partial_fd, buf, (int)nr); + if (bytes_read <= 0) break; + nr = bytes_read; to_read -= (julong)nr; file->write(buf, nr); } @@ -232,7 +235,8 @@ void CompileLog::finish_log_on_error(outputStream* file, char* buf, int buflen) // Copy any remaining data inside a quote: bool saw_slop = false; int end_cdata = 0; // state machine [0..2] watching for too many "]]" - while ((nr = read(partial_fd, buf, buflen-1)) > 0) { + while ((bytes_read = read(partial_fd, buf, buflen-1)) > 0) { + nr = bytes_read; buf[buflen-1] = '\0'; if (!saw_slop) { file->print_raw_cr(""); diff --git a/src/hotspot/share/compiler/disassembler.cpp b/src/hotspot/share/compiler/disassembler.cpp index 3a1b145acdb..2b56f97f44c 100644 --- a/src/hotspot/share/compiler/disassembler.cpp +++ b/src/hotspot/share/compiler/disassembler.cpp @@ -122,7 +122,7 @@ bool Disassembler::load_library() { _decode_instructions_virtual = CAST_TO_FN_PTR(Disassembler::decode_func_virtual, os::dll_lookup(_library, decode_instructions_virtual_name)); } - if (_decode_instructions_virtual == NULL) { + if (_decode_instructions_virtual == NULL && _library != NULL) { // could not spot in new version, try old version _decode_instructions = CAST_TO_FN_PTR(Disassembler::decode_func, os::dll_lookup(_library, decode_instructions_name)); diff --git a/src/hotspot/share/compiler/methodLiveness.cpp b/src/hotspot/share/compiler/methodLiveness.cpp index 8d82cc18175..240a7ef33ed 100644 --- a/src/hotspot/share/compiler/methodLiveness.cpp +++ b/src/hotspot/share/compiler/methodLiveness.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -484,7 +484,7 @@ MethodLivenessResult MethodLiveness::get_liveness_at(int entry_bci) { while (block == NULL && t > 0) { block = _block_map->at(--t); } - assert( block != NULL, "invalid bytecode index; must be instruction index" ); + guarantee(block != NULL, "invalid bytecode index; must be instruction index"); assert(bci >= block->start_bci() && bci < block->limit_bci(), "block must contain bci."); answer = block->get_liveness_at(method(), bci); diff --git a/src/hotspot/share/compiler/oopMap.cpp b/src/hotspot/share/compiler/oopMap.cpp index 5c0828b10a5..0b14b9e6b3a 100644 --- a/src/hotspot/share/compiler/oopMap.cpp +++ b/src/hotspot/share/compiler/oopMap.cpp @@ -571,14 +571,14 @@ bool OopMap::equals(const OopMap* other) const { const ImmutableOopMap* ImmutableOopMapSet::find_map_at_offset(int pc_offset) const { ImmutableOopMapPair* pairs = get_pairs(); - ImmutableOopMapPair* last = NULL; - for (int i = 0; i < _count; ++i) { + int i; + for (i = 0; i < _count; ++i) { if (pairs[i].pc_offset() >= pc_offset) { - last = &pairs[i]; break; } } + ImmutableOopMapPair* last = &pairs[i]; assert(last->pc_offset() == pc_offset, "oopmap not found"); return last->get_from(this); diff --git a/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp b/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp index 9b3210ff1cb..b5dbea5a718 100644 --- a/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp +++ b/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp @@ -236,6 +236,8 @@ int AOTOopRecorder::find_index(Metadata* h) { JVMCIKlassHandle klass(THREAD); oop result = NULL; + guarantee(h != NULL, + "If DebugInformationRecorder::describe_scope passes NULL oldCount == newCount must hold."); if (h->is_klass()) { klass = (Klass*) h; result = CompilerToVM::get_jvmci_type(klass, CATCH); diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp index 31b849429b1..0ff30157800 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp @@ -349,7 +349,9 @@ C2V_VMENTRY(jobject, getResolvedJavaType, (JNIEnv *, jobject, jobject base, jlon klass = *((Klass**) (intptr_t) (base_address + offset)); } else { THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), - err_msg("Unexpected arguments: %s " JLONG_FORMAT " %s", base_object->klass()->external_name(), offset, compressed ? "true" : "false")); + err_msg("Unexpected arguments: %s " JLONG_FORMAT " %s", + base_object != NULL ? base_object->klass()->external_name() : "null", + offset, compressed ? "true" : "false")); } assert (klass == NULL || klass->is_klass(), "invalid read"); oop result = CompilerToVM::get_jvmci_type(klass, CHECK_NULL); diff --git a/src/hotspot/share/opto/arraycopynode.cpp b/src/hotspot/share/opto/arraycopynode.cpp index 5e4828e371a..e39beffeb13 100644 --- a/src/hotspot/share/opto/arraycopynode.cpp +++ b/src/hotspot/share/opto/arraycopynode.cpp @@ -659,7 +659,8 @@ bool ArrayCopyNode::may_modify(const TypeOopPtr *t_oop, MemBarNode* mb, PhaseTra c = bs->step_over_gc_barrier(c); CallNode* call = NULL; - if (c != NULL && c->is_Region()) { + guarantee(c != NULL, "step_over_gc_barrier failed, there must be something to step to."); + if (c->is_Region()) { for (uint i = 1; i < c->req(); i++) { if (c->in(i) != NULL) { Node* n = c->in(i)->in(0); diff --git a/src/hotspot/share/opto/bytecodeInfo.cpp b/src/hotspot/share/opto/bytecodeInfo.cpp index 51128a42b32..64935b37eac 100644 --- a/src/hotspot/share/opto/bytecodeInfo.cpp +++ b/src/hotspot/share/opto/bytecodeInfo.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -520,10 +520,10 @@ void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci, caller_bci, inline_msg); if (C->print_inlining()) { C->print_inlining(callee_method, inline_level(), caller_bci, inline_msg); - if (callee_method == NULL) tty->print(" callee not monotonic or profiled"); - if (Verbose && callee_method) { + guarantee(callee_method != NULL, "would crash in post_inlining_event"); + if (Verbose) { const InlineTree *top = this; - while( top->caller_tree() != NULL ) { top = top->caller_tree(); } + while (top->caller_tree() != NULL) { top = top->caller_tree(); } //tty->print(" bcs: %d+%d invoked: %d", top->count_inline_bcs(), callee_method->code_size(), callee_method->interpreter_invocation_count()); } } diff --git a/src/hotspot/share/opto/callnode.cpp b/src/hotspot/share/opto/callnode.cpp index 400f53760c0..0087c261d1c 100644 --- a/src/hotspot/share/opto/callnode.cpp +++ b/src/hotspot/share/opto/callnode.cpp @@ -759,6 +759,7 @@ bool CallNode::may_modify(const TypeOopPtr *t_oop, PhaseTransform *phase) { } } } + guarantee(dest != NULL, "Call had only one ptr in, broken IR!"); if (!dest->is_top() && may_modify_arraycopy_helper(phase->type(dest)->is_oopptr(), t_oop, phase)) { return true; } diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index 3d6fad130a7..076a92d6079 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -4049,9 +4049,9 @@ void Compile::ConstantTable::emit(CodeBuffer& cb) { int Compile::ConstantTable::find_offset(Constant& con) const { int idx = _constants.find(con); - assert(idx != -1, "constant must be in constant table"); + guarantee(idx != -1, "constant must be in constant table"); int offset = _constants.at(idx).offset(); - assert(offset != -1, "constant table not emitted yet?"); + guarantee(offset != -1, "constant table not emitted yet?"); return offset; } diff --git a/src/hotspot/share/opto/gcm.cpp b/src/hotspot/share/opto/gcm.cpp index b6f87aae7ec..f9ff8d61154 100644 --- a/src/hotspot/share/opto/gcm.cpp +++ b/src/hotspot/share/opto/gcm.cpp @@ -1263,6 +1263,7 @@ void PhaseCFG::schedule_late(VectorSet &visited, Node_Stack &stack) { Node* use = self->fast_out(i); LCA = raise_LCA_above_use(LCA, use, self, this); } + guarantee(LCA != NULL, "There must be a LCA"); } // (Hide defs of imax, i from rest of block.) // Place temps in the block of their use. This isn't a diff --git a/src/hotspot/share/opto/ifnode.cpp b/src/hotspot/share/opto/ifnode.cpp index e2284db4a58..878fc600932 100644 --- a/src/hotspot/share/opto/ifnode.cpp +++ b/src/hotspot/share/opto/ifnode.cpp @@ -387,6 +387,7 @@ static Node* split_if(IfNode *iff, PhaseIterGVN *igvn) { } else { assert( 0, "do not know how to handle this guy" ); } + guarantee(proj != NULL, "sanity"); Node *proj_path_data, *proj_path_ctrl; if( proj->Opcode() == Op_IfTrue ) { diff --git a/src/hotspot/share/opto/indexSet.cpp b/src/hotspot/share/opto/indexSet.cpp index d2172d157b3..ca845e92fc1 100644 --- a/src/hotspot/share/opto/indexSet.cpp +++ b/src/hotspot/share/opto/indexSet.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -319,7 +319,7 @@ void IndexSet::initialize(uint max_elements) { if (_max_blocks <= preallocated_block_list_size) { _blocks = _preallocated_block_list; } else { - _blocks = (IndexSet::BitBlock**) arena()->Amalloc_4(sizeof(IndexSet::BitBlock**) * _max_blocks); + _blocks = (IndexSet::BitBlock**) arena()->Amalloc_4(sizeof(IndexSet::BitBlock*) * _max_blocks); } for (uint i = 0; i < _max_blocks; i++) { set_block(i, &_empty_block); @@ -343,7 +343,7 @@ void IndexSet::initialize(uint max_elements, Arena *arena) { if (_max_blocks <= preallocated_block_list_size) { _blocks = _preallocated_block_list; } else { - _blocks = (IndexSet::BitBlock**) arena->Amalloc_4(sizeof(IndexSet::BitBlock**) * _max_blocks); + _blocks = (IndexSet::BitBlock**) arena->Amalloc_4(sizeof(IndexSet::BitBlock*) * _max_blocks); } for (uint i = 0; i < _max_blocks; i++) { set_block(i, &_empty_block); diff --git a/src/hotspot/share/opto/lcm.cpp b/src/hotspot/share/opto/lcm.cpp index 8e89cd3eaf5..50c0c2dd341 100644 --- a/src/hotspot/share/opto/lcm.cpp +++ b/src/hotspot/share/opto/lcm.cpp @@ -646,7 +646,7 @@ Node* PhaseCFG::select( } } // End of for all ready nodes in worklist - assert(idx >= 0, "index should be set"); + guarantee(idx >= 0, "index should be set"); Node *n = worklist[(uint)idx]; // Get the winner worklist.map((uint)idx, worklist.pop()); // Compress worklist diff --git a/src/hotspot/share/opto/loopPredicate.cpp b/src/hotspot/share/opto/loopPredicate.cpp index bb86ceb3652..93267f934c0 100644 --- a/src/hotspot/share/opto/loopPredicate.cpp +++ b/src/hotspot/share/opto/loopPredicate.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -684,6 +684,7 @@ BoolNode* PhaseIdealLoop::rc_predicate(IdealLoopTree *loop, Node* ctrl, Node* max_idx_expr = NULL; const TypeInt* idx_type = TypeInt::INT; if ((stride > 0) == (scale > 0) == upper) { + guarantee(limit != NULL, "sanity"); if (TraceLoopPredicate) { if (limit->is_Con()) { predString->print("(%d ", con_limit); diff --git a/src/hotspot/share/opto/loopTransform.cpp b/src/hotspot/share/opto/loopTransform.cpp index 6fb179193df..ed71ca41169 100644 --- a/src/hotspot/share/opto/loopTransform.cpp +++ b/src/hotspot/share/opto/loopTransform.cpp @@ -768,11 +768,12 @@ bool IdealLoopTree::policy_unroll(PhaseIdealLoop *phase) { Node *init_n = cl->init_trip(); Node *limit_n = cl->limit(); int stride_con = cl->stride_con(); + if (limit_n == NULL) return false; // We will dereference it below. + // Non-constant bounds. // Protect against over-unrolling when init or/and limit are not constant // (so that trip_count's init value is maxint) but iv range is known. - if (init_n == NULL || !init_n->is_Con() || - limit_n == NULL || !limit_n->is_Con()) { + if (init_n == NULL || !init_n->is_Con() || !limit_n->is_Con()) { Node* phi = cl->phi(); if (phi != NULL) { assert(phi->is_Phi() && phi->in(0) == _head, "Counted loop should have iv phi."); diff --git a/src/hotspot/share/opto/macro.cpp b/src/hotspot/share/opto/macro.cpp index e98e0232fb7..164213148f8 100644 --- a/src/hotspot/share/opto/macro.cpp +++ b/src/hotspot/share/opto/macro.cpp @@ -2154,6 +2154,7 @@ bool PhaseMacroExpand::eliminate_locking_node(AbstractLockNode *alock) { Node* mem = alock->in(TypeFunc::Memory); Node* ctrl = alock->in(TypeFunc::Control); + guarantee(ctrl != NULL, "missing control projection, cannot replace_node() with NULL"); extract_call_projections(alock); // There are 2 projections from the lock. The lock node will @@ -2188,8 +2189,7 @@ bool PhaseMacroExpand::eliminate_locking_node(AbstractLockNode *alock) { } // Seach for MemBarReleaseLock node and delete it also. - if (alock->is_Unlock() && ctrl != NULL && ctrl->is_Proj() && - ctrl->in(0)->is_MemBar()) { + if (alock->is_Unlock() && ctrl->is_Proj() && ctrl->in(0)->is_MemBar()) { MemBarNode* membar = ctrl->in(0)->as_MemBar(); assert(membar->Opcode() == Op_MemBarReleaseLock && mem->is_Proj() && membar == mem->in(0), ""); diff --git a/src/hotspot/share/opto/memnode.cpp b/src/hotspot/share/opto/memnode.cpp index ffeeac6d8ab..51e0617ebe4 100644 --- a/src/hotspot/share/opto/memnode.cpp +++ b/src/hotspot/share/opto/memnode.cpp @@ -370,10 +370,10 @@ Node *MemNode::Ideal_common(PhaseGVN *phase, bool can_reshape) { if (mem != old_mem) { set_req(MemNode::Memory, mem); - if (can_reshape && old_mem->outcnt() == 0) { - igvn->_worklist.push(old_mem); + if (can_reshape && old_mem->outcnt() == 0 && igvn != NULL) { + igvn->_worklist.push(old_mem); } - if (phase->type( mem ) == Type::TOP) return NodeSentinel; + if (phase->type(mem) == Type::TOP) return NodeSentinel; return this; } @@ -825,7 +825,7 @@ Node *LoadNode::make(PhaseGVN& gvn, Node *ctl, Node *mem, Node *adr, const TypeP } break; default: - // ShouldNotReachHere(); ??? + ShouldNotReachHere(); break; } assert(load != NULL, "LoadNode should have been created"); diff --git a/src/hotspot/share/opto/node.hpp b/src/hotspot/share/opto/node.hpp index 943810ed685..5df4e146039 100644 --- a/src/hotspot/share/opto/node.hpp +++ b/src/hotspot/share/opto/node.hpp @@ -1689,9 +1689,10 @@ Compile::locate_node_notes(GrowableArray* arr, int block_idx = (idx >> _log2_node_notes_block_size); int grow_by = (block_idx - (arr == NULL? 0: arr->length())); if (grow_by >= 0) { - if (!can_grow) return NULL; + if (!can_grow) return NULL; grow_node_notes(arr, grow_by + 1); } + if (arr == NULL) return NULL; // (Every element of arr is a sub-array of length _node_notes_block_size.) return arr->at(block_idx) + (idx & (_node_notes_block_size-1)); } diff --git a/src/hotspot/share/opto/output.cpp b/src/hotspot/share/opto/output.cpp index 66361021c7f..6e97899473f 100644 --- a/src/hotspot/share/opto/output.cpp +++ b/src/hotspot/share/opto/output.cpp @@ -1424,7 +1424,7 @@ void Compile::fill_buffer(CodeBuffer* cb, uint* blk_starts) { // See if this instruction has a delay slot if (valid_bundle_info(n) && node_bundling(n)->use_unconditional_delay()) { - assert(delay_slot != NULL, "expecting delay slot node"); + guarantee(delay_slot != NULL, "expecting delay slot node"); // Back up 1 instruction cb->set_insts_end(cb->insts_end() - Pipeline::instr_unit_size()); diff --git a/src/hotspot/share/opto/parse1.cpp b/src/hotspot/share/opto/parse1.cpp index f4c7e12db78..a6408b493c8 100644 --- a/src/hotspot/share/opto/parse1.cpp +++ b/src/hotspot/share/opto/parse1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -1823,7 +1823,7 @@ void Parse::merge_memory_edges(MergeMemNode* n, int pnum, bool nophi) { // Instead, wire the new split into a MergeMem on the backedge. // The optimizer will sort it out, slicing the phi. if (remerge == NULL) { - assert(base != NULL, ""); + guarantee(base != NULL, ""); assert(base->in(0) != NULL, "should not be xformed away"); remerge = MergeMemNode::make(base->in(pnum)); gvn().set_type(remerge, Type::MEMORY); diff --git a/src/hotspot/share/opto/reg_split.cpp b/src/hotspot/share/opto/reg_split.cpp index 05f42d5a343..78789150c82 100644 --- a/src/hotspot/share/opto/reg_split.cpp +++ b/src/hotspot/share/opto/reg_split.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -683,7 +683,7 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) { if( needs_phi ) { // create a new phi node and insert it into the block // type is taken from left over pointer to a predecessor - assert(n3,"No non-NULL reaching DEF for a Phi"); + guarantee(n3, "No non-NULL reaching DEF for a Phi"); phi = new PhiNode(b->head(), n3->bottom_type()); // initialize the Reaches entry for this LRG Reachblock[slidx] = phi; diff --git a/src/hotspot/share/opto/runtime.cpp b/src/hotspot/share/opto/runtime.cpp index 854063d27ba..24fb4e6f0ad 100644 --- a/src/hotspot/share/opto/runtime.cpp +++ b/src/hotspot/share/opto/runtime.cpp @@ -1608,7 +1608,12 @@ NamedCounter* OptoRuntime::new_named_counter(JVMState* youngest_jvms, NamedCount } int bci = jvms->bci(); if (bci < 0) bci = 0; - st.print("%s.%s@%d", m->holder()->name()->as_utf8(), m->name()->as_utf8(), bci); + if (m != NULL) { + st.print("%s.%s", m->holder()->name()->as_utf8(), m->name()->as_utf8()); + } else { + st.print("no method"); + } + st.print("@%d", bci); // To print linenumbers instead of bci use: m->line_number_from_bci(bci) } NamedCounter* c; diff --git a/src/hotspot/share/opto/type.cpp b/src/hotspot/share/opto/type.cpp index e02d4990c12..fab25ad327e 100644 --- a/src/hotspot/share/opto/type.cpp +++ b/src/hotspot/share/opto/type.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -252,17 +252,16 @@ const Type* Type::make_from_constant(ciConstant constant, bool require_constant, ciObject* oop_constant = constant.as_object(); if (oop_constant->is_null_object()) { con_type = Type::get_zero_type(T_OBJECT); - } else if (require_constant || oop_constant->should_be_constant()) { + } else { + guarantee(require_constant || oop_constant->should_be_constant(), "con_type must get computed"); con_type = TypeOopPtr::make_from_constant(oop_constant, require_constant); - if (con_type != NULL) { - if (Compile::current()->eliminate_boxing() && is_autobox_cache) { - con_type = con_type->is_aryptr()->cast_to_autobox_cache(true); - } - if (stable_dimension > 0) { - assert(FoldStableValues, "sanity"); - assert(!con_type->is_zero_type(), "default value for stable field"); - con_type = con_type->is_aryptr()->cast_to_stable(true, stable_dimension); - } + if (Compile::current()->eliminate_boxing() && is_autobox_cache) { + con_type = con_type->is_aryptr()->cast_to_autobox_cache(true); + } + if (stable_dimension > 0) { + assert(FoldStableValues, "sanity"); + assert(!con_type->is_zero_type(), "default value for stable field"); + con_type = con_type->is_aryptr()->cast_to_stable(true, stable_dimension); } } if (is_narrow_oop) { diff --git a/src/hotspot/share/runtime/simpleThresholdPolicy.cpp b/src/hotspot/share/runtime/simpleThresholdPolicy.cpp index da879519711..bcee3309411 100644 --- a/src/hotspot/share/runtime/simpleThresholdPolicy.cpp +++ b/src/hotspot/share/runtime/simpleThresholdPolicy.cpp @@ -266,8 +266,9 @@ CompileTask* SimpleThresholdPolicy::select_task(CompileQueue* compile_queue) { max_method = max_task->method(); } - if (max_task->comp_level() == CompLevel_full_profile && TieredStopAtLevel > CompLevel_full_profile - && is_method_profiled(max_method)) { + if (max_task != NULL && max_task->comp_level() == CompLevel_full_profile && + TieredStopAtLevel > CompLevel_full_profile && + max_method != NULL && is_method_profiled(max_method)) { max_task->set_comp_level(CompLevel_limited_profile); if (PrintTieredEvents) { print_event(UPDATE_IN_QUEUE, max_method, max_method, max_task->osr_bci(), (CompLevel)max_task->comp_level()); From 2e36eebdd2f0b8406418fa19e0682f4d04e8f223 Mon Sep 17 00:00:00 2001 From: Rahul Raghavan Date: Fri, 13 Jul 2018 01:31:23 -0700 Subject: [PATCH 20/32] 8206873: 2 Null pointer dereference defect groups in LIRGenerator Added missing assert statements Reviewed-by: kvn, thartmann --- src/hotspot/share/c1/c1_LIRGenerator.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hotspot/share/c1/c1_LIRGenerator.cpp b/src/hotspot/share/c1/c1_LIRGenerator.cpp index d2667a8ce37..16eea099c74 100644 --- a/src/hotspot/share/c1/c1_LIRGenerator.cpp +++ b/src/hotspot/share/c1/c1_LIRGenerator.cpp @@ -2311,7 +2311,9 @@ void LIRGenerator::do_TableSwitch(TableSwitch* x) { if (compilation()->env()->comp_level() == CompLevel_full_profile && UseSwitchProfiling) { ciMethod* method = x->state()->scope()->method(); ciMethodData* md = method->method_data_or_null(); + assert(md != NULL, "Sanity"); ciProfileData* data = md->bci_to_data(x->state()->bci()); + assert(data != NULL, "must have profiling data"); assert(data->is_MultiBranchData(), "bad profile data?"); int default_count_offset = md->byte_offset_of_slot(data, MultiBranchData::default_count_offset()); LIR_Opr md_reg = new_register(T_METADATA); @@ -2367,7 +2369,9 @@ void LIRGenerator::do_LookupSwitch(LookupSwitch* x) { if (compilation()->env()->comp_level() == CompLevel_full_profile && UseSwitchProfiling) { ciMethod* method = x->state()->scope()->method(); ciMethodData* md = method->method_data_or_null(); + assert(md != NULL, "Sanity"); ciProfileData* data = md->bci_to_data(x->state()->bci()); + assert(data != NULL, "must have profiling data"); assert(data->is_MultiBranchData(), "bad profile data?"); int default_count_offset = md->byte_offset_of_slot(data, MultiBranchData::default_count_offset()); LIR_Opr md_reg = new_register(T_METADATA); @@ -3076,6 +3080,7 @@ void LIRGenerator::profile_arguments(ProfileCall* x) { if (compilation()->profile_arguments()) { int bci = x->bci_of_invoke(); ciMethodData* md = x->method()->method_data_or_null(); + assert(md != NULL, "Sanity"); ciProfileData* data = md->bci_to_data(bci); if (data != NULL) { if ((data->is_CallTypeData() && data->as_CallTypeData()->has_arguments()) || @@ -3212,6 +3217,7 @@ void LIRGenerator::do_ProfileCall(ProfileCall* x) { void LIRGenerator::do_ProfileReturnType(ProfileReturnType* x) { int bci = x->bci_of_invoke(); ciMethodData* md = x->method()->method_data_or_null(); + assert(md != NULL, "Sanity"); ciProfileData* data = md->bci_to_data(bci); if (data != NULL) { assert(data->is_CallTypeData() || data->is_VirtualCallTypeData(), "wrong profile data type"); From 45158a4766d7a9fba6ad07e3a0d2527f5a79d9a6 Mon Sep 17 00:00:00 2001 From: Zhongwei Yao Date: Wed, 11 Jul 2018 15:00:33 +0800 Subject: [PATCH 21/32] 8206975: AArch64: Fix CompareAndSwapOp when useLSE is enabled in Graal Reviewed-by: adinn, aph --- .../src/org/graalvm/compiler/lir/aarch64/AArch64AtomicMove.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AtomicMove.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AtomicMove.java index 1ccd0d3404f..1a51601a998 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AtomicMove.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AtomicMove.java @@ -83,7 +83,7 @@ public class AArch64AtomicMove { if (AArch64LIRFlagsVersioned.useLSE(masm.target.arch)) { Register expected = asRegister(expectedValue); masm.mov(size, result, expected); - masm.cas(size, expected, newVal, address, true /* acquire */, true /* release */); + masm.cas(size, result, newVal, address, true /* acquire */, true /* release */); AArch64Compare.gpCompare(masm, resultValue, expectedValue); } else { // We could avoid using a scratch register here, by reusing resultValue for the From 24feae77a77a8c395cb550bb10dd67bcce6064da Mon Sep 17 00:00:00 2001 From: Volker Simonis Date: Wed, 11 Jul 2018 19:23:27 +0200 Subject: [PATCH 22/32] 8207067: [test] prevent timeouts in serviceability/tmtools/jstat/{GcTest02,GcCauseTest02}.java Reviewed-by: dholmes, goetz --- .../jtreg/serviceability/tmtools/jstat/GcCauseTest02.java | 7 +++++-- .../jtreg/serviceability/tmtools/jstat/GcTest02.java | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/test/hotspot/jtreg/serviceability/tmtools/jstat/GcCauseTest02.java b/test/hotspot/jtreg/serviceability/tmtools/jstat/GcCauseTest02.java index 4ff045ce46d..53c5aecf759 100644 --- a/test/hotspot/jtreg/serviceability/tmtools/jstat/GcCauseTest02.java +++ b/test/hotspot/jtreg/serviceability/tmtools/jstat/GcCauseTest02.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -32,10 +32,13 @@ * @modules java.base/jdk.internal.misc * @library /test/lib * @library ../share - * @run main/othervm -XX:+UsePerfData -XX:MaxNewSize=4m -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcCauseTest02 + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies + -XX:+UsePerfData -XX:MaxNewSize=4m -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcCauseTest02 */ import utils.*; +// This test produces more than 90_000 classes until it eats up ~70% of the 128M meta space. +// We turn off VerifyDependencies because it slows down the test considerably in debug builds. public class GcCauseTest02 { public static void main(String[] args) throws Exception { diff --git a/test/hotspot/jtreg/serviceability/tmtools/jstat/GcTest02.java b/test/hotspot/jtreg/serviceability/tmtools/jstat/GcTest02.java index 93a109cb60c..d18e546f0d3 100644 --- a/test/hotspot/jtreg/serviceability/tmtools/jstat/GcTest02.java +++ b/test/hotspot/jtreg/serviceability/tmtools/jstat/GcTest02.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -32,10 +32,13 @@ * @modules java.base/jdk.internal.misc * @library /test/lib * @library ../share - * @run main/othervm -XX:+UsePerfData -XX:MaxNewSize=4m -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcTest02 + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies + -XX:+UsePerfData -XX:MaxNewSize=4m -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcTest02 */ import utils.*; +// This test produces more than 90_000 classes until it eats up ~70% of the 128M meta space. +// We turn off VerifyDependencies because it slows down the test considerably in debug builds. public class GcTest02 { public static void main(String[] args) throws Exception { From 0b9f5c886292f2ed5e1c908a2a7bb6beb553086d Mon Sep 17 00:00:00 2001 From: Volker Simonis Date: Fri, 13 Jul 2018 11:07:43 +0200 Subject: [PATCH 23/32] 8206998: [test] runtime/ElfDecoder/TestElfDirectRead.java requires longer timeout on ppc64 Reviewed-by: zgu, dholmes --- .../runtime/ElfDecoder/TestElfDirectRead.java | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/runtime/ElfDecoder/TestElfDirectRead.java b/test/hotspot/jtreg/runtime/ElfDecoder/TestElfDirectRead.java index b66e85cb65a..daddd1cfa78 100644 --- a/test/hotspot/jtreg/runtime/ElfDecoder/TestElfDirectRead.java +++ b/test/hotspot/jtreg/runtime/ElfDecoder/TestElfDirectRead.java @@ -25,13 +25,38 @@ * @test * @bug 8193373 * @summary Test reading ELF info direct from underlaying file - * @requires (os.family == "linux") + * @requires (os.family == "linux") & (os.arch != "ppc64") * @modules java.base/jdk.internal.misc * @library /test/lib * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail TestElfDirectRead + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + -XX:NativeMemoryTracking=detail TestElfDirectRead + */ + +// This test intentionally disables caching of Elf sections during symbol lookup +// with WhiteBox.disableElfSectionCache(). On platforms which do not use file +// descriptors instead of plain function pointers this slows down the lookup just a +// little bit, because all the symbols from an Elf file are still read consecutively +// after one 'fseek()' call. But on platforms with file descriptors like ppc64 +// big-endian, we get two 'fseek()' calls for each symbol read from the Elf file +// because reading the file descriptor table is nested inside the loop which reads +// the symbols. This really trashes the I/O system and considerable slows down the +// test, so we need an extra long timeout setting. + +/* + * @test + * @bug 8193373 + * @summary Test reading ELF info direct from underlaying file + * @requires (os.family == "linux") & (os.arch == "ppc64") + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + -XX:NativeMemoryTracking=detail TestElfDirectRead */ import jdk.test.lib.process.ProcessTools; From 5bd94254bbb8809bee0ae7e3870db8a50c4aa2cf Mon Sep 17 00:00:00 2001 From: Boris Ulasevich Date: Fri, 13 Jul 2018 07:01:51 -0700 Subject: [PATCH 24/32] 8207047: Multiple VM variants build fail Reviewed-by: erikj --- make/hotspot/gensrc/GensrcJfr.gmk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/hotspot/gensrc/GensrcJfr.gmk b/make/hotspot/gensrc/GensrcJfr.gmk index 06a528c9492..282c6c6d200 100644 --- a/make/hotspot/gensrc/GensrcJfr.gmk +++ b/make/hotspot/gensrc/GensrcJfr.gmk @@ -27,7 +27,7 @@ # Build tools needed for the JFR source code generation JFR_TOOLS_SRCDIR := $(TOPDIR)/make/src/classes -JFR_TOOLS_OUTPUTDIR := $(OUTPUTDIR)/buildtools/tools_classes +JFR_TOOLS_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/buildtools/tools_classes $(eval $(call SetupJavaCompiler, GENERATE_JFRBYTECODE, \ JAVAC := $(JAVAC), \ From a98ec3e8bdc7b080d3ff27b91a66e76f02f53dbf Mon Sep 17 00:00:00 2001 From: Xue-Lei Andrew Fan Date: Fri, 13 Jul 2018 07:08:59 -0700 Subject: [PATCH 25/32] 8207029: Unable to use custom SSLEngine with default TrustManagerFactory after updating to JDK 11 b21 Reviewed-by: wetmore --- .../security/ssl/SSLAlgorithmConstraints.java | 36 +++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java b/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java index 252dec42cf3..1fdc2d63f22 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java @@ -73,12 +73,20 @@ final class SSLAlgorithmConstraints implements AlgorithmConstraints { boolean withDefaultCertPathConstraints) { AlgorithmConstraints configuredConstraints = null; if (socket != null) { - HandshakeContext hc = - ((SSLSocketImpl)socket).conContext.handshakeContext; - if (hc != null) { - configuredConstraints = hc.sslConfig.algorithmConstraints; + // Note that the KeyManager or TrustManager implementation may be + // not implemented in the same provider as SSLSocket/SSLEngine. + // Please check the instance before casting to use SSLSocketImpl. + if (socket instanceof SSLSocketImpl) { + HandshakeContext hc = + ((SSLSocketImpl)socket).conContext.handshakeContext; + if (hc != null) { + configuredConstraints = hc.sslConfig.algorithmConstraints; + } else { + configuredConstraints = null; + } } else { - configuredConstraints = null; + configuredConstraints = + socket.getSSLParameters().getAlgorithmConstraints(); } } this.userSpecifiedConstraints = configuredConstraints; @@ -90,12 +98,20 @@ final class SSLAlgorithmConstraints implements AlgorithmConstraints { boolean withDefaultCertPathConstraints) { AlgorithmConstraints configuredConstraints = null; if (engine != null) { - HandshakeContext hc = - ((SSLEngineImpl)engine).conContext.handshakeContext; - if (hc != null) { - configuredConstraints = hc.sslConfig.algorithmConstraints; + // Note that the KeyManager or TrustManager implementation may be + // not implemented in the same provider as SSLSocket/SSLEngine. + // Please check the instance before casting to use SSLEngineImpl. + if (engine instanceof SSLEngineImpl) { + HandshakeContext hc = + ((SSLEngineImpl)engine).conContext.handshakeContext; + if (hc != null) { + configuredConstraints = hc.sslConfig.algorithmConstraints; + } else { + configuredConstraints = null; + } } else { - configuredConstraints = null; + configuredConstraints = + engine.getSSLParameters().getAlgorithmConstraints(); } } this.userSpecifiedConstraints = configuredConstraints; From 6dc1ccac6bd5eb5794fe540c7412d672202a7166 Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Fri, 13 Jul 2018 15:44:54 +0200 Subject: [PATCH 26/32] 8200282: Serializing non-zero byte as zero to ByteBuffer Arraycopy converted as a series of loads/stores uses wrong slice for loads Reviewed-by: kvn, thartmann --- src/hotspot/share/opto/arraycopynode.cpp | 12 +++- .../arraycopy/ACasLoadsStoresBadMem.java | 58 +++++++++++++++++++ 2 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/arraycopy/ACasLoadsStoresBadMem.java diff --git a/src/hotspot/share/opto/arraycopynode.cpp b/src/hotspot/share/opto/arraycopynode.cpp index e39beffeb13..46e5296647a 100644 --- a/src/hotspot/share/opto/arraycopynode.cpp +++ b/src/hotspot/share/opto/arraycopynode.cpp @@ -366,6 +366,9 @@ Node* ArrayCopyNode::array_copy_forward(PhaseGVN *phase, if (!forward_ctl->is_top()) { // copy forward mem = start_mem_dest; + uint alias_idx_src = phase->C->get_alias_index(atp_src); + uint alias_idx_dest = phase->C->get_alias_index(atp_dest); + bool same_alias = (alias_idx_src == alias_idx_dest); if (count > 0) { Node* v = LoadNode::make(*phase, forward_ctl, start_mem_src, adr_src, atp_src, value_type, copy_type, MemNode::unordered); @@ -376,7 +379,7 @@ Node* ArrayCopyNode::array_copy_forward(PhaseGVN *phase, Node* off = phase->MakeConX(type2aelembytes(copy_type) * i); Node* next_src = phase->transform(new AddPNode(base_src,adr_src,off)); Node* next_dest = phase->transform(new AddPNode(base_dest,adr_dest,off)); - v = LoadNode::make(*phase, forward_ctl, mem, next_src, atp_src, value_type, copy_type, MemNode::unordered); + v = LoadNode::make(*phase, forward_ctl, same_alias ? mem : start_mem_src, next_src, atp_src, value_type, copy_type, MemNode::unordered); v = phase->transform(v); mem = StoreNode::make(*phase, forward_ctl,mem,next_dest,atp_dest,v, copy_type, MemNode::unordered); mem = phase->transform(mem); @@ -408,18 +411,21 @@ Node* ArrayCopyNode::array_copy_backward(PhaseGVN *phase, if (!backward_ctl->is_top()) { // copy backward mem = start_mem_dest; + uint alias_idx_src = phase->C->get_alias_index(atp_src); + uint alias_idx_dest = phase->C->get_alias_index(atp_dest); + bool same_alias = (alias_idx_src == alias_idx_dest); if (count > 0) { for (int i = count-1; i >= 1; i--) { Node* off = phase->MakeConX(type2aelembytes(copy_type) * i); Node* next_src = phase->transform(new AddPNode(base_src,adr_src,off)); Node* next_dest = phase->transform(new AddPNode(base_dest,adr_dest,off)); - Node* v = LoadNode::make(*phase, backward_ctl, mem, next_src, atp_src, value_type, copy_type, MemNode::unordered); + Node* v = LoadNode::make(*phase, backward_ctl, same_alias ? mem : start_mem_src, next_src, atp_src, value_type, copy_type, MemNode::unordered); v = phase->transform(v); mem = StoreNode::make(*phase, backward_ctl,mem,next_dest,atp_dest,v, copy_type, MemNode::unordered); mem = phase->transform(mem); } - Node* v = LoadNode::make(*phase, backward_ctl, mem, adr_src, atp_src, value_type, copy_type, MemNode::unordered); + Node* v = LoadNode::make(*phase, backward_ctl, same_alias ? mem : start_mem_src, adr_src, atp_src, value_type, copy_type, MemNode::unordered); v = phase->transform(v); mem = StoreNode::make(*phase, backward_ctl, mem, adr_dest, atp_dest, v, copy_type, MemNode::unordered); mem = phase->transform(mem); diff --git a/test/hotspot/jtreg/compiler/arraycopy/ACasLoadsStoresBadMem.java b/test/hotspot/jtreg/compiler/arraycopy/ACasLoadsStoresBadMem.java new file mode 100644 index 00000000000..d5c8cd2249d --- /dev/null +++ b/test/hotspot/jtreg/compiler/arraycopy/ACasLoadsStoresBadMem.java @@ -0,0 +1,58 @@ +/* + * 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 8200282 + * @summary arraycopy converted as a series of loads/stores uses wrong slice for loads + * + * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,ACasLoadsStoresBadMem::not_inlined ACasLoadsStoresBadMem + * + */ + +public class ACasLoadsStoresBadMem { + public static void main(String[] args) { + int[] dst = new int[5]; + for (int i = 0; i < 20_000; i++) { + test1(dst, 1); + for (int j = 1; j < 5; j++) { + if (dst[j] != j) { + throw new RuntimeException("Bad copy "); + } + } + } + } + + private static void test1(int[] dst, int dstPos) { + int[] src = new int[4]; + not_inlined(); + src[0] = 1; + src[1] = 2; + src[2] = 3; + src[3] = 4; + System.arraycopy(src, 0, dst, dstPos, 4); + } + + private static void not_inlined() { + } +} From b2f4d61fb927b34810de519becf6ab2df843da2d Mon Sep 17 00:00:00 2001 From: Adam Petcher Date: Fri, 13 Jul 2018 10:42:30 -0400 Subject: [PATCH 27/32] 8206915: XDH TCK issues Fixing a couple of conformance issues in XDH Reviewed-by: mullan --- .../sun/security/ec/XDHKeyAgreement.java | 23 +++++++++++-------- test/jdk/sun/security/ec/xec/TestXDH.java | 18 ++++++++++++--- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/jdk.crypto.ec/share/classes/sun/security/ec/XDHKeyAgreement.java b/src/jdk.crypto.ec/share/classes/sun/security/ec/XDHKeyAgreement.java index 43da079e961..e15942b05c0 100644 --- a/src/jdk.crypto.ec/share/classes/sun/security/ec/XDHKeyAgreement.java +++ b/src/jdk.crypto.ec/share/classes/sun/security/ec/XDHKeyAgreement.java @@ -69,13 +69,15 @@ public class XDHKeyAgreement extends KeyAgreementSpi { initImpl(key); - // the private key parameters must match params - XECParameters xecParams = XECParameters.get( - InvalidAlgorithmParameterException::new, params); - if (!xecParams.oidEquals(this.ops.getParameters())) { - throw new InvalidKeyException( - "Incorrect private key parameters" - ); + // the private key parameters must match params, if present + if (params != null) { + XECParameters xecParams = XECParameters.get( + InvalidAlgorithmParameterException::new, params); + if (!xecParams.oidEquals(this.ops.getParameters())) { + throw new InvalidKeyException( + "Incorrect private key parameters" + ); + } } } @@ -171,7 +173,9 @@ public class XDHKeyAgreement extends KeyAgreementSpi { throw new IllegalStateException("Not initialized correctly"); } - return secret.clone(); + byte[] result = secret; + secret = null; + return result; } @Override @@ -189,7 +193,8 @@ public class XDHKeyAgreement extends KeyAgreementSpi { } System.arraycopy(this.secret, 0, sharedSecret, offset, secretLen); - return secret.length; + secret = null; + return secretLen; } @Override diff --git a/test/jdk/sun/security/ec/xec/TestXDH.java b/test/jdk/sun/security/ec/xec/TestXDH.java index 135a469cba3..3a117e1e3d5 100644 --- a/test/jdk/sun/security/ec/xec/TestXDH.java +++ b/test/jdk/sun/security/ec/xec/TestXDH.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8171277 + * @bug 8171277 8206915 * @summary Test XDH key agreement * @library /test/lib * @build jdk.test.lib.Convert @@ -66,15 +66,17 @@ public class TestXDH { throws Exception { KeyPairGenerator kpg = KeyPairGenerator.getInstance(name); + AlgorithmParameterSpec paramSpec = null; if (param instanceof Integer) { kpg.initialize((Integer) param); } else if (param instanceof String) { - kpg.initialize(new NamedParameterSpec((String) param)); + paramSpec = new NamedParameterSpec((String) param); + kpg.initialize(paramSpec); } KeyPair kp = kpg.generateKeyPair(); KeyAgreement ka = KeyAgreement.getInstance(name); - ka.init(kp.getPrivate()); + ka.init(kp.getPrivate(), paramSpec); ka.doPhase(kp.getPublic(), true); byte[] secret = ka.generateSecret(); @@ -96,6 +98,16 @@ public class TestXDH { throw new RuntimeException("Arrays not equal"); } + // make sure generateSecret() resets the state to after init() + try { + ka.generateSecret(); + throw new RuntimeException("generateSecret does not reset state"); + } catch (IllegalStateException ex) { + // do nothing---this is expected + } + ka.doPhase(pubKey, true); + ka.generateSecret(); + // test with XDH key specs XECPublicKeySpec xdhPublic = kf.getKeySpec(kp.getPublic(), XECPublicKeySpec.class); From 8afac1c9dad43f093349bb7030c15488cee60276 Mon Sep 17 00:00:00 2001 From: Daniil Titov Date: Thu, 12 Jul 2018 22:53:35 -0700 Subject: [PATCH 28/32] 8191948: db error: InvalidTypeException: Can't assign double[][][] to double[][][] Reviewed-by: sspitsyn, amenkov --- .../classes/com/sun/tools/jdi/ReferenceTypeImpl.java | 8 ++++---- .../jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001.java | 3 ++- .../jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001a.java | 5 +++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/jdk.jdi/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java b/src/jdk.jdi/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java index da48b554e5c..80f0f81bdc9 100644 --- a/src/jdk.jdi/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java +++ b/src/jdk.jdi/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -1153,7 +1153,7 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp this.genericSignatureGotten = true; } - private static boolean isPrimitiveArray(String signature) { + private static boolean isOneDimensionalPrimitiveArray(String signature) { int i = signature.lastIndexOf('['); /* * TO DO: Centralize JNI signature knowledge. @@ -1162,7 +1162,7 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp * jdk1.4/doc/guide/jpda/jdi/com/sun/jdi/doc-files/signature.html */ boolean isPA; - if (i < 0) { + if (i < 0 || signature.startsWith("[[")) { isPA = false; } else { char c = signature.charAt(i + 1); @@ -1186,7 +1186,7 @@ public abstract class ReferenceTypeImpl extends TypeImpl implements ReferenceTyp ClassLoaderReferenceImpl loader = (ClassLoaderReferenceImpl)classLoader(); if ((loader == null) || - (isPrimitiveArray(signature)) //Work around 4450091 + (isOneDimensionalPrimitiveArray(signature)) //Work around 4450091 ) { // Caller wants type of boot class field type = vm.findBootType(signature); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001.java b/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001.java index b8de9641625..d32c51d12a0 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001.java @@ -98,7 +98,8 @@ public class eval001 extends JdbTest { { DEBUGGEE_CLASS + "._eval001a.myMethod()", "2147483647" }, { "myClass.toString().equals(\"abcde\")", "true"}, { "i + j + k", "777"}, - { "new java.lang.String(\"Hello, World\").length()", "12"} + { "new java.lang.String(\"Hello, World\").length()", "12"}, + { DEBUGGEE_CLASS + "._eval001a.testPrimitiveArray(test)", "1.0" } }; protected void runCases() { diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001a.java b/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001a.java index 6584104fb96..2e3b52dd9be 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001a.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001a.java @@ -48,6 +48,7 @@ public class eval001a { int i = 111; int j = 222; int k = 444; + double[][][] test = new double[2][2][2]; synchronized (this) { lastBreak(); @@ -81,4 +82,8 @@ public class eval001a { return line; } } + + public double testPrimitiveArray(double[][][] d){ + return 1.0; + } } From 173732afaa62e01823097ceb47714ccfaf2e9e91 Mon Sep 17 00:00:00 2001 From: Claes Redestad Date: Fri, 13 Jul 2018 18:39:11 +0200 Subject: [PATCH 29/32] 8207235: ManagementFactory.getPlatformMXBeans(BufferPoolMXBean.class) throws NPE Reviewed-by: alanb --- .../share/classes/java/nio/Bits.java | 55 ++++++------------- .../share/classes/java/nio/Buffer.java | 21 +++++++ .../jdk/internal/misc/SharedSecrets.java | 5 +- 3 files changed, 41 insertions(+), 40 deletions(-) diff --git a/src/java.base/share/classes/java/nio/Bits.java b/src/java.base/share/classes/java/nio/Bits.java index f96d2f48bae..1babb85f479 100644 --- a/src/java.base/share/classes/java/nio/Bits.java +++ b/src/java.base/share/classes/java/nio/Bits.java @@ -207,43 +207,24 @@ class Bits { // package-private assert cnt >= 0 && reservedMem >= 0 && totalCap >= 0; } - // -- Monitoring of direct buffer usage -- - - static { - // setup access to this package in SharedSecrets - SharedSecrets.setJavaNioAccess( - new JavaNioAccess() { - @Override - public JavaNioAccess.BufferPool getDirectBufferPool() { - return new JavaNioAccess.BufferPool() { - @Override - public String getName() { - return "direct"; - } - @Override - public long getCount() { - return Bits.COUNT.get(); - } - @Override - public long getTotalCapacity() { - return Bits.TOTAL_CAPACITY.get(); - } - @Override - public long getMemoryUsed() { - return Bits.RESERVED_MEMORY.get(); - } - }; - } - @Override - public ByteBuffer newDirectByteBuffer(long addr, int cap, Object ob) { - return new DirectByteBuffer(addr, cap, ob); - } - @Override - public void truncate(Buffer buf) { - buf.truncate(); - } - }); - } + static final JavaNioAccess.BufferPool BUFFER_POOL = new JavaNioAccess.BufferPool() { + @Override + public String getName() { + return "direct"; + } + @Override + public long getCount() { + return Bits.COUNT.get(); + } + @Override + public long getTotalCapacity() { + return Bits.TOTAL_CAPACITY.get(); + } + @Override + public long getMemoryUsed() { + return Bits.RESERVED_MEMORY.get(); + } + }; // These numbers represent the point at which we have empirically // determined that the average cost of a JNI call exceeds the expense diff --git a/src/java.base/share/classes/java/nio/Buffer.java b/src/java.base/share/classes/java/nio/Buffer.java index 8741108b96d..1e04467b6b9 100644 --- a/src/java.base/share/classes/java/nio/Buffer.java +++ b/src/java.base/share/classes/java/nio/Buffer.java @@ -26,6 +26,8 @@ package java.nio; import jdk.internal.HotSpotIntrinsicCandidate; +import jdk.internal.misc.JavaNioAccess; +import jdk.internal.misc.SharedSecrets; import jdk.internal.misc.Unsafe; import java.util.Spliterator; @@ -707,4 +709,23 @@ public abstract class Buffer { throw new IndexOutOfBoundsException(); } + static { + // setup access to this package in SharedSecrets + SharedSecrets.setJavaNioAccess( + new JavaNioAccess() { + @Override + public JavaNioAccess.BufferPool getDirectBufferPool() { + return Bits.BUFFER_POOL; + } + @Override + public ByteBuffer newDirectByteBuffer(long addr, int cap, Object ob) { + return new DirectByteBuffer(addr, cap, ob); + } + @Override + public void truncate(Buffer buf) { + buf.truncate(); + } + }); + } + } diff --git a/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java b/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java index 04439fba710..e44e9e7007d 100644 --- a/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java +++ b/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java @@ -194,10 +194,9 @@ public class SharedSecrets { public static JavaNioAccess getJavaNioAccess() { if (javaNioAccess == null) { - // Ensure java.nio.ByteOrder is initialized; we know that - // this class initializes java.nio.Bits that provides the + // Ensure java.nio.Buffer is initialized, which provides the // shared secret. - unsafe.ensureClassInitialized(java.nio.ByteOrder.class); + unsafe.ensureClassInitialized(java.nio.Buffer.class); } return javaNioAccess; } From 9335adaf4ab78fd4b4bc5e3896473c9c44a7aae2 Mon Sep 17 00:00:00 2001 From: Rajan Halade Date: Fri, 13 Jul 2018 09:48:52 -0700 Subject: [PATCH 30/32] 8199779: Add T-Systems, GlobalSign and Starfield services root certificates Reviewed-by: mullan --- src/java.base/share/lib/security/cacerts | Bin 93412 -> 99953 bytes .../lib/security/cacerts/VerifyCACerts.java | 18 ++++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/java.base/share/lib/security/cacerts b/src/java.base/share/lib/security/cacerts index 9adede1ddabbfca30343e99ab04a409c1ceb9233..522f979b35c3d8de6365c3aead11d61337e4e9ec 100644 GIT binary patch delta 5783 zcmd7Wc{tQvT6yjsL>Hn|o71WF{AIVYPvk zV#n*M++%7Zo!K=J=5E(GA8_3qq!AZ7yzVNX^J#QWA|!1E4(U248&;R03^FfR8DvyJgh+yzh0HmpB$phV?Y#kA)*_G`F*(WA)~-R9D$g^b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+QW~pjmi&Ug8J8Bd8> z>1=Wb^dIem>Zo(-!Ljp3Z}F6$Vly3j1G8Wd&c z)ok-3$ew8ST$hdE24?PV8%KGt#TAxY{Rqa@kbS0&{E<|W%4tHvDr{wW8evUM1rAr4 zvTJW~rUUN=yV#}jl|OBu!viMU3)xRm9gc_JIp$SIX%8SEUIG#C=j7_>;XwG_kMBIL zoqxw!2hsY8bD45FTA)0#-==QqgV`YGuakWjt+%DX;)68n+apS6aA8mC%spj^ad)HIZTSgD~O1>&JE!SjvDS1DK{mvq!=BO zZK2y_A8h2{1tOx}IRoaRI1;aB!L5I?QzKD{G;Puc@@X}i4?SC?IQ;~*uC-cc+X**^ zh=;ey>WowmCpdaSIwcZwa;Ar)*!04jPG&25=9SOOO4TqztI#7lb0zLqga*<&&Ub5R z%cS^R9ELFIX+%|c5FR_s;?*BCzrl@Mly2lN6>iHk$GK!~J``15LdXARpqIFYl%5A^81P8NX~^o*C8eLOlJWaZzg>6)`dT8`j4D% z@8?vP%(NY9pqbB(#>e{Nd5O RBIb+jL$rReT9P)+KLAsSB)tFt delta 138 zcmV;50CoTIj0WV{1q}Y}{_Ow&00IC208^LY5&;vjAFLv?qb4kXv(Kv6B(qA>JQ%YU z?;BgUNKOF<2DdUw0Tu+ePE-Li3Ae;$0l);e(P07e1DEC!0T8#5T>(G@w}ff|tOU1) saRGM(w+?~Px# diff --git a/test/jdk/lib/security/cacerts/VerifyCACerts.java b/test/jdk/lib/security/cacerts/VerifyCACerts.java index b702ec68cbb..efa4304946b 100644 --- a/test/jdk/lib/security/cacerts/VerifyCACerts.java +++ b/test/jdk/lib/security/cacerts/VerifyCACerts.java @@ -24,7 +24,7 @@ /** * @test - * @bug 8189131 8198240 8191844 8189949 8191031 8196141 8204923 8195774 + * @bug 8189131 8198240 8191844 8189949 8191031 8196141 8204923 8195774 8199779 * @requires java.runtime.name ~= "OpenJDK.*" * @summary Check root CA entries in cacerts file */ @@ -42,7 +42,7 @@ public class VerifyCACerts { + File.separator + "security" + File.separator + "cacerts"; // The numbers of certs now. - private static final int COUNT = 83; + private static final int COUNT = 90; // map of cert alias to SHA-256 fingerprint private static final Map FINGERPRINT_MAP @@ -214,6 +214,20 @@ public class VerifyCACerts { "03:76:AB:1D:54:C5:F9:80:3C:E4:B2:E2:01:A0:EE:7E:EF:7B:57:B6:36:E8:A9:3C:9B:8D:48:60:C9:6F:5F:A7"); put("affirmtrustpremiumeccca [jdk]", "BD:71:FD:F6:DA:97:E4:CF:62:D1:64:7A:DD:25:81:B0:7D:79:AD:F8:39:7E:B4:EC:BA:9C:5E:84:88:82:14:23"); + put("deutschetelekomrootca2 [jdk]", + "B6:19:1A:50:D0:C3:97:7F:7D:A9:9B:CD:AA:C8:6A:22:7D:AE:B9:67:9E:C7:0B:A3:B0:C9:D9:22:71:C1:70:D3"); + put("ttelesecglobalrootclass3ca [jdk]", + "FD:73:DA:D3:1C:64:4F:F1:B4:3B:EF:0C:CD:DA:96:71:0B:9C:D9:87:5E:CA:7E:31:70:7A:F3:E9:6D:52:2B:BD"); + put("ttelesecglobalrootclass2ca [jdk]", + "91:E2:F5:78:8D:58:10:EB:A7:BA:58:73:7D:E1:54:8A:8E:CA:CD:01:45:98:BC:0B:14:3E:04:1B:17:05:25:52"); + put("starfieldservicesrootg2ca [jdk]", + "56:8D:69:05:A2:C8:87:08:A4:B3:02:51:90:ED:CF:ED:B1:97:4A:60:6A:13:C6:E5:29:0F:CB:2A:E6:3E:DA:B5"); + put("globalsignca [jdk]", + "EB:D4:10:40:E4:BB:3E:C7:42:C9:E3:81:D3:1E:F2:A4:1A:48:B6:68:5C:96:E7:CE:F3:C1:DF:6C:D4:33:1C:99"); + put("globalsignr3ca [jdk]", + "CB:B5:22:D7:B7:F1:27:AD:6A:01:13:86:5B:DF:1C:D4:10:2E:7D:07:59:AF:63:5A:7C:F4:72:0D:C9:63:C5:3B"); + put("globalsigneccrootcar5 [jdk]", + "17:9F:BC:14:8A:3D:D0:0F:D2:4E:A1:34:58:CC:43:BF:A7:F5:9C:81:82:D7:83:A5:13:F6:EB:EC:10:0C:89:24"); } }; From 2d0aee227505c13ff78cd403477b289bb0291a9d Mon Sep 17 00:00:00 2001 From: Aleksei Voitylov Date: Fri, 13 Jul 2018 11:13:34 -0700 Subject: [PATCH 31/32] 8207065: Cleanup compiler tests for Client VM Reviewed-by: kvn, iignatyev --- test/hotspot/jtreg/compiler/c2/Test8062950.java | 1 + .../compiler/loopopts/IterationSplitPredicateInconsistency.java | 1 + test/hotspot/jtreg/compiler/loopopts/TestCMovSplitThruPhi.java | 1 + .../loopstripmining/CheckLoopStripMiningIterShortLoop.java | 1 + .../jtreg/compiler/vectorization/TestUnexpectedLoadOrdering.java | 1 + 5 files changed, 5 insertions(+) diff --git a/test/hotspot/jtreg/compiler/c2/Test8062950.java b/test/hotspot/jtreg/compiler/c2/Test8062950.java index e83b6432acc..c72edb4f696 100644 --- a/test/hotspot/jtreg/compiler/c2/Test8062950.java +++ b/test/hotspot/jtreg/compiler/c2/Test8062950.java @@ -24,6 +24,7 @@ /* * @test * @bug 8062950 + * @requires vm.flavor == "server" * @key regression * @library /test/lib * @run driver compiler.c2.Test8062950 diff --git a/test/hotspot/jtreg/compiler/loopopts/IterationSplitPredicateInconsistency.java b/test/hotspot/jtreg/compiler/loopopts/IterationSplitPredicateInconsistency.java index a906fea52ff..2972c0d61bb 100644 --- a/test/hotspot/jtreg/compiler/loopopts/IterationSplitPredicateInconsistency.java +++ b/test/hotspot/jtreg/compiler/loopopts/IterationSplitPredicateInconsistency.java @@ -25,6 +25,7 @@ * @test * @bug 8193130 8203915 * @summary Bad graph when unrolled loop bounds conflicts with range checks + * @requires vm.flavor == "server" * * @run main/othervm IterationSplitPredicateInconsistency * @run main/othervm -XX:-UseLoopPredicate IterationSplitPredicateInconsistency diff --git a/test/hotspot/jtreg/compiler/loopopts/TestCMovSplitThruPhi.java b/test/hotspot/jtreg/compiler/loopopts/TestCMovSplitThruPhi.java index 03df3c0b810..9bf41fb8187 100644 --- a/test/hotspot/jtreg/compiler/loopopts/TestCMovSplitThruPhi.java +++ b/test/hotspot/jtreg/compiler/loopopts/TestCMovSplitThruPhi.java @@ -25,6 +25,7 @@ * @test * @bug 8187822 * @summary C2 conditonal move optimization might create broken graph + * @requires vm.flavor == "server" * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestCMovSplitThruPhi::not_inlined -XX:CompileOnly=TestCMovSplitThruPhi::test -XX:-LoopUnswitching TestCMovSplitThruPhi * */ diff --git a/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java b/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java index 91176c301fe..294ed7ba561 100644 --- a/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java +++ b/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java @@ -25,6 +25,7 @@ * @test * @bug 8196294 * @summary when loop strip is enabled, LoopStripMiningIterShortLoop should be not null + * @requires vm.flavor == "server" * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management diff --git a/test/hotspot/jtreg/compiler/vectorization/TestUnexpectedLoadOrdering.java b/test/hotspot/jtreg/compiler/vectorization/TestUnexpectedLoadOrdering.java index 4e946c113bb..f14f82777db 100644 --- a/test/hotspot/jtreg/compiler/vectorization/TestUnexpectedLoadOrdering.java +++ b/test/hotspot/jtreg/compiler/vectorization/TestUnexpectedLoadOrdering.java @@ -25,6 +25,7 @@ * @test * @bug 8201367 * @summary RPO walk of counted loop block doesn't properly order loads + * @requires vm.flavor == "server" * * @run main/othervm -XX:-BackgroundCompilation -XX:-UseCountedLoopSafepoints TestUnexpectedLoadOrdering * From 93364e9a43ceb92781140ae1f5de4979520d8add Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Fri, 13 Jul 2018 13:00:36 -0700 Subject: [PATCH 32/32] 8207213: The help-doc.html generated by the doclet is incomplete Reviewed-by: hannesw --- .../internal/doclets/formats/html/HelpWriter.java | 15 +++++++++++++++ .../formats/html/resources/standard.properties | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java index e396384b82b..064dcb41351 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java @@ -440,6 +440,21 @@ public class HelpWriter extends HtmlDocletWriter { ul.addContent(htmlTree); } + // Search + Content searchHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, + contents.getContent("doclet.help.search.head")); + htmlTree = (configuration.allowTag(HtmlTag.SECTION)) + ? HtmlTree.SECTION(searchHead) + : HtmlTree.LI(HtmlStyle.blockList, searchHead); + Content searchBody = contents.getContent("doclet.help.search.body"); + Content searchPara = HtmlTree.P(searchBody); + htmlTree.addContent(searchPara); + if (configuration.allowTag(HtmlTag.SECTION)) { + ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); + } else { + ul.addContent(htmlTree); + } + Content divContent = HtmlTree.DIV(HtmlStyle.contentContainer, ul); divContent.addContent(new HtmlTree(HtmlTag.HR)); Content footnote = HtmlTree.SPAN(HtmlStyle.emphasizedPhrase, diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties index eda6ba076b3..b44b7eb16a1 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties @@ -194,6 +194,10 @@ doclet.help.annotation_type.declaration=\ Annotation Type Declaration doclet.help.annotation_type.description=\ Annotation Type Description +doclet.help.search.head=Search +doclet.help.search.body=You can search for definitions of modules, packages, types, fields, methods \ + and other terms defined in the API, using some or all of the name. "Camel-case" abbreviations \ + are supported: for example, "InpStr" will find "InputStream" and "InputStreamReader". doclet.ClassUse_Packages.that.use.0=Packages that use {0} doclet.ClassUse_Uses.of.0.in.1=Uses of {0} in {1}