From 0ad01d16d14ec595a4dd3aa30c212f4596d0cca7 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 01 2017 03:49:39 +0000 Subject: import java-1.8.0-openjdk-1.8.0.131-11.b12.el7 --- diff --git a/.gitignore b/.gitignore index abcbb39..d8d304c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -SOURCES/aarch64-port-jdk8u-aarch64-jdk8u141-b16.tar.xz -SOURCES/systemtap-tapset-3.1.0.tar.xz +SOURCES/aarch64-port-jdk8u-aarch64-jdk8u131-b12.tar.xz +SOURCES/aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u131-b12.tar.xz +SOURCES/systemtap-tapset-3.4.0pre01.tar.xz diff --git a/.java-1.8.0-openjdk.metadata b/.java-1.8.0-openjdk.metadata index 50b7386..09085c2 100644 --- a/.java-1.8.0-openjdk.metadata +++ b/.java-1.8.0-openjdk.metadata @@ -1,2 +1,3 @@ -fe554a6a2df47d439eae236066b15ee1ad7d25ba SOURCES/aarch64-port-jdk8u-aarch64-jdk8u141-b16.tar.xz -44b09844ec2e90db08d3d883993e0dbab0c1988a SOURCES/systemtap-tapset-3.1.0.tar.xz +b96cb5f073d412d3c9e49068ccc8da69add31ea4 SOURCES/aarch64-port-jdk8u-aarch64-jdk8u131-b12.tar.xz +619b569e6f3a993318ee96e65ad0237dd7020858 SOURCES/aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u131-b12.tar.xz +efa1d5ce7cc2a4cf2c657d883bfb487432a588c0 SOURCES/systemtap-tapset-3.4.0pre01.tar.xz diff --git a/SOURCES/6515172-pr3346.patch b/SOURCES/6515172-pr3346.patch new file mode 100644 index 0000000..4b8e8a2 --- /dev/null +++ b/SOURCES/6515172-pr3346.patch @@ -0,0 +1,213 @@ +# HG changeset patch +# User shshahma +# Date 1474535080 25200 +# Thu Sep 22 02:04:40 2016 -0700 +# Node ID baf64c88538f477d7f5a0cf90b670108ac312375 +# Parent 62212568179b76b5ebe7b0129ddeed7b268b0bc0 +6515172, PR3346: Runtime.availableProcessors() ignores Linux taskset command +Summary: extract processor count from sched_getaffinity mask +Reviewed-by: dholmes, gthornbr + +diff --git a/src/os/linux/vm/globals_linux.hpp b/src/os/linux/vm/globals_linux.hpp +--- openjdk/hotspot/src/os/linux/vm/globals_linux.hpp ++++ openjdk/hotspot/src/os/linux/vm/globals_linux.hpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2005, 2016, 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 +@@ -47,7 +47,10 @@ + "Load DLLs with executable-stack attribute in the VM Thread") \ + \ + product(bool, UseSHM, false, \ +- "Use SYSV shared memory for large pages") ++ "Use SYSV shared memory for large pages") \ ++ \ ++ diagnostic(bool, PrintActiveCpus, false, \ ++ "Print the number of CPUs detected in os::active_processor_count") + + // + // Defines Linux-specific default values. The flags are available on all +diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp +--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp ++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1999, 2016, 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 +@@ -104,6 +104,14 @@ + + PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC + ++#ifndef _GNU_SOURCE ++ #define _GNU_SOURCE ++ #include ++ #undef _GNU_SOURCE ++#else ++ #include ++#endif ++ + // if RUSAGE_THREAD for getrusage() has not been defined, do it here. The code calling + // getrusage() is prepared to handle the associated failure. + #ifndef RUSAGE_THREAD +@@ -5027,12 +5035,42 @@ + } + }; + ++static int os_cpu_count(const cpu_set_t* cpus) { ++ int count = 0; ++ // only look up to the number of configured processors ++ for (int i = 0; i < os::processor_count(); i++) { ++ if (CPU_ISSET(i, cpus)) { ++ count++; ++ } ++ } ++ return count; ++} ++ ++// Get the current number of available processors for this process. ++// This value can change at any time during a process's lifetime. ++// sched_getaffinity gives an accurate answer as it accounts for cpusets. ++// If anything goes wrong we fallback to returning the number of online ++// processors - which can be greater than the number available to the process. + int os::active_processor_count() { +- // Linux doesn't yet have a (official) notion of processor sets, +- // so just return the number of online processors. +- int online_cpus = ::sysconf(_SC_NPROCESSORS_ONLN); +- assert(online_cpus > 0 && online_cpus <= processor_count(), "sanity check"); +- return online_cpus; ++ cpu_set_t cpus; // can represent at most 1024 (CPU_SETSIZE) processors ++ int cpus_size = sizeof(cpu_set_t); ++ int cpu_count = 0; ++ ++ // pid 0 means the current thread - which we have to assume represents the process ++ if (sched_getaffinity(0, cpus_size, &cpus) == 0) { ++ cpu_count = os_cpu_count(&cpus); ++ if (PrintActiveCpus) { ++ tty->print_cr("active_processor_count: sched_getaffinity processor count: %d", cpu_count); ++ } ++ } ++ else { ++ cpu_count = ::sysconf(_SC_NPROCESSORS_ONLN); ++ warning("sched_getaffinity failed (%s)- using online processor count (%d) " ++ "which may exceed available processors", strerror(errno), cpu_count); ++ } ++ ++ assert(cpu_count > 0 && cpu_count <= processor_count(), "sanity check"); ++ return cpu_count; + } + + void os::set_native_thread_name(const char *name) { +diff --git a/test/runtime/os/AvailableProcessors.java b/test/runtime/os/AvailableProcessors.java +new file mode 100644 +--- /dev/null ++++ openjdk/hotspot/test/runtime/os/AvailableProcessors.java +@@ -0,0 +1,103 @@ ++/* ++ * Copyright (c) 2016, 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. ++ */ ++import java.io.File; ++import com.oracle.java.testlibrary.ProcessTools; ++import com.oracle.java.testlibrary.OutputAnalyzer; ++import java.util.ArrayList; ++ ++/* ++ * @test ++ * @bug 6515172 ++ * @summary Check that availableProcessors reports the correct value when running in a cpuset on linux ++ * @requires os.family == "linux" ++ * @library /testlibrary ++ * @build com.oracle.java.testlibrary.* ++ * @run driver AvailableProcessors ++ */ ++public class AvailableProcessors { ++ ++ static final String SUCCESS_STRING = "Found expected processors: "; ++ ++ public static void main(String[] args) throws Throwable { ++ if (args.length > 0) ++ checkProcessors(Integer.parseInt(args[0])); ++ else { ++ // run ourselves under different cpu configurations ++ // using the taskset command ++ String taskset; ++ final String taskset1 = "/bin/taskset"; ++ final String taskset2 = "/usr/bin/taskset"; ++ if (new File(taskset1).exists()) ++ taskset = taskset1; ++ else if (new File(taskset2).exists()) ++ taskset = taskset2; ++ else { ++ System.out.println("Skipping test: could not find taskset command"); ++ return; ++ } ++ ++ int available = Runtime.getRuntime().availableProcessors(); ++ ++ if (available == 1) { ++ System.out.println("Skipping test: only one processor available"); ++ return; ++ } ++ ++ // Get the java command we want to execute ++ // Enable logging for easier failure diagnosis ++ ProcessBuilder master = ++ ProcessTools.createJavaProcessBuilder(false, ++ "-XX:+UnlockDiagnosticVMOptions", ++ "-XX:+PrintActiveCpus", ++ "AvailableProcessors"); ++ ++ int[] expected = new int[] { 1, available/2, available-1, available }; ++ ++ for (int i : expected) { ++ System.out.println("Testing for " + i + " processors ..."); ++ int max = i - 1; ++ ArrayList cmdline = new ArrayList<>(master.command()); ++ // prepend taskset command ++ cmdline.add(0, "0-" + max); ++ cmdline.add(0, "-c"); ++ cmdline.add(0, taskset); ++ // append expected processor count ++ cmdline.add(String.valueOf(i)); ++ ProcessBuilder pb = new ProcessBuilder(cmdline); ++ System.out.println("Final command line: " + ++ ProcessTools.getCommandLine(pb)); ++ OutputAnalyzer output = ProcessTools.executeProcess(pb); ++ output.shouldContain(SUCCESS_STRING); ++ } ++ } ++ } ++ ++ static void checkProcessors(int expected) { ++ int available = Runtime.getRuntime().availableProcessors(); ++ if (available != expected) ++ throw new Error("Expected " + expected + " processors, but found " ++ + available); ++ else ++ System.out.println(SUCCESS_STRING + available); ++ } ++} diff --git a/SOURCES/8061305-pr3335-rh1423421.patch b/SOURCES/8061305-pr3335-rh1423421.patch new file mode 100644 index 0000000..384c52a --- /dev/null +++ b/SOURCES/8061305-pr3335-rh1423421.patch @@ -0,0 +1,33 @@ +# HG changeset patch +# User ksrini +# Date 1414764176 25200 +# Fri Oct 31 07:02:56 2014 -0700 +# Node ID 9fd9a50e7994a9659c5ef21296d0baee4c2eecff +# Parent fd59a2d4313440077fce3fbf39174755a15d285a +8061305: Javadoc crashes when method name ends with "Property" +Reviewed-by: jjg + +diff --git jdk8/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java jdk8/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java +--- jdk8/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java ++++ jdk8/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java +@@ -656,6 +656,9 @@ + // properties aren't named setA* or getA* + private final Pattern pattern = Pattern.compile("[sg]et\\p{Upper}.*"); + private boolean isPropertyMethod(MethodDoc method) { ++ if (!configuration.javafx) { ++ return false; ++ } + if (!method.name().endsWith("Property")) { + return false; + } +@@ -667,7 +670,9 @@ + if (pattern.matcher(method.name()).matches()) { + return false; + } +- ++ if (method.typeParameters().length > 0) { ++ return false; ++ } + return 0 == method.parameters().length + && !"void".equals(method.returnType().simpleTypeName()); + } diff --git a/SOURCES/8144566-pr3352.patch b/SOURCES/8144566-pr3352.patch new file mode 100644 index 0000000..9a2a294 --- /dev/null +++ b/SOURCES/8144566-pr3352.patch @@ -0,0 +1,911 @@ +# HG changeset patch +# User rpatil +# Date 1474623897 -19800 +# Fri Sep 23 15:14:57 2016 +0530 +# Node ID fb617df8fbac42e962219e45cbd29b15b5ecdc63 +# Parent d41592af9af3790fe5eee30ce686d85cff09c942 +8144566, PR3352: Custom HostnameVerifier disables SNI extension +Reviewed-by: coffeys + +diff --git a/src/share/classes/sun/security/ssl/SSLSocketImpl.java b/src/share/classes/sun/security/ssl/SSLSocketImpl.java +--- openjdk/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java ++++ openjdk/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1996, 2016, 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 +@@ -220,6 +220,11 @@ + Collections.emptyList(); + Collection sniMatchers = + Collections.emptyList(); ++ // Is the serverNames set to empty with SSLParameters.setServerNames()? ++ private boolean noSniExtension = false; ++ ++ // Is the sniMatchers set to empty with SSLParameters.setSNIMatchers()? ++ private boolean noSniMatcher = false; + + /* + * READ ME * READ ME * READ ME * READ ME * READ ME * READ ME * +@@ -666,6 +671,11 @@ + } + + super.connect(endpoint, timeout); ++ ++ if (host == null || host.length() == 0) { ++ useImplicitHost(false); ++ } ++ + doneConnect(); + } + +@@ -2158,41 +2168,61 @@ + output.r.setVersion(protocolVersion); + } + ++ // ++ // ONLY used by ClientHandshaker for the server hostname during handshaking ++ // + synchronized String getHost() { + // Note that the host may be null or empty for localhost. + if (host == null || host.length() == 0) { +- if (!trustNameService) { +- // If the local name service is not trustworthy, reverse host +- // name resolution should not be performed for endpoint +- // identification. Use the application original specified +- // hostname or IP address instead. +- host = getOriginalHostname(getInetAddress()); +- } else { +- host = getInetAddress().getHostName(); +- } ++ useImplicitHost(true); + } + + return host; + } + + /* +- * Get the original application specified hostname. ++ * Try to set and use the implicit specified hostname + */ +- private static String getOriginalHostname(InetAddress inetAddress) { +- /* +- * Get the original hostname via sun.misc.SharedSecrets. +- */ ++ private synchronized void useImplicitHost(boolean noSniUpdate) { ++ ++ // Note: If the local name service is not trustworthy, reverse ++ // host name resolution should not be performed for endpoint ++ // identification. Use the application original specified ++ // hostname or IP address instead. ++ ++ // Get the original hostname via jdk.internal.misc.SharedSecrets ++ InetAddress inetAddress = getInetAddress(); ++ if (inetAddress == null) { // not connected ++ return; ++ } ++ + JavaNetAccess jna = SharedSecrets.getJavaNetAccess(); + String originalHostname = jna.getOriginalHostName(inetAddress); ++ if ((originalHostname != null) && ++ (originalHostname.length() != 0)) { + +- /* +- * If no application specified hostname, use the IP address. +- */ +- if (originalHostname == null || originalHostname.length() == 0) { +- originalHostname = inetAddress.getHostAddress(); ++ host = originalHostname; ++ if (!noSniUpdate && serverNames.isEmpty() && !noSniExtension) { ++ serverNames = ++ Utilities.addToSNIServerNameList(serverNames, host); ++ ++ if (!roleIsServer && ++ (handshaker != null) && !handshaker.started()) { ++ handshaker.setSNIServerNames(serverNames); ++ } ++ } ++ ++ return; + } + +- return originalHostname; ++ // No explicitly specified hostname, no server name indication. ++ if (!trustNameService) { ++ // The local name service is not trustworthy, use IP address. ++ host = inetAddress.getHostAddress(); ++ } else { ++ // Use the underlying reverse host name resolution service. ++ host = getInetAddress().getHostName(); ++ } + } + + +@@ -2205,6 +2235,10 @@ + this.host = host; + this.serverNames = + Utilities.addToSNIServerNameList(this.serverNames, this.host); ++ ++ if (!roleIsServer && (handshaker != null) && !handshaker.started()) { ++ handshaker.setSNIServerNames(serverNames); ++ } + } + + /** +@@ -2571,8 +2605,21 @@ + // the super implementation does not handle the following parameters + params.setEndpointIdentificationAlgorithm(identificationProtocol); + params.setAlgorithmConstraints(algorithmConstraints); +- params.setSNIMatchers(sniMatchers); +- params.setServerNames(serverNames); ++ ++ if (sniMatchers.isEmpty() && !noSniMatcher) { ++ // 'null' indicates none has been set ++ params.setSNIMatchers(null); ++ } else { ++ params.setSNIMatchers(sniMatchers); ++ } ++ ++ if (serverNames.isEmpty() && !noSniExtension) { ++ // 'null' indicates none has been set ++ params.setServerNames(null); ++ } else { ++ params.setServerNames(serverNames); ++ } ++ + params.setUseCipherSuitesOrder(preferLocalCipherSuites); + + return params; +@@ -2592,11 +2639,13 @@ + + List sniNames = params.getServerNames(); + if (sniNames != null) { ++ noSniExtension = sniNames.isEmpty(); + serverNames = sniNames; + } + + Collection matchers = params.getSNIMatchers(); + if (matchers != null) { ++ noSniMatcher = matchers.isEmpty(); + sniMatchers = matchers; + } + +diff --git a/test/javax/net/ssl/ServerName/BestEffortOnLazyConnected.java b/test/javax/net/ssl/ServerName/BestEffortOnLazyConnected.java +new file mode 100644 +--- /dev/null ++++ openjdk/jdk/test/javax/net/ssl/ServerName/BestEffortOnLazyConnected.java +@@ -0,0 +1,337 @@ ++/* ++ * Copyright (c) 2016, 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. ++ */ ++ ++// ++// SunJSSE does not support dynamic system properties, no way to re-use ++// system properties in samevm/agentvm mode. ++// ++ ++/** ++ * @test ++ * @bug 8144566 ++ * @summary Custom HostnameVerifier disables SNI extension ++ * @run main/othervm BestEffortOnLazyConnected ++ */ ++ ++import java.io.*; ++import java.nio.*; ++import java.nio.channels.*; ++import java.util.*; ++import java.net.*; ++import javax.net.ssl.*; ++ ++public class BestEffortOnLazyConnected { ++ ++ /* ++ * ============================================================= ++ * Set the various variables needed for the tests, then ++ * specify what tests to run on each side. ++ */ ++ ++ /* ++ * Should we run the client or server in a separate thread? ++ * Both sides can throw exceptions, but do you have a preference ++ * as to which side should be the main thread. ++ */ ++ private static final boolean separateServerThread = true; ++ ++ /* ++ * Where do we find the keystores? ++ */ ++ private static final String pathToStores = "../../../../sun/security/ssl/etc"; ++ private static final String keyStoreFile = "keystore"; ++ private static final String trustStoreFile = "truststore"; ++ private static final String passwd = "passphrase"; ++ ++ /* ++ * Is the server ready to serve? ++ */ ++ private static volatile boolean serverReady = false; ++ ++ /* ++ * Turn on SSL debugging? ++ */ ++ private static final boolean debug = false; ++ ++ /* ++ * the fully qualified domain name of localhost ++ */ ++ private static String hostname = null; ++ ++ /* ++ * If the client or server is doing some kind of object creation ++ * that the other side depends on, and that thread prematurely ++ * exits, you may experience a hang. The test harness will ++ * terminate all hung threads after its timeout has expired, ++ * currently 3 minutes by default, but you might try to be ++ * smart about it.... ++ */ ++ ++ /* ++ * Define the server side of the test. ++ * ++ * If the server prematurely exits, serverReady will be set to true ++ * to avoid infinite hangs. ++ */ ++ private void doServerSide() throws Exception { ++ SSLServerSocketFactory sslssf = ++ (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); ++ try (SSLServerSocket sslServerSocket = ++ (SSLServerSocket) sslssf.createServerSocket(serverPort)) { ++ ++ serverPort = sslServerSocket.getLocalPort(); ++ ++ /* ++ * Signal Client, we're ready for his connect. ++ */ ++ serverReady = true; ++ ++ try (SSLSocket sslSocket = (SSLSocket)sslServerSocket.accept()) { ++ InputStream sslIS = sslSocket.getInputStream(); ++ OutputStream sslOS = sslSocket.getOutputStream(); ++ ++ sslIS.read(); ++ sslOS.write(85); ++ sslOS.flush(); ++ ++ ExtendedSSLSession session = ++ (ExtendedSSLSession)sslSocket.getSession(); ++ if (session.getRequestedServerNames().isEmpty()) { ++ throw new Exception("No expected Server Name Indication"); ++ } ++ } ++ } ++ } ++ ++ /* ++ * Define the client side of the test. ++ * ++ * If the server prematurely exits, serverReady will be set to true ++ * to avoid infinite hangs. ++ */ ++ private void doClientSide() throws Exception { ++ ++ /* ++ * Wait for server to get started. ++ */ ++ while (!serverReady) { ++ Thread.sleep(50); ++ } ++ ++ SSLSocketFactory sslsf = ++ (SSLSocketFactory) SSLSocketFactory.getDefault(); ++ ++ try (SSLSocket sslSocket = (SSLSocket)sslsf.createSocket()) { ++ ++ sslSocket.connect(new InetSocketAddress(hostname, serverPort), 0); ++ ++ InputStream sslIS = sslSocket.getInputStream(); ++ OutputStream sslOS = sslSocket.getOutputStream(); ++ ++ sslOS.write(280); ++ sslOS.flush(); ++ sslIS.read(); ++ } ++ } ++ ++ ++ /* ++ * ============================================================= ++ * The remainder is just support stuff ++ */ ++ ++ // use any free port by default ++ private volatile int serverPort = 0; ++ ++ private volatile Exception serverException = null; ++ private volatile Exception clientException = null; ++ ++ public static void main(String[] args) throws Exception { ++ String keyFilename = ++ System.getProperty("test.src", ".") + "/" + pathToStores + ++ "/" + keyStoreFile; ++ String trustFilename = ++ System.getProperty("test.src", ".") + "/" + pathToStores + ++ "/" + trustStoreFile; ++ ++ System.setProperty("javax.net.ssl.keyStore", keyFilename); ++ System.setProperty("javax.net.ssl.keyStorePassword", passwd); ++ System.setProperty("javax.net.ssl.trustStore", trustFilename); ++ System.setProperty("javax.net.ssl.trustStorePassword", passwd); ++ ++ if (debug) { ++ System.setProperty("javax.net.debug", "all"); ++ } ++ ++ try { ++ hostname = InetAddress.getLocalHost().getCanonicalHostName(); ++ } catch (UnknownHostException uhe) { ++ System.out.println( ++ "Ignore the test as the local hostname cannot be determined"); ++ ++ return; ++ } ++ ++ System.out.println( ++ "The fully qualified domain name of the local host is " + ++ hostname); ++ // Ignore the test if the hostname does not sound like a domain name. ++ if ((hostname == null) || hostname.isEmpty() || ++ hostname.startsWith("localhost") || ++ Character.isDigit(hostname.charAt(hostname.length() - 1))) { ++ ++ System.out.println("Ignore the test as the local hostname " + ++ "cannot be determined as fully qualified domain name"); ++ ++ return; ++ } ++ ++ /* ++ * Start the tests. ++ */ ++ new BestEffortOnLazyConnected(); ++ } ++ ++ private Thread clientThread = null; ++ private Thread serverThread = null; ++ ++ /* ++ * Primary constructor, used to drive remainder of the test. ++ * ++ * Fork off the other side, then do your work. ++ */ ++ BestEffortOnLazyConnected() throws Exception { ++ try { ++ if (separateServerThread) { ++ startServer(true); ++ startClient(false); ++ } else { ++ startClient(true); ++ startServer(false); ++ } ++ } catch (Exception e) { ++ // swallow for now. Show later ++ } ++ ++ /* ++ * Wait for other side to close down. ++ */ ++ if (separateServerThread) { ++ serverThread.join(); ++ } else { ++ clientThread.join(); ++ } ++ ++ /* ++ * When we get here, the test is pretty much over. ++ * Which side threw the error? ++ */ ++ Exception local; ++ Exception remote; ++ String whichRemote; ++ ++ if (separateServerThread) { ++ remote = serverException; ++ local = clientException; ++ whichRemote = "server"; ++ } else { ++ remote = clientException; ++ local = serverException; ++ whichRemote = "client"; ++ } ++ ++ /* ++ * If both failed, return the curthread's exception, but also ++ * print the remote side Exception ++ */ ++ if ((local != null) && (remote != null)) { ++ System.out.println(whichRemote + " also threw:"); ++ remote.printStackTrace(); ++ System.out.println(); ++ throw local; ++ } ++ ++ if (remote != null) { ++ throw remote; ++ } ++ ++ if (local != null) { ++ throw local; ++ } ++ } ++ ++ private void startServer(boolean newThread) throws Exception { ++ if (newThread) { ++ serverThread = new Thread() { ++ public void run() { ++ try { ++ doServerSide(); ++ } catch (Exception e) { ++ /* ++ * Our server thread just died. ++ * ++ * Release the client, if not active already... ++ */ ++ System.err.println("Server died..."); ++ serverReady = true; ++ serverException = e; ++ } ++ } ++ }; ++ serverThread.start(); ++ } else { ++ try { ++ doServerSide(); ++ } catch (Exception e) { ++ serverException = e; ++ } finally { ++ serverReady = true; ++ } ++ } ++ } ++ ++ private void startClient(boolean newThread) throws Exception { ++ if (newThread) { ++ clientThread = new Thread() { ++ public void run() { ++ try { ++ doClientSide(); ++ } catch (Exception e) { ++ /* ++ * Our client thread just died. ++ */ ++ System.err.println("Client died..."); ++ clientException = e; ++ } ++ } ++ }; ++ clientThread.start(); ++ } else { ++ try { ++ doClientSide(); ++ } catch (Exception e) { ++ clientException = e; ++ } ++ } ++ } ++} +diff --git a/test/sun/net/www/protocol/https/HttpsURLConnection/ImpactOnSNI.java b/test/sun/net/www/protocol/https/HttpsURLConnection/ImpactOnSNI.java +new file mode 100644 +--- /dev/null ++++ openjdk/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/ImpactOnSNI.java +@@ -0,0 +1,390 @@ ++/* ++ * Copyright (c) 2016, 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. ++ */ ++ ++// ++// SunJSSE does not support dynamic system properties, no way to re-use ++// system properties in samevm/agentvm mode. ++// ++ ++/* ++ * @test ++ * @bug 8144566 ++ * @summary Custom HostnameVerifier disables SNI extension ++ * @run main/othervm ImpactOnSNI ++ */ ++ ++import java.io.*; ++import java.net.*; ++import javax.net.ssl.*; ++ ++public class ImpactOnSNI { ++ ++ /* ++ * ============================================================= ++ * Set the various variables needed for the tests, then ++ * specify what tests to run on each side. ++ */ ++ ++ /* ++ * Should we run the client or server in a separate thread? ++ * Both sides can throw exceptions, but do you have a preference ++ * as to which side should be the main thread. ++ */ ++ private static final boolean separateServerThread = true; ++ ++ /* ++ * Where do we find the keystores? ++ */ ++ private static final String pathToStores = ++ "../../../../../../sun/security/ssl/etc"; ++ private static final String keyStoreFile = "keystore"; ++ private static final String trustStoreFile = "truststore"; ++ private static final String passwd = "passphrase"; ++ ++ /* ++ * Is the server ready to serve? ++ */ ++ private static volatile boolean serverReady = false; ++ ++ /* ++ * Is the connection ready to close? ++ */ ++ private static volatile boolean closeReady = false; ++ ++ /* ++ * Turn on SSL debugging? ++ */ ++ private static final boolean debug = false; ++ ++ /* ++ * Message posted ++ */ ++ private static final String postMsg = "HTTP post on a https server"; ++ ++ /* ++ * the fully qualified domain name of localhost ++ */ ++ private static String hostname = null; ++ ++ /* ++ * If the client or server is doing some kind of object creation ++ * that the other side depends on, and that thread prematurely ++ * exits, you may experience a hang. The test harness will ++ * terminate all hung threads after its timeout has expired, ++ * currently 3 minutes by default, but you might try to be ++ * smart about it.... ++ */ ++ ++ /* ++ * Define the server side of the test. ++ * ++ * If the server prematurely exits, serverReady will be set to true ++ * to avoid infinite hangs. ++ */ ++ private void doServerSide() throws Exception { ++ SSLServerSocketFactory sslssf = ++ (SSLServerSocketFactory)SSLServerSocketFactory.getDefault(); ++ try (SSLServerSocket sslServerSocket = ++ (SSLServerSocket)sslssf.createServerSocket(serverPort)) { ++ ++ serverPort = sslServerSocket.getLocalPort(); ++ ++ /* ++ * Signal Client, we're ready for his connect. ++ */ ++ serverReady = true; ++ ++ /* ++ * Accept connections ++ */ ++ try (SSLSocket sslSocket = (SSLSocket)sslServerSocket.accept()) { ++ InputStream sslIS = sslSocket.getInputStream(); ++ OutputStream sslOS = sslSocket.getOutputStream(); ++ BufferedReader br = ++ new BufferedReader(new InputStreamReader(sslIS)); ++ PrintStream ps = new PrintStream(sslOS); ++ ++ // process HTTP POST request from client ++ System.out.println("status line: " + br.readLine()); ++ String msg = null; ++ while ((msg = br.readLine()) != null && msg.length() > 0); ++ ++ msg = br.readLine(); ++ if (msg.equals(postMsg)) { ++ ps.println("HTTP/1.1 200 OK\n\n"); ++ } else { ++ ps.println("HTTP/1.1 500 Not OK\n\n"); ++ } ++ ps.flush(); ++ ++ ExtendedSSLSession session = ++ (ExtendedSSLSession)sslSocket.getSession(); ++ if (session.getRequestedServerNames().isEmpty()) { ++ throw new Exception("No expected Server Name Indication"); ++ } ++ ++ // close the socket ++ while (!closeReady) { ++ Thread.sleep(50); ++ } ++ } ++ } ++ } ++ ++ /* ++ * Define the client side of the test. ++ * ++ * If the server prematurely exits, serverReady will be set to true ++ * to avoid infinite hangs. ++ */ ++ private void doClientSide() throws Exception { ++ /* ++ * Wait for server to get started. ++ */ ++ while (!serverReady) { ++ Thread.sleep(50); ++ } ++ ++ // Send HTTP POST request to server ++ URL url = new URL("https://" + hostname + ":" + serverPort); ++ ++ HttpsURLConnection.setDefaultHostnameVerifier(new NameVerifier()); ++ HttpsURLConnection http = (HttpsURLConnection)url.openConnection(); ++ http.setDoOutput(true); ++ ++ http.setRequestMethod("POST"); ++ PrintStream ps = new PrintStream(http.getOutputStream()); ++ try { ++ ps.println(postMsg); ++ ps.flush(); ++ if (http.getResponseCode() != 200) { ++ throw new RuntimeException("test Failed"); ++ } ++ } finally { ++ ps.close(); ++ http.disconnect(); ++ closeReady = true; ++ } ++ } ++ ++ private static class NameVerifier implements HostnameVerifier { ++ public boolean verify(String hostname, SSLSession session) { ++ return true; ++ } ++ } ++ ++ /* ++ * ============================================================= ++ * The remainder is just support stuff ++ */ ++ ++ // use any free port by default ++ private volatile int serverPort = 0; ++ ++ private volatile Exception serverException = null; ++ private volatile Exception clientException = null; ++ ++ public static void main(String[] args) throws Exception { ++ String keyFilename = ++ System.getProperty("test.src", "./") + "/" + pathToStores + ++ "/" + keyStoreFile; ++ String trustFilename = ++ System.getProperty("test.src", "./") + "/" + pathToStores + ++ "/" + trustStoreFile; ++ ++ System.setProperty("javax.net.ssl.keyStore", keyFilename); ++ System.setProperty("javax.net.ssl.keyStorePassword", passwd); ++ System.setProperty("javax.net.ssl.trustStore", trustFilename); ++ System.setProperty("javax.net.ssl.trustStorePassword", passwd); ++ ++ if (debug) { ++ System.setProperty("javax.net.debug", "all"); ++ } ++ ++ try { ++ hostname = InetAddress.getLocalHost().getCanonicalHostName(); ++ } catch (UnknownHostException uhe) { ++ System.out.println( ++ "Ignore the test as the local hostname cannot be determined"); ++ ++ return; ++ } ++ ++ System.out.println( ++ "The fully qualified domain name of the local host is " + ++ hostname); ++ // Ignore the test if the hostname does not sound like a domain name. ++ if ((hostname == null) || hostname.isEmpty() || ++ hostname.startsWith("localhost") || ++ Character.isDigit(hostname.charAt(hostname.length() - 1))) { ++ ++ System.out.println("Ignore the test as the local hostname " + ++ "cannot be determined as fully qualified domain name"); ++ ++ return; ++ } ++ ++ /* ++ * Start the tests. ++ */ ++ new ImpactOnSNI(); ++ } ++ ++ private Thread clientThread = null; ++ private Thread serverThread = null; ++ ++ /* ++ * Primary constructor, used to drive remainder of the test. ++ * ++ * Fork off the other side, then do your work. ++ */ ++ ImpactOnSNI() throws Exception { ++ Exception startException = null; ++ try { ++ if (separateServerThread) { ++ startServer(true); ++ startClient(false); ++ } else { ++ startClient(true); ++ startServer(false); ++ } ++ } catch (Exception e) { ++ startException = e; ++ } ++ ++ /* ++ * Wait for other side to close down. ++ */ ++ if (separateServerThread) { ++ if (serverThread != null) { ++ serverThread.join(); ++ } ++ } else { ++ if (clientThread != null) { ++ clientThread.join(); ++ } ++ } ++ ++ /* ++ * When we get here, the test is pretty much over. ++ * Which side threw the error? ++ */ ++ Exception local; ++ Exception remote; ++ ++ if (separateServerThread) { ++ remote = serverException; ++ local = clientException; ++ } else { ++ remote = clientException; ++ local = serverException; ++ } ++ ++ Exception exception = null; ++ ++ /* ++ * Check various exception conditions. ++ */ ++ if ((local != null) && (remote != null)) { ++ // If both failed, return the curthread's exception. ++ local.initCause(remote); ++ exception = local; ++ } else if (local != null) { ++ exception = local; ++ } else if (remote != null) { ++ exception = remote; ++ } else if (startException != null) { ++ exception = startException; ++ } ++ ++ /* ++ * If there was an exception *AND* a startException, ++ * output it. ++ */ ++ if (exception != null) { ++ if (exception != startException && startException != null) { ++ exception.addSuppressed(startException); ++ } ++ throw exception; ++ } ++ ++ // Fall-through: no exception to throw! ++ } ++ ++ private void startServer(boolean newThread) throws Exception { ++ if (newThread) { ++ serverThread = new Thread() { ++ @Override ++ public void run() { ++ try { ++ doServerSide(); ++ } catch (Exception e) { ++ /* ++ * Our server thread just died. ++ * ++ * Release the client, if not active already... ++ */ ++ System.err.println("Server died..."); ++ serverReady = true; ++ serverException = e; ++ } ++ } ++ }; ++ serverThread.start(); ++ } else { ++ try { ++ doServerSide(); ++ } catch (Exception e) { ++ serverException = e; ++ } finally { ++ serverReady = true; ++ } ++ } ++ } ++ ++ private void startClient(boolean newThread) throws Exception { ++ if (newThread) { ++ clientThread = new Thread() { ++ @Override ++ public void run() { ++ try { ++ doClientSide(); ++ } catch (Exception e) { ++ /* ++ * Our client thread just died. ++ */ ++ System.err.println("Client died..."); ++ clientException = e; ++ } ++ } ++ }; ++ clientThread.start(); ++ } else { ++ try { ++ doClientSide(); ++ } catch (Exception e) { ++ clientException = e; ++ } ++ } ++ } ++} diff --git a/SOURCES/8155049-pr3352.patch b/SOURCES/8155049-pr3352.patch new file mode 100644 index 0000000..68cf02f --- /dev/null +++ b/SOURCES/8155049-pr3352.patch @@ -0,0 +1,41 @@ +# HG changeset patch +# User rhalade +# Date 1463420211 25200 +# Mon May 16 10:36:51 2016 -0700 +# Node ID c0e856f2dacdf5eb5cdea380da32ba210aee9579 +# Parent fb617df8fbac42e962219e45cbd29b15b5ecdc63 +8155049, PR3352: New tests from 8144566 fail with "No expected Server Name Indication" +Reviewed-by: xuelei + +diff --git a/test/javax/net/ssl/ServerName/BestEffortOnLazyConnected.java b/test/javax/net/ssl/ServerName/BestEffortOnLazyConnected.java +--- openjdk/jdk/test/javax/net/ssl/ServerName/BestEffortOnLazyConnected.java ++++ openjdk/jdk/test/javax/net/ssl/ServerName/BestEffortOnLazyConnected.java +@@ -34,9 +34,6 @@ + */ + + import java.io.*; +-import java.nio.*; +-import java.nio.channels.*; +-import java.util.*; + import java.net.*; + import javax.net.ssl.*; + +@@ -197,6 +194,7 @@ + hostname); + // Ignore the test if the hostname does not sound like a domain name. + if ((hostname == null) || hostname.isEmpty() || ++ !hostname.contains(".") || hostname.endsWith(".") || + hostname.startsWith("localhost") || + Character.isDigit(hostname.charAt(hostname.length() - 1))) { + +diff --git a/test/sun/net/www/protocol/https/HttpsURLConnection/ImpactOnSNI.java b/test/sun/net/www/protocol/https/HttpsURLConnection/ImpactOnSNI.java +--- openjdk/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/ImpactOnSNI.java ++++ openjdk/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/ImpactOnSNI.java +@@ -235,6 +235,7 @@ + hostname); + // Ignore the test if the hostname does not sound like a domain name. + if ((hostname == null) || hostname.isEmpty() || ++ !hostname.contains(".") || hostname.endsWith(".") || + hostname.startsWith("localhost") || + Character.isDigit(hostname.charAt(hostname.length() - 1))) { + diff --git a/SOURCES/8165231-rh1437545.patch b/SOURCES/8165231-rh1437545.patch new file mode 100644 index 0000000..e0d5be7 --- /dev/null +++ b/SOURCES/8165231-rh1437545.patch @@ -0,0 +1,48 @@ +# HG changeset patch +# User horii +# Date 1473905514 14400 +# Wed Sep 14 22:11:54 2016 -0400 +# Node ID 8d16f74380a78eb76cb33183a64440316393903e +# Parent be698ac288484ab140715ee29ed9335e6ea8a33b +8165231: java.nio.Bits.unaligned() doesn't return true on ppc +Reviewed-by: simonis, coffeys + +diff --git a/src/share/classes/java/nio/Bits.java b/src/share/classes/java/nio/Bits.java +--- openjdk/jdk/src/share/classes/java/nio/Bits.java ++++ openjdk/jdk/src/share/classes/java/nio/Bits.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2000, 2016, 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 +@@ -614,7 +614,8 @@ + String arch = AccessController.doPrivileged( + new sun.security.action.GetPropertyAction("os.arch")); + unaligned = arch.equals("i386") || arch.equals("x86") +- || arch.equals("amd64") || arch.equals("x86_64"); ++ || arch.equals("amd64") || arch.equals("x86_64") ++ || arch.equals("ppc64") || arch.equals("ppc64le"); + unalignedKnown = true; + return unaligned; + } +diff --git a/src/share/classes/sun/security/provider/ByteArrayAccess.java b/src/share/classes/sun/security/provider/ByteArrayAccess.java +--- openjdk/jdk/src/share/classes/sun/security/provider/ByteArrayAccess.java ++++ openjdk/jdk/src/share/classes/sun/security/provider/ByteArrayAccess.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2006, 2016, 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 +@@ -94,7 +94,7 @@ + String arch = java.security.AccessController.doPrivileged + (new sun.security.action.GetPropertyAction("os.arch", "")); + return arch.equals("i386") || arch.equals("x86") || arch.equals("amd64") +- || arch.equals("x86_64"); ++ || arch.equals("x86_64") || arch.equals("ppc64") || arch.equals("ppc64le"); + } + + /** diff --git a/SOURCES/8174164-pr3334-rh1417266.patch b/SOURCES/8174164-pr3334-rh1417266.patch new file mode 100644 index 0000000..494883f --- /dev/null +++ b/SOURCES/8174164-pr3334-rh1417266.patch @@ -0,0 +1,79 @@ +# HG changeset patch +# User roland +# Date 1487208397 28800 +# Wed Feb 15 17:26:37 2017 -0800 +# Node ID a9cbaff50d3d7e3a1d2dbdc0121c470142b87270 +# Parent 15922b2f31db4857ec84efdf533c41b19e68030b +8174164, PR3334, RH1417266: SafePointNode::_replaced_nodes breaks with irreducible loops +Reviewed-by: kvn + +diff --git a/src/share/vm/opto/callnode.hpp b/src/share/vm/opto/callnode.hpp +--- openjdk/hotspot/src/share/vm/opto/callnode.hpp ++++ openjdk/hotspot/src/share/vm/opto/callnode.hpp +@@ -449,8 +449,8 @@ + void delete_replaced_nodes() { + _replaced_nodes.reset(); + } +- void apply_replaced_nodes() { +- _replaced_nodes.apply(this); ++ void apply_replaced_nodes(uint idx) { ++ _replaced_nodes.apply(this, idx); + } + void merge_replaced_nodes_with(SafePointNode* sfpt) { + _replaced_nodes.merge_with(sfpt->_replaced_nodes); +diff --git a/src/share/vm/opto/parse1.cpp b/src/share/vm/opto/parse1.cpp +--- openjdk/hotspot/src/share/vm/opto/parse1.cpp ++++ openjdk/hotspot/src/share/vm/opto/parse1.cpp +@@ -1048,7 +1048,7 @@ + kit.make_dtrace_method_exit(method()); + } + if (_replaced_nodes_for_exceptions) { +- kit.map()->apply_replaced_nodes(); ++ kit.map()->apply_replaced_nodes(_new_idx); + } + // Done with exception-path processing. + ex_map = kit.make_exception_state(ex_oop); +@@ -1069,7 +1069,7 @@ + _exits.add_exception_state(ex_map); + } + } +- _exits.map()->apply_replaced_nodes(); ++ _exits.map()->apply_replaced_nodes(_new_idx); + } + + //-----------------------------create_entry_map------------------------------- +diff --git a/src/share/vm/opto/replacednodes.cpp b/src/share/vm/opto/replacednodes.cpp +--- openjdk/hotspot/src/share/vm/opto/replacednodes.cpp ++++ openjdk/hotspot/src/share/vm/opto/replacednodes.cpp +@@ -91,13 +91,17 @@ + } + + // Perfom node replacement (used when returning to caller) +-void ReplacedNodes::apply(Node* n) { ++void ReplacedNodes::apply(Node* n, uint idx) { + if (is_empty()) { + return; + } + for (int i = 0; i < _replaced_nodes->length(); i++) { + ReplacedNode replaced = _replaced_nodes->at(i); +- n->replace_edge(replaced.initial(), replaced.improved()); ++ // Only apply if improved node was created in a callee to avoid ++ // issues with irreducible loops in the caller ++ if (replaced.improved()->_idx >= idx) { ++ n->replace_edge(replaced.initial(), replaced.improved()); ++ } + } + } + +diff --git a/src/share/vm/opto/replacednodes.hpp b/src/share/vm/opto/replacednodes.hpp +--- openjdk/hotspot/src/share/vm/opto/replacednodes.hpp ++++ openjdk/hotspot/src/share/vm/opto/replacednodes.hpp +@@ -71,7 +71,7 @@ + void record(Node* initial, Node* improved); + void transfer_from(const ReplacedNodes& other, uint idx); + void reset(); +- void apply(Node* n); ++ void apply(Node* n, uint idx); + void merge_with(const ReplacedNodes& other); + bool is_empty() const; + void dump(outputStream *st) const; diff --git a/SOURCES/8174729-pr3336-rh1420518.patch b/SOURCES/8174729-pr3336-rh1420518.patch new file mode 100644 index 0000000..3d67850 --- /dev/null +++ b/SOURCES/8174729-pr3336-rh1420518.patch @@ -0,0 +1,122 @@ +# HG changeset patch +# User adinn +# Date 1487931564 0 +# Fri Feb 24 10:19:24 2017 +0000 +# Node ID d41592af9af3790fe5eee30ce686d85cff09c942 +# Parent 1ac9b0f1bf17fc5935bfa8250550eabc2ffb6785 +8174729, PR3336, RH1420518: Race Condition in java.lang.reflect.WeakCache +Summary: Race can occur between Proxy.getProxyClass and Proxy.isProxyClass +Reviewed-by: mchung + +diff --git a/src/share/classes/java/lang/reflect/WeakCache.java b/src/share/classes/java/lang/reflect/WeakCache.java +--- openjdk/jdk/src/share/classes/java/lang/reflect/WeakCache.java ++++ openjdk/jdk/src/share/classes/java/lang/reflect/WeakCache.java +@@ -239,11 +239,11 @@ + // wrap value with CacheValue (WeakReference) + CacheValue cacheValue = new CacheValue<>(value); + ++ // put into reverseMap ++ reverseMap.put(cacheValue, Boolean.TRUE); ++ + // try replacing us with CacheValue (this should always succeed) +- if (valuesMap.replace(subKey, this, cacheValue)) { +- // put also in reverseMap +- reverseMap.put(cacheValue, Boolean.TRUE); +- } else { ++ if (!valuesMap.replace(subKey, this, cacheValue)) { + throw new AssertionError("Should not reach here"); + } + +diff --git a/test/java/lang/reflect/Proxy/ProxyRace.java b/test/java/lang/reflect/Proxy/ProxyRace.java +new file mode 100644 +--- /dev/null ++++ openjdk/jdk/test/java/lang/reflect/Proxy/ProxyRace.java +@@ -0,0 +1,88 @@ ++/* ++ * Copyright (c) 2017, 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. ++ */ ++ ++import java.lang.reflect.Proxy; ++import java.util.concurrent.ExecutorService; ++import java.util.concurrent.Executors; ++import java.util.concurrent.Phaser; ++import java.util.concurrent.TimeUnit; ++import java.util.concurrent.atomic.AtomicInteger; ++ ++/** ++ * @test ++ * @bug 8174729 ++ * @summary Proxy.getProxyClass() / Proxy.isProxyClass() race detector ++ * @run main ProxyRace ++ * @author plevart ++ */ ++ ++public class ProxyRace { ++ ++ static final int threads = 8; ++ ++ static volatile ClassLoader classLoader; ++ static volatile boolean terminate; ++ static final AtomicInteger racesDetected = new AtomicInteger(); ++ ++ public static void main(String[] args) throws Exception { ++ ++ Phaser phaser = new Phaser(threads) { ++ @Override ++ protected boolean onAdvance(int phase, int registeredParties) { ++ // install new ClassLoader on each advance ++ classLoader = new CL(); ++ return terminate; ++ } ++ }; ++ ++ ExecutorService exe = Executors.newFixedThreadPool(threads); ++ ++ for (int i = 0; i < threads; i++) { ++ exe.execute(() -> { ++ while (phaser.arriveAndAwaitAdvance() >= 0) { ++ Class proxyClass = Proxy.getProxyClass(classLoader, Runnable.class); ++ if (!Proxy.isProxyClass(proxyClass)) { ++ racesDetected.incrementAndGet(); ++ } ++ } ++ }); ++ } ++ ++ Thread.sleep(5000L); ++ ++ terminate = true; ++ exe.shutdown(); ++ exe.awaitTermination(5L, TimeUnit.SECONDS); ++ ++ System.out.println(racesDetected.get() + " races detected"); ++ if (racesDetected.get() != 0) { ++ throw new RuntimeException(racesDetected.get() + " races detected"); ++ } ++ } ++ ++ static class CL extends ClassLoader { ++ public CL() { ++ super(ClassLoader.getSystemClassLoader()); ++ } ++ } ++} diff --git a/SOURCES/8175097-pr3334-rh1417266.patch b/SOURCES/8175097-pr3334-rh1417266.patch new file mode 100644 index 0000000..e80dd11 --- /dev/null +++ b/SOURCES/8175097-pr3334-rh1417266.patch @@ -0,0 +1,100 @@ +# HG changeset patch +# User roland +# Date 1487286884 28800 +# Thu Feb 16 15:14:44 2017 -0800 +# Node ID 1b4eb44fbfcd0fceb485d89d91eb893d99f5864b +# Parent a9cbaff50d3d7e3a1d2dbdc0121c470142b87270 +8175097, PR3334, RH1417266: [TESTBUG] 8174164 fix missed the test +Reviewed-by: kvn + +diff --git a/test/compiler/c2/TestReplacedNodesOSR.java b/test/compiler/c2/TestReplacedNodesOSR.java +new file mode 100644 +--- /dev/null ++++ openjdk/hotspot/test/compiler/c2/TestReplacedNodesOSR.java +@@ -0,0 +1,86 @@ ++/* ++ * Copyright (c) 2017, 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 8174164 ++ * @summary SafePointNode::_replaced_nodes breaks with irreducible loops ++ * @run main/othervm -XX:-BackgroundCompilation TestReplacedNodesOSR ++ * ++ */ ++ ++public class TestReplacedNodesOSR { ++ ++ static Object dummy; ++ ++ static interface I { ++ } ++ ++ static class A implements I { ++ } ++ ++ static final class MyException extends Exception { ++ } ++ ++ static final A obj = new A(); ++ static I static_field() { return obj; } ++ ++ // When OSR compiled, this method has an irreducible loop ++ static void test(int v, MyException e) { ++ int i = 0; ++ for (;;) { ++ if (i == 1000) { ++ break; ++ } ++ try { ++ if ((i%2) == 0) { ++ int j = 0; ++ for (;;) { ++ j++; ++ if (i+j != v) { ++ if (j == 1000) { ++ break; ++ } ++ } else { ++ A a = (A)static_field(); ++ // replaced node recorded here ++ throw e; ++ } ++ } ++ } ++ } catch(MyException ex) { ++ } ++ i++; ++ // replaced node applied on return of the method ++ // replaced node used here ++ dummy = static_field(); ++ } ++ } ++ ++ ++ static public void main(String[] args) { ++ for (int i = 0; i < 1000; i++) { ++ test(1100, new MyException()); ++ } ++ } ++} diff --git a/SOURCES/8175813-pr3394-rh1448880.patch b/SOURCES/8175813-pr3394-rh1448880.patch new file mode 100644 index 0000000..6baf79c --- /dev/null +++ b/SOURCES/8175813-pr3394-rh1448880.patch @@ -0,0 +1,282 @@ +# HG changeset patch +# User gromero +# Date 1495057954 14400 +# Wed May 17 17:52:34 2017 -0400 +# Node ID 74c81011375b5f432df155dcd7b3c9a668b45740 +# Parent 4d9931ebf8617b1b06adbc1beee6ed1b58661a8b +8175813: PPC64: "mbind: Invalid argument" when -XX:+UseNUMA is used + +diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp +--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp ++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp +@@ -2736,8 +2736,9 @@ + bool os::numa_topology_changed() { return false; } + + size_t os::numa_get_groups_num() { +- int max_node = Linux::numa_max_node(); +- return max_node > 0 ? max_node + 1 : 1; ++ // Return just the number of nodes in which it's possible to allocate memory ++ // (in numa terminology, configured nodes). ++ return Linux::numa_num_configured_nodes(); + } + + int os::numa_get_group_id() { +@@ -2751,11 +2752,33 @@ + return 0; + } + ++int os::Linux::get_existing_num_nodes() { ++ size_t node; ++ size_t highest_node_number = Linux::numa_max_node(); ++ int num_nodes = 0; ++ ++ // Get the total number of nodes in the system including nodes without memory. ++ for (node = 0; node <= highest_node_number; node++) { ++ if (isnode_in_existing_nodes(node)) { ++ num_nodes++; ++ } ++ } ++ return num_nodes; ++} ++ + size_t os::numa_get_leaf_groups(int *ids, size_t size) { +- for (size_t i = 0; i < size; i++) { +- ids[i] = i; +- } +- return size; ++ size_t 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 ++ // 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)) { ++ ids[i++] = node; ++ } ++ } ++ return i; + } + + bool os::get_page_info(char *start, page_info* info) { +@@ -2825,18 +2848,28 @@ + libnuma_dlsym(handle, "numa_node_to_cpus"))); + set_numa_max_node(CAST_TO_FN_PTR(numa_max_node_func_t, + libnuma_dlsym(handle, "numa_max_node"))); ++ set_numa_num_configured_nodes(CAST_TO_FN_PTR(numa_num_configured_nodes_func_t, ++ libnuma_dlsym(handle, "numa_num_configured_nodes"))); + set_numa_available(CAST_TO_FN_PTR(numa_available_func_t, + libnuma_dlsym(handle, "numa_available"))); + set_numa_tonode_memory(CAST_TO_FN_PTR(numa_tonode_memory_func_t, + libnuma_dlsym(handle, "numa_tonode_memory"))); + set_numa_interleave_memory(CAST_TO_FN_PTR(numa_interleave_memory_func_t, +- libnuma_dlsym(handle, "numa_interleave_memory"))); ++ libnuma_dlsym(handle, "numa_interleave_memory"))); + set_numa_set_bind_policy(CAST_TO_FN_PTR(numa_set_bind_policy_func_t, +- libnuma_dlsym(handle, "numa_set_bind_policy"))); +- ++ libnuma_dlsym(handle, "numa_set_bind_policy"))); ++ set_numa_bitmask_isbitset(CAST_TO_FN_PTR(numa_bitmask_isbitset_func_t, ++ libnuma_dlsym(handle, "numa_bitmask_isbitset"))); ++ set_numa_distance(CAST_TO_FN_PTR(numa_distance_func_t, ++ libnuma_dlsym(handle, "numa_distance"))); + + if (numa_available() != -1) { + set_numa_all_nodes((unsigned long*)libnuma_dlsym(handle, "numa_all_nodes")); ++ set_numa_all_nodes_ptr((struct bitmask **)libnuma_dlsym(handle, "numa_all_nodes_ptr")); ++ set_numa_nodes_ptr((struct bitmask **)libnuma_dlsym(handle, "numa_nodes_ptr")); ++ // Create an index -> node mapping, since nodes are not always consecutive ++ _nindex_to_node = new (ResourceObj::C_HEAP, mtInternal) GrowableArray(0, true); ++ rebuild_nindex_to_node_map(); + // Create a cpu -> node mapping + _cpu_to_node = new (ResourceObj::C_HEAP, mtInternal) GrowableArray(0, true); + rebuild_cpu_to_node_map(); +@@ -2847,6 +2880,17 @@ + return false; + } + ++void os::Linux::rebuild_nindex_to_node_map() { ++ int highest_node_number = Linux::numa_max_node(); ++ ++ nindex_to_node()->clear(); ++ for (int node = 0; node <= highest_node_number; node++) { ++ if (Linux::isnode_in_existing_nodes(node)) { ++ nindex_to_node()->append(node); ++ } ++ } ++} ++ + // rebuild_cpu_to_node_map() constructs a table mapping cpud id to node id. + // The table is later used in get_node_by_cpu(). + void os::Linux::rebuild_cpu_to_node_map() { +@@ -2866,16 +2910,46 @@ + + cpu_to_node()->clear(); + cpu_to_node()->at_grow(cpu_num - 1); +- size_t node_num = numa_get_groups_num(); +- ++ ++ size_t node_num = get_existing_num_nodes(); ++ ++ int distance = 0; ++ int closest_distance = INT_MAX; ++ int closest_node = 0; + unsigned long *cpu_map = NEW_C_HEAP_ARRAY(unsigned long, cpu_map_size, mtInternal); + for (size_t i = 0; i < node_num; i++) { +- if (numa_node_to_cpus(i, cpu_map, cpu_map_size * sizeof(unsigned long)) != -1) { ++ // Check if node is configured (not a memory-less node). If it is not, find ++ // the closest configured node. ++ if (!isnode_in_configured_nodes(nindex_to_node()->at(i))) { ++ closest_distance = INT_MAX; ++ // Check distance from all remaining nodes in the system. Ignore distance ++ // from itself and from another non-configured node. ++ for (size_t m = 0; m < node_num; m++) { ++ if (m != i && isnode_in_configured_nodes(nindex_to_node()->at(m))) { ++ distance = numa_distance(nindex_to_node()->at(i), nindex_to_node()->at(m)); ++ // If a closest node is found, update. There is always at least one ++ // configured node in the system so there is always at least one node ++ // close. ++ if (distance != 0 && distance < closest_distance) { ++ closest_distance = distance; ++ closest_node = nindex_to_node()->at(m); ++ } ++ } ++ } ++ } else { ++ // Current node is already a configured node. ++ closest_node = nindex_to_node()->at(i); ++ } ++ ++ // Get cpus from the original node and map them to the closest node. If node ++ // is a configured node (not a memory-less node), then original node and ++ // closest node are the same. ++ if (numa_node_to_cpus(nindex_to_node()->at(i), cpu_map, cpu_map_size * sizeof(unsigned long)) != -1) { + for (size_t j = 0; j < cpu_map_valid_size; j++) { + if (cpu_map[j] != 0) { + for (size_t k = 0; k < BitsPerCLong; k++) { + if (cpu_map[j] & (1UL << k)) { +- cpu_to_node()->at_put(j * BitsPerCLong + k, i); ++ cpu_to_node()->at_put(j * BitsPerCLong + k, closest_node); + } + } + } +@@ -2893,14 +2967,20 @@ + } + + GrowableArray* os::Linux::_cpu_to_node; ++GrowableArray* os::Linux::_nindex_to_node; + os::Linux::sched_getcpu_func_t os::Linux::_sched_getcpu; + os::Linux::numa_node_to_cpus_func_t os::Linux::_numa_node_to_cpus; + os::Linux::numa_max_node_func_t os::Linux::_numa_max_node; ++os::Linux::numa_num_configured_nodes_func_t os::Linux::_numa_num_configured_nodes; + os::Linux::numa_available_func_t os::Linux::_numa_available; + os::Linux::numa_tonode_memory_func_t os::Linux::_numa_tonode_memory; + os::Linux::numa_interleave_memory_func_t os::Linux::_numa_interleave_memory; + os::Linux::numa_set_bind_policy_func_t os::Linux::_numa_set_bind_policy; ++os::Linux::numa_bitmask_isbitset_func_t os::Linux::_numa_bitmask_isbitset; ++os::Linux::numa_distance_func_t os::Linux::_numa_distance; + unsigned long* os::Linux::_numa_all_nodes; ++struct bitmask* os::Linux::_numa_all_nodes_ptr; ++struct bitmask* os::Linux::_numa_nodes_ptr; + + bool os::pd_uncommit_memory(char* addr, size_t size) { + uintptr_t res = (uintptr_t) ::mmap(addr, size, PROT_NONE, +diff --git a/src/os/linux/vm/os_linux.hpp b/src/os/linux/vm/os_linux.hpp +--- openjdk/hotspot/src/os/linux/vm/os_linux.hpp ++++ openjdk/hotspot/src/os/linux/vm/os_linux.hpp +@@ -67,6 +67,7 @@ + static bool _supports_fast_thread_cpu_time; + + static GrowableArray* _cpu_to_node; ++ static GrowableArray* _nindex_to_node; + + protected: + +@@ -94,7 +95,9 @@ + static void set_is_floating_stack() { _is_floating_stack = true; } + + static void rebuild_cpu_to_node_map(); ++ static void rebuild_nindex_to_node_map(); + static GrowableArray* cpu_to_node() { return _cpu_to_node; } ++ static GrowableArray* nindex_to_node() { return _nindex_to_node; } + + static size_t find_large_page_size(); + static size_t setup_large_page_size(); +@@ -243,28 +246,41 @@ + typedef int (*sched_getcpu_func_t)(void); + typedef int (*numa_node_to_cpus_func_t)(int node, unsigned long *buffer, int bufferlen); + typedef int (*numa_max_node_func_t)(void); ++ typedef int (*numa_num_configured_nodes_func_t)(void); + typedef int (*numa_available_func_t)(void); + typedef int (*numa_tonode_memory_func_t)(void *start, size_t size, int node); + typedef void (*numa_interleave_memory_func_t)(void *start, size_t size, unsigned long *nodemask); + typedef void (*numa_set_bind_policy_func_t)(int policy); ++ typedef int (*numa_bitmask_isbitset_func_t)(struct bitmask *bmp, unsigned int n); ++ typedef int (*numa_distance_func_t)(int node1, int node2); + + static sched_getcpu_func_t _sched_getcpu; + static numa_node_to_cpus_func_t _numa_node_to_cpus; + static numa_max_node_func_t _numa_max_node; ++ static numa_num_configured_nodes_func_t _numa_num_configured_nodes; + static numa_available_func_t _numa_available; + static numa_tonode_memory_func_t _numa_tonode_memory; + static numa_interleave_memory_func_t _numa_interleave_memory; + static numa_set_bind_policy_func_t _numa_set_bind_policy; ++ static numa_bitmask_isbitset_func_t _numa_bitmask_isbitset; ++ static numa_distance_func_t _numa_distance; + static unsigned long* _numa_all_nodes; ++ static struct bitmask* _numa_all_nodes_ptr; ++ static struct bitmask* _numa_nodes_ptr; + + static void set_sched_getcpu(sched_getcpu_func_t func) { _sched_getcpu = func; } + static void set_numa_node_to_cpus(numa_node_to_cpus_func_t func) { _numa_node_to_cpus = func; } + static void set_numa_max_node(numa_max_node_func_t func) { _numa_max_node = func; } ++ static void set_numa_num_configured_nodes(numa_num_configured_nodes_func_t func) { _numa_num_configured_nodes = func; } + static void set_numa_available(numa_available_func_t func) { _numa_available = func; } + static void set_numa_tonode_memory(numa_tonode_memory_func_t func) { _numa_tonode_memory = func; } + static void set_numa_interleave_memory(numa_interleave_memory_func_t func) { _numa_interleave_memory = func; } + static void set_numa_set_bind_policy(numa_set_bind_policy_func_t func) { _numa_set_bind_policy = func; } ++ static void set_numa_bitmask_isbitset(numa_bitmask_isbitset_func_t func) { _numa_bitmask_isbitset = func; } ++ static void set_numa_distance(numa_distance_func_t func) { _numa_distance = func; } + static void set_numa_all_nodes(unsigned long* ptr) { _numa_all_nodes = ptr; } ++ static void set_numa_all_nodes_ptr(struct bitmask **ptr) { _numa_all_nodes_ptr = *ptr; } ++ static void set_numa_nodes_ptr(struct bitmask **ptr) { _numa_nodes_ptr = *ptr; } + static int sched_getcpu_syscall(void); + public: + static int sched_getcpu() { return _sched_getcpu != NULL ? _sched_getcpu() : -1; } +@@ -272,6 +288,9 @@ + return _numa_node_to_cpus != NULL ? _numa_node_to_cpus(node, buffer, bufferlen) : -1; + } + static int numa_max_node() { return _numa_max_node != NULL ? _numa_max_node() : -1; } ++ static int numa_num_configured_nodes() { ++ return _numa_num_configured_nodes != NULL ? _numa_num_configured_nodes() : -1; ++ } + static int numa_available() { return _numa_available != NULL ? _numa_available() : -1; } + static int numa_tonode_memory(void *start, size_t size, int node) { + return _numa_tonode_memory != NULL ? _numa_tonode_memory(start, size, node) : -1; +@@ -286,7 +305,25 @@ + _numa_set_bind_policy(policy); + } + } ++ static int numa_distance(int node1, int node2) { ++ return _numa_distance != NULL ? _numa_distance(node1, node2) : -1; ++ } + static int get_node_by_cpu(int cpu_id); ++ static int get_existing_num_nodes(); ++ // Check if numa node is configured (non-zero memory node). ++ static bool isnode_in_configured_nodes(unsigned int n) { ++ if (_numa_bitmask_isbitset != NULL && _numa_all_nodes_ptr != NULL) { ++ return _numa_bitmask_isbitset(_numa_all_nodes_ptr, n); ++ } else ++ return 0; ++ } ++ // Check if numa node exists in the system (including zero memory nodes). ++ static bool isnode_in_existing_nodes(unsigned int n) { ++ if (_numa_bitmask_isbitset != NULL && _numa_nodes_ptr != NULL) { ++ return _numa_bitmask_isbitset(_numa_nodes_ptr, n); ++ } else ++ return 0; ++ } + }; + + diff --git a/SOURCES/8175887-pr3415.patch b/SOURCES/8175887-pr3415.patch deleted file mode 100644 index 6460f60..0000000 --- a/SOURCES/8175887-pr3415.patch +++ /dev/null @@ -1,168 +0,0 @@ -# HG changeset patch -# User shade -# Date 1488979372 -3600 -# Wed Mar 08 14:22:52 2017 +0100 -# Node ID 654b7fcb4932d48063f5f1fba0c8994db5e02976 -# Parent 1faf7c17089922f6f72b580253725f2ecb6ba2f8 -8175887, PR3415: C1 value numbering handling of Unsafe.get*Volatile is incorrect -Reviewed-by: vlivanov - -diff --git a/src/share/vm/c1/c1_ValueMap.hpp b/src/share/vm/c1/c1_ValueMap.hpp ---- openjdk/hotspot/src/share/vm/c1/c1_ValueMap.hpp -+++ openjdk/hotspot/src/share/vm/c1/c1_ValueMap.hpp -@@ -158,6 +158,12 @@ - void do_UnsafePutRaw (UnsafePutRaw* x) { kill_memory(); } - void do_UnsafePutObject(UnsafePutObject* x) { kill_memory(); } - void do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) { kill_memory(); } -+ void do_UnsafeGetRaw (UnsafeGetRaw* x) { /* nothing to do */ } -+ void do_UnsafeGetObject(UnsafeGetObject* x) { -+ if (x->is_volatile()) { // the JMM requires this -+ kill_memory(); -+ } -+ } - void do_Intrinsic (Intrinsic* x) { if (!x->preserves_state()) kill_memory(); } - - void do_Phi (Phi* x) { /* nothing to do */ } -@@ -198,8 +204,6 @@ - void do_OsrEntry (OsrEntry* x) { /* nothing to do */ } - void do_ExceptionObject(ExceptionObject* x) { /* nothing to do */ } - void do_RoundFP (RoundFP* x) { /* nothing to do */ } -- void do_UnsafeGetRaw (UnsafeGetRaw* x) { /* nothing to do */ } -- void do_UnsafeGetObject(UnsafeGetObject* x) { /* nothing to do */ } - void do_UnsafePrefetchRead (UnsafePrefetchRead* x) { /* nothing to do */ } - void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) { /* nothing to do */ } - void do_ProfileCall (ProfileCall* x) { /* nothing to do */ } -diff --git a/test/compiler/c1/UnsafeVolatileGuardTest.java b/test/compiler/c1/UnsafeVolatileGuardTest.java -new file mode 100644 ---- /dev/null -+++ openjdk/hotspot/test/compiler/c1/UnsafeVolatileGuardTest.java -@@ -0,0 +1,72 @@ -+/* -+ * Copyright (c) 2017, 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. -+ */ -+ -+import java.lang.reflect.Field; -+ -+/** -+ * @test -+ * @bug 8175887 -+ * @summary C1 value numbering handling of Unsafe.get*Volatile is incorrect -+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:TieredStopAtLevel=1 UnsafeVolatileGuardTest -+ */ -+public class UnsafeVolatileGuardTest { -+ volatile static private int a; -+ static private int b; -+ -+ static final sun.misc.Unsafe UNSAFE; -+ -+ static final Object BASE; -+ static final long OFFSET; -+ -+ static { -+ try { -+ Field uf = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); -+ uf.setAccessible(true); -+ UNSAFE = (sun.misc.Unsafe)uf.get(null); -+ -+ Field f = UnsafeVolatileGuardTest.class.getDeclaredField("a"); -+ BASE = UNSAFE.staticFieldBase(f); -+ OFFSET = UNSAFE.staticFieldOffset(f); -+ } catch (Exception e) { -+ throw new RuntimeException(e); -+ } -+ } -+ -+ static void test() { -+ int tt = b; // makes the JVM CSE the value of b -+ -+ while (UNSAFE.getIntVolatile(BASE, OFFSET) == 0) {} // burn -+ if (b == 0) { -+ System.err.println("wrong value of b"); -+ System.exit(1); // fail hard to report the error -+ } -+ } -+ -+ public static void main(String [] args) throws Exception { -+ for (int i = 0; i < 10; i++) { -+ new Thread(UnsafeVolatileGuardTest::test).start(); -+ } -+ b = 1; -+ a = 1; -+ } -+} -diff --git a/test/compiler/c1/VolatileGuardTest.java b/test/compiler/c1/VolatileGuardTest.java -new file mode 100644 ---- /dev/null -+++ openjdk/hotspot/test/compiler/c1/VolatileGuardTest.java -@@ -0,0 +1,52 @@ -+/* -+ * Copyright (c) 2017, 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 8175887 -+ * @summary C1 doesn't respect the JMM with volatile field loads -+ * -+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:TieredStopAtLevel=1 VolatileGuardTest -+ */ -+public class VolatileGuardTest { -+ volatile static private int a; -+ static private int b; -+ -+ static void test() { -+ int tt = b; // makes the JVM CSE the value of b -+ -+ while (a == 0) {} // burn -+ if (b == 0) { -+ System.err.println("wrong value of b"); -+ System.exit(1); // fail hard to report the error -+ } -+ } -+ -+ public static void main(String [] args) throws Exception { -+ for (int i = 0; i < 10; i++) { -+ new Thread(VolatileGuardTest::test).start(); -+ } -+ b = 1; -+ a = 1; -+ } -+} diff --git a/SOURCES/8179084-pr3409-rh1455694.patch b/SOURCES/8179084-pr3409-rh1455694.patch deleted file mode 100644 index dbc2120..0000000 --- a/SOURCES/8179084-pr3409-rh1455694.patch +++ /dev/null @@ -1,135 +0,0 @@ -# HG changeset patch -# User dholmes -# Date 1493428477 14400 -# Fri Apr 28 21:14:37 2017 -0400 -# Node ID 2fee74c5547889d9698a2636e0a5170f9e66fb9c -# Parent 13a04e8df5a3af73794146b930b32556c7cbc5b0 -8179084, PR3409, RH1455694: HotSpot VM fails to start when AggressiveHeap is set -Reviewed-by: kbarrett, stefank - -diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp ---- openjdk/hotspot/src/share/vm/runtime/arguments.cpp -+++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp -@@ -3193,8 +3193,6 @@ - - // Enable parallel GC and adaptive generation sizing - FLAG_SET_CMDLINE(bool, UseParallelGC, true); -- FLAG_SET_DEFAULT(ParallelGCThreads, -- Abstract_VM_Version::parallel_worker_threads()); - - // Encourage steady state memory management - FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100); -diff --git a/test/TEST.groups b/test/TEST.groups ---- openjdk/hotspot/test/TEST.groups -+++ openjdk/hotspot/test/TEST.groups -@@ -1,5 +1,5 @@ - # --# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. -+# Copyright (c) 2013, 2017, 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 -@@ -164,6 +164,7 @@ - gc/TestGCLogRotationViaJcmd.java \ - gc/g1/TestHumongousAllocInitialMark.java \ - gc/g1/TestHumongousShrinkHeap.java \ -+ gc/arguments/TestAggressiveHeap.java \ - gc/arguments/TestG1HeapRegionSize.java \ - gc/metaspace/TestMetaspaceMemoryPool.java \ - gc/arguments/TestDynMinHeapFreeRatio.java \ -diff --git a/test/gc/arguments/TestAggressiveHeap.java b/test/gc/arguments/TestAggressiveHeap.java -new file mode 100644 ---- /dev/null -+++ openjdk/hotspot/test/gc/arguments/TestAggressiveHeap.java -@@ -0,0 +1,91 @@ -+/* -+ * Copyright (c) 2017, 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 TestAggressiveHeap -+ * @key gc -+ * @bug 8179084 -+ * @summary Test argument processing for -XX:+AggressiveHeap. -+ * @library /testlibrary -+ * @run driver TestAggressiveHeap -+ */ -+ -+import java.lang.management.ManagementFactory; -+import javax.management.MBeanServer; -+import javax.management.ObjectName; -+ -+import com.oracle.java.testlibrary.OutputAnalyzer; -+import com.oracle.java.testlibrary.ProcessTools; -+ -+public class TestAggressiveHeap { -+ -+ public static void main(String args[]) throws Exception { -+ if (canUseAggressiveHeapOption()) { -+ testFlag(); -+ } -+ } -+ -+ // Note: Not a normal boolean flag; -XX:-AggressiveHeap is invalid. -+ private static final String option = "-XX:+AggressiveHeap"; -+ -+ // Option requires at least 256M, else error during option processing. -+ private static final long minMemory = 256 * 1024 * 1024; -+ -+ // bool UseParallelGC := true {product} -+ private static final String parallelGCPattern = -+ " *bool +UseParallelGC *:= *true +\\{product\\}"; -+ -+ private static void testFlag() throws Exception { -+ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( -+ option, "-XX:+PrintFlagsFinal", "-version"); -+ -+ OutputAnalyzer output = new OutputAnalyzer(pb.start()); -+ -+ output.shouldHaveExitValue(0); -+ -+ String value = output.firstMatch(parallelGCPattern); -+ if (value == null) { -+ throw new RuntimeException( -+ option + " didn't set UseParallelGC"); -+ } -+ } -+ -+ private static boolean haveRequiredMemory() throws Exception { -+ MBeanServer server = ManagementFactory.getPlatformMBeanServer(); -+ ObjectName os = new ObjectName("java.lang", "type", "OperatingSystem"); -+ Object attr = server.getAttribute(os, "TotalPhysicalMemorySize"); -+ String value = attr.toString(); -+ long memory = Long.parseLong(value); -+ return memory >= minMemory; -+ } -+ -+ private static boolean canUseAggressiveHeapOption() throws Exception { -+ if (!haveRequiredMemory()) { -+ System.out.println( -+ "Skipping test of " + option + " : insufficient memory"); -+ return false; -+ } -+ return true; -+ } -+} -+ diff --git a/SOURCES/8181055-pr3394-rh1448880.patch b/SOURCES/8181055-pr3394-rh1448880.patch new file mode 100644 index 0000000..593159d --- /dev/null +++ b/SOURCES/8181055-pr3394-rh1448880.patch @@ -0,0 +1,115 @@ +# HG changeset patch +# User zgu +# Date 1496236768 14400 +# Wed May 31 09:19:28 2017 -0400 +# Node ID 8330ff7914ec54c46fd19300221f72d774423405 +# Parent 55a34e4962e10c822affe8f89273a87e84cade92 +8181055: PPC64: "mbind: Invalid argument" still seen after 8175813 +Summary: Use numa_interleave_memory v2 api when available +Reviewed-by: dholmes, shade + +diff -r 74c81011375b src/os/linux/vm/os_linux.cpp +--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp Wed May 17 17:52:34 2017 -0400 ++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp Wed May 31 12:27:00 2017 -0400 +@@ -2819,11 +2819,8 @@ + extern "C" JNIEXPORT void numa_error(char *where) { } + extern "C" JNIEXPORT int fork1() { return fork(); } + +- +-// If we are running with libnuma version > 2, then we should +-// be trying to use symbols with versions 1.1 +-// If we are running with earlier version, which did not have symbol versions, +-// we should use the base version. ++// Handle request to load libnuma symbol version 1.1 (API v1). If it fails ++// load symbol from base version instead. + void* os::Linux::libnuma_dlsym(void* handle, const char *name) { + void *f = dlvsym(handle, name, "libnuma_1.1"); + if (f == NULL) { +@@ -2832,6 +2829,12 @@ + return f; + } + ++// Handle request to load libnuma symbol version 1.2 (API v2) only. ++// Return NULL if the symbol is not defined in this particular version. ++void* os::Linux::libnuma_v2_dlsym(void* handle, const char* name) { ++ return dlvsym(handle, name, "libnuma_1.2"); ++} ++ + bool os::Linux::libnuma_init() { + // sched_getcpu() should be in libc. + set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t, +@@ -2856,6 +2859,8 @@ + libnuma_dlsym(handle, "numa_tonode_memory"))); + set_numa_interleave_memory(CAST_TO_FN_PTR(numa_interleave_memory_func_t, + libnuma_dlsym(handle, "numa_interleave_memory"))); ++ set_numa_interleave_memory_v2(CAST_TO_FN_PTR(numa_interleave_memory_v2_func_t, ++ libnuma_v2_dlsym(handle, "numa_interleave_memory"))); + set_numa_set_bind_policy(CAST_TO_FN_PTR(numa_set_bind_policy_func_t, + libnuma_dlsym(handle, "numa_set_bind_policy"))); + set_numa_bitmask_isbitset(CAST_TO_FN_PTR(numa_bitmask_isbitset_func_t, +@@ -2975,6 +2980,7 @@ + os::Linux::numa_available_func_t os::Linux::_numa_available; + os::Linux::numa_tonode_memory_func_t os::Linux::_numa_tonode_memory; + os::Linux::numa_interleave_memory_func_t os::Linux::_numa_interleave_memory; ++os::Linux::numa_interleave_memory_v2_func_t os::Linux::_numa_interleave_memory_v2; + os::Linux::numa_set_bind_policy_func_t os::Linux::_numa_set_bind_policy; + os::Linux::numa_bitmask_isbitset_func_t os::Linux::_numa_bitmask_isbitset; + os::Linux::numa_distance_func_t os::Linux::_numa_distance; +diff -r 74c81011375b src/os/linux/vm/os_linux.hpp +--- openjdk/hotspot/src/os/linux/vm/os_linux.hpp Wed May 17 17:52:34 2017 -0400 ++++ openjdk/hotspot/src/os/linux/vm/os_linux.hpp Wed May 31 12:27:00 2017 -0400 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1999, 2017, 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 +@@ -190,6 +190,9 @@ + static void libpthread_init(); + static bool libnuma_init(); + static void* libnuma_dlsym(void* handle, const char* name); ++ // libnuma v2 (libnuma_1.2) symbols ++ static void* libnuma_v2_dlsym(void* handle, const char* name); ++ + // Minimum stack size a thread can be created with (allowing + // the VM to completely create the thread and enter user code) + static size_t min_stack_allowed; +@@ -250,6 +253,8 @@ + typedef int (*numa_available_func_t)(void); + typedef int (*numa_tonode_memory_func_t)(void *start, size_t size, int node); + typedef void (*numa_interleave_memory_func_t)(void *start, size_t size, unsigned long *nodemask); ++ typedef void (*numa_interleave_memory_v2_func_t)(void *start, size_t size, struct bitmask* mask); ++ + typedef void (*numa_set_bind_policy_func_t)(int policy); + typedef int (*numa_bitmask_isbitset_func_t)(struct bitmask *bmp, unsigned int n); + typedef int (*numa_distance_func_t)(int node1, int node2); +@@ -261,6 +266,7 @@ + static numa_available_func_t _numa_available; + static numa_tonode_memory_func_t _numa_tonode_memory; + static numa_interleave_memory_func_t _numa_interleave_memory; ++ static numa_interleave_memory_v2_func_t _numa_interleave_memory_v2; + static numa_set_bind_policy_func_t _numa_set_bind_policy; + static numa_bitmask_isbitset_func_t _numa_bitmask_isbitset; + static numa_distance_func_t _numa_distance; +@@ -275,6 +281,7 @@ + static void set_numa_available(numa_available_func_t func) { _numa_available = func; } + static void set_numa_tonode_memory(numa_tonode_memory_func_t func) { _numa_tonode_memory = func; } + static void set_numa_interleave_memory(numa_interleave_memory_func_t func) { _numa_interleave_memory = func; } ++ static void set_numa_interleave_memory_v2(numa_interleave_memory_v2_func_t func) { _numa_interleave_memory_v2 = func; } + static void set_numa_set_bind_policy(numa_set_bind_policy_func_t func) { _numa_set_bind_policy = func; } + static void set_numa_bitmask_isbitset(numa_bitmask_isbitset_func_t func) { _numa_bitmask_isbitset = func; } + static void set_numa_distance(numa_distance_func_t func) { _numa_distance = func; } +@@ -296,7 +303,10 @@ + return _numa_tonode_memory != NULL ? _numa_tonode_memory(start, size, node) : -1; + } + static void numa_interleave_memory(void *start, size_t size) { +- if (_numa_interleave_memory != NULL && _numa_all_nodes != NULL) { ++ // Use v2 api if available ++ if (_numa_interleave_memory_v2 != NULL && _numa_all_nodes_ptr != NULL) { ++ _numa_interleave_memory_v2(start, size, _numa_all_nodes_ptr); ++ } else if (_numa_interleave_memory != NULL && _numa_all_nodes != NULL) { + _numa_interleave_memory(start, size, _numa_all_nodes); + } + } + diff --git a/SOURCES/8181419-pr3413-rh1463144.patch b/SOURCES/8181419-pr3413-rh1463144.patch deleted file mode 100644 index c2c7fc6..0000000 --- a/SOURCES/8181419-pr3413-rh1463144.patch +++ /dev/null @@ -1,92 +0,0 @@ -# HG changeset patch -# User stuefe -# Date 1497865921 -7200 -# Mon Jun 19 11:52:01 2017 +0200 -# Node ID ca0c7b2783e0102468218589a062e7ac4736aae2 -# Parent 148a7d6c463ad1726bad8a9e8d5df191314d704b -8181419, PR3413, RH1463144: Race in jdwp invoker handling may lead to crashes or invalid results -Reviewed-by: sspitsyn, sgehwolf, clanger - -diff --git a/src/share/back/invoker.c b/src/share/back/invoker.c ---- openjdk/jdk/src/share/back/invoker.c -+++ openjdk/jdk/src/share/back/invoker.c -@@ -212,30 +212,6 @@ - } - - /* -- * Delete saved global references - if any - for: -- * - a potentially thrown Exception -- * - a returned refernce/array value -- * See invoker_doInvoke() and invoke* methods where global references -- * are being saved. -- */ --static void --deletePotentiallySavedGlobalRefs(JNIEnv *env, InvokeRequest *request) --{ -- /* Delete potentially saved return value */ -- if ((request->invokeType == INVOKE_CONSTRUCTOR) || -- (returnTypeTag(request->methodSignature) == JDWP_TAG(OBJECT)) || -- (returnTypeTag(request->methodSignature) == JDWP_TAG(ARRAY))) { -- if (request->returnValue.l != NULL) { -- tossGlobalRef(env, &(request->returnValue.l)); -- } -- } -- /* Delete potentially saved exception */ -- if (request->exception != NULL) { -- tossGlobalRef(env, &(request->exception)); -- } --} -- --/* - * Delete global argument references from the request which got put there before a - * invoke request was carried out. See fillInvokeRequest(). - */ -@@ -744,6 +720,7 @@ - jint id; - InvokeRequest *request; - jboolean detached; -+ jboolean mustReleaseReturnValue = JNI_FALSE; - - JDI_ASSERT(thread); - -@@ -787,6 +764,13 @@ - id = request->id; - exc = request->exception; - returnValue = request->returnValue; -+ -+ /* Release return value and exception references, but delay the release -+ * until after the return packet was sent. */ -+ mustReleaseReturnValue = request->invokeType == INVOKE_CONSTRUCTOR || -+ returnTypeTag(request->methodSignature) == JDWP_TAG(OBJECT) || -+ returnTypeTag(request->methodSignature) == JDWP_TAG(ARRAY); -+ - } - - /* -@@ -801,6 +785,12 @@ - */ - deleteGlobalArgumentRefs(env, request); - -+ /* From now on, do not access the request structure anymore -+ * for this request id, because once we give up the invokerLock it may -+ * be immediately reused by a new invoke request. -+ */ -+ request = NULL; -+ - /* - * Give up the lock before I/O operation - */ -@@ -821,7 +811,12 @@ - */ - eventHandler_lock(); // for proper lock order - debugMonitorEnter(invokerLock); -- deletePotentiallySavedGlobalRefs(env, request); -+ if (mustReleaseReturnValue && returnValue.l != NULL) { -+ tossGlobalRef(env, &returnValue.l); -+ } -+ if (exc != NULL) { -+ tossGlobalRef(env, &exc); -+ } - debugMonitorExit(invokerLock); - eventHandler_unlock(); - } diff --git a/SOURCES/dont-add-unnecessary-debug-links.patch b/SOURCES/dont-add-unnecessary-debug-links.patch new file mode 100644 index 0000000..9c29e6b --- /dev/null +++ b/SOURCES/dont-add-unnecessary-debug-links.patch @@ -0,0 +1,77 @@ +--- openjdk/make/common/NativeCompilation.gmk ++++ openjdk/make/common/NativeCompilation.gmk +@@ -437,29 +437,6 @@ + + ifneq ($(OPENJDK_TARGET_OS), macosx) # OBJCOPY is not used on MacOS X + ifneq ($(OPENJDK_TARGET_OS), windows) # nor on Windows +- ifeq ($(OPENJDK_TARGET_OS), solaris) +- # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. +- # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from +- # empty section headers until a fixed $(OBJCOPY) is available. +- # An empty section header has sh_addr == 0 and sh_size == 0. +- # This problem has only been seen on Solaris X64, but we call this tool +- # on all Solaris builds just in case. +- # +- # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. +- # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. +- $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) \ +- $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK) +- $(RM) $$@ +- $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$< +- $(OBJCOPY) --only-keep-debug $$< $$@ +- $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$< +- else # not solaris +- $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) +- $(RM) $$@ +- $(OBJCOPY) --only-keep-debug $$< $$@ +- $(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$< +- endif # Touch to not retrigger rule on rebuild +- $(TOUCH) $$@ + endif # !windows + endif # !macosx + +@@ -483,7 +460,6 @@ + $1 += $$($1_OUTPUT_DIR)/$$($1_LIBRARY).map \ + $$($1_OUTPUT_DIR)/$$($1_LIBRARY).pdb + else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files +- $1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo + endif + endif + endif +@@ -522,28 +498,8 @@ + ifneq ($(OPENJDK_TARGET_OS), macosx) # OBJCOPY is not used on MacOS X + ifneq ($(OPENJDK_TARGET_OS), windows) # nor on Windows + ifeq ($(OPENJDK_TARGET_OS), solaris) +- # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. +- # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from +- # empty section headers until a fixed $(OBJCOPY) is available. +- # An empty section header has sh_addr == 0 and sh_size == 0. +- # This problem has only been seen on Solaris X64, but we call this tool +- # on all Solaris builds just in case. +- # +- # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. +- # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. +- $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) \ +- $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK) +- $(RM) $$@ +- $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$< +- $(OBJCOPY) --only-keep-debug $$< $$@ +- $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$< + else # not solaris +- $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) +- $(RM) $$@ +- $(OBJCOPY) --only-keep-debug $$< $$@ +- $(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$< + endif +- $(TOUCH) $$@ + endif # !windows + endif # !macosx + +@@ -567,7 +523,6 @@ + $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).map \ + $$($1_OUTPUT_DIR)/$$($1_PROGRAM).pdb + else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files +- $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).debuginfo + endif + endif + endif diff --git a/SOURCES/hotspot-assembler-debuginfo.patch b/SOURCES/hotspot-assembler-debuginfo.patch new file mode 100644 index 0000000..61f493d --- /dev/null +++ b/SOURCES/hotspot-assembler-debuginfo.patch @@ -0,0 +1,27 @@ +Make the assembler generate whatever debuginfo it can +--- openjdk/hotspot/make/linux/makefiles/rules.make ++++ openjdk/hotspot/make/linux/makefiles/rules.make +@@ -34,7 +34,7 @@ + CC_COMPILE = $(CC) $(CXXFLAGS) $(CFLAGS) + CXX_COMPILE = $(CXX) $(CXXFLAGS) $(CFLAGS) + +-AS.S = $(AS) $(ASFLAGS) ++AS.S = $(AS) -g $(ASFLAGS) + + COMPILE.CC = $(CC_COMPILE) -c + GENASM.CC = $(CC_COMPILE) -S +@@ -161,12 +161,12 @@ + %.o: %.s + @echo Assembling $< + $(QUIETLY) $(REMOVE_TARGET) +- $(QUIETLY) $(AS.S) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE) ++ $(QUIETLY) $(AS.S) -g $(DEPFLAGS) -o $@ $< $(COMPILE_DONE) + + %.o: %.S + @echo Assembling $< + $(QUIETLY) $(REMOVE_TARGET) +- $(COMPILE.CC) -o $@ $< $(COMPILE_DONE) ++ $(COMPILE.CC) -g -o $@ $< $(COMPILE_DONE) + + %.s: %.cpp + @echo Generating assembly for $< diff --git a/SOURCES/hotspot-remove-debuglink.patch b/SOURCES/hotspot-remove-debuglink.patch new file mode 100644 index 0000000..3b3070d --- /dev/null +++ b/SOURCES/hotspot-remove-debuglink.patch @@ -0,0 +1,73 @@ +Remove unnecessary .gnu_debuglink sections from libjvm + +The .gnu_debuglink section indicates which file contains the debuginfo. This +is not needed if we not stripping the shared object. + +RPM's debuginfo extraction code will add the right file links automatically. As +it is, RPM copies over the .gnu_debuglink link to the debug info file. Without +this patch, the debug info file also ends up containing the .gnu_debuglink +section pointing to a missing (and not needed) file. + +diff --git a/make/linux/makefiles/jsig.make b/make/linux/makefiles/jsig.make +--- openjdk/hotspot/make/linux/makefiles/jsig.make ++++ openjdk/hotspot/make/linux/makefiles/jsig.make +@@ -57,14 +57,15 @@ + $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) $(EXTRA_CFLAGS) -o $@ $< -ldl + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO) ++ ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@ +- ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ + else + ifeq ($(STRIP_POLICY),min_strip) ++ $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@ + $(QUIETLY) $(STRIP) -g $@ ++ endif + # implied else here is no stripping at all +- endif + endif + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO) +diff --git a/make/linux/makefiles/saproc.make b/make/linux/makefiles/saproc.make +--- openjdk/hotspot/make/linux/makefiles/saproc.make ++++ openjdk/hotspot/make/linux/makefiles/saproc.make +@@ -99,14 +99,15 @@ + -lthread_db + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO) ++ ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@ +- ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ + else + ifeq ($(STRIP_POLICY),min_strip) ++ $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@ + $(QUIETLY) $(STRIP) -g $@ ++ endif + # implied else here is no stripping at all +- endif + endif + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) +diff --git a/make/linux/makefiles/vm.make b/make/linux/makefiles/vm.make +--- openjdk/hotspot/make/linux/makefiles/vm.make ++++ openjdk/hotspot/make/linux/makefiles/vm.make +@@ -358,14 +358,15 @@ + + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DEBUGINFO) +- $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@ + ifeq ($(STRIP_POLICY),all_strip) + $(QUIETLY) $(STRIP) $@ ++ $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@ + else + ifeq ($(STRIP_POLICY),min_strip) + $(QUIETLY) $(STRIP) -g $@ ++ $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@ ++ endif + # implied else here is no stripping at all +- endif + endif + ifeq ($(ZIP_DEBUGINFO_FILES),1) + $(ZIPEXE) -q -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO) diff --git a/SOURCES/java-1.8.0-openjdk-remove-intree-libraries.sh b/SOURCES/java-1.8.0-openjdk-remove-intree-libraries.sh index d9578e9..1f022f6 100644 --- a/SOURCES/java-1.8.0-openjdk-remove-intree-libraries.sh +++ b/SOURCES/java-1.8.0-openjdk-remove-intree-libraries.sh @@ -1,10 +1,10 @@ #!/bin/sh -ZIP_SRC=openjdk/jdk/src/share/native/java/util/zip/zlib-* -JPEG_SRC=openjdk/jdk/src/share/native/sun/awt/image/jpeg -GIF_SRC=openjdk/jdk/src/share/native/sun/awt/giflib -PNG_SRC=openjdk/jdk/src/share/native/sun/awt/libpng -LCMS_SRC=openjdk/jdk/src/share/native/sun/java2d/cmm/lcms +ZIP_SRC=jdk8/jdk/src/share/native/java/util/zip/zlib-* +JPEG_SRC=jdk8/jdk/src/share/native/sun/awt/image/jpeg +GIF_SRC=jdk8/jdk/src/share/native/sun/awt/giflib +PNG_SRC=jdk8/jdk/src/share/native/sun/awt/libpng +LCMS_SRC=jdk8/jdk/src/share/native/sun/java2d/cmm/lcms echo "Removing built-in libs (they will be linked)" diff --git a/SOURCES/nss.cfg b/SOURCES/nss.cfg deleted file mode 100644 index 377a39c..0000000 --- a/SOURCES/nss.cfg +++ /dev/null @@ -1,5 +0,0 @@ -name = NSS -nssLibraryDirectory = @NSS_LIBDIR@ -nssDbMode = noDb -attributes = compatibility -handleStartupErrors = ignoreMultipleInitialisation diff --git a/SOURCES/nss.cfg.in b/SOURCES/nss.cfg.in new file mode 100644 index 0000000..377a39c --- /dev/null +++ b/SOURCES/nss.cfg.in @@ -0,0 +1,5 @@ +name = NSS +nssLibraryDirectory = @NSS_LIBDIR@ +nssDbMode = noDb +attributes = compatibility +handleStartupErrors = ignoreMultipleInitialisation diff --git a/SOURCES/pr1983-jdk.patch b/SOURCES/pr1983-jdk.patch index 673b8a9..a0b4e1a 100644 --- a/SOURCES/pr1983-jdk.patch +++ b/SOURCES/pr1983-jdk.patch @@ -6,11 +6,10 @@ # Parent afd392dfaed501ac674a7cc3e37353ce300969c7 PR1983: Support using the system installation of NSS with the SunEC provider Summary: Apply code changes from PR1699 & PR1742 & forward-port Makefile changes to the new build. -Updated 2017/07/04 to accomodate 8175110 -diff -r 984a4af2ed4e make/lib/SecurityLibraries.gmk ---- openjdk/jdk/make/lib/SecurityLibraries.gmk -+++ openjdk/jdk/make/lib/SecurityLibraries.gmk +diff -r afd392dfaed5 -r 48c15869ecd5 make/lib/SecurityLibraries.gmk +--- openjdk/jdk/make/lib/SecurityLibraries.gmk Tue Jan 26 22:26:26 2016 +0000 ++++ openjdk/jdk/make/lib/SecurityLibraries.gmk Wed Jan 27 02:54:06 2016 +0000 @@ -218,8 +218,17 @@ ifeq ($(ENABLE_INTREE_EC), yes) @@ -52,9 +51,9 @@ diff -r 984a4af2ed4e make/lib/SecurityLibraries.gmk VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ RC_FLAGS := $(RC_FLAGS) \ -D "JDK_FNAME=sunec.dll" \ -diff -r 984a4af2ed4e src/share/native/sun/security/ec/ECC_JNI.cpp ---- openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp -+++ openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp +diff -r afd392dfaed5 -r 48c15869ecd5 src/share/native/sun/security/ec/ECC_JNI.cpp +--- openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp Tue Jan 26 22:26:26 2016 +0000 ++++ openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp Wed Jan 27 02:54:06 2016 +0000 @@ -24,7 +24,7 @@ */ @@ -77,8 +76,8 @@ diff -r 984a4af2ed4e src/share/native/sun/security/ec/ECC_JNI.cpp */ JNIEXPORT jbyteArray JNICALL Java_sun_security_ec_ECDSASignature_signDigest -- (JNIEnv *env, jclass clazz, jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed, jint timing) -+ (JNIEnv *env, jclass UNUSED(clazz), jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed, jint timing) +- (JNIEnv *env, jclass clazz, jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed) ++ (JNIEnv *env, jclass UNUSED(clazz), jbyteArray digest, jbyteArray privateKey, jbyteArray encodedParams, jbyteArray seed) { jbyte* pDigestBuffer = NULL; jint jDigestLength = env->GetArrayLength(digest); @@ -100,12 +99,12 @@ diff -r 984a4af2ed4e src/share/native/sun/security/ec/ECC_JNI.cpp { jbyteArray jSecret = NULL; ECParams *ecparams = NULL; -diff -r 984a4af2ed4e src/share/native/sun/security/ec/ecc_impl.h ---- /dev/null -+++ openjdk/jdk/src/share/native/sun/security/ec/ecc_impl.h +diff -r afd392dfaed5 -r 48c15869ecd5 src/share/native/sun/security/ec/ecc_impl.h +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ openjdk/jdk/src/share/native/sun/security/ec/ecc_impl.h Wed Jan 27 02:54:06 2016 +0000 @@ -0,0 +1,298 @@ +/* -+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Use is subject to license terms. + * + * This library is free software; you can redistribute it and/or @@ -140,7 +139,7 @@ diff -r 984a4af2ed4e src/share/native/sun/security/ec/ecc_impl.h + * Dr Vipul Gupta and + * Douglas Stebila , Sun Microsystems Laboratories + * -+ * Last Modified Date from the Original Code: May 2017 ++ * Last Modified Date from the Original Code: November 2013 + *********************************************************************** */ + +#ifndef _ECC_IMPL_H @@ -374,7 +373,7 @@ diff -r 984a4af2ed4e src/share/native/sun/security/ec/ecc_impl.h +#ifdef SYSTEM_NSS +#define EC_DecodeParams(a,b,c) EC_DecodeParams(a,b) +#define EC_NewKey(a,b,c,d,e) EC_NewKeyFromSeed(a,b,c,d) -+#define ECDSA_SignDigest(a,b,c,d,e,f,g) ECDSA_SignDigestWithSeed(a,b,c,d,e) ++#define ECDSA_SignDigest(a,b,c,d,e,f) ECDSA_SignDigestWithSeed(a,b,c,d,e) +#define ECDSA_VerifyDigest(a,b,c,d) ECDSA_VerifyDigest(a,b,c) +#define ECDH_Derive(a,b,c,d,e,f) ECDH_Derive(a,b,c,d,e) +#else @@ -390,7 +389,7 @@ diff -r 984a4af2ed4e src/share/native/sun/security/ec/ecc_impl.h + const unsigned char* random, int randomlen, int); +/* This function has been modified to accept an array of random bytes */ +extern SECStatus ECDSA_SignDigest(ECPrivateKey *, SECItem *, const SECItem *, -+ const unsigned char* random, int randomlen, int, int timing); ++ const unsigned char* random, int randomlen, int); +extern SECStatus ECDSA_VerifyDigest(ECPublicKey *, const SECItem *, + const SECItem *, int); +extern SECStatus ECDH_Derive(SECItem *, ECParams *, SECItem *, boolean_t, @@ -402,12 +401,12 @@ diff -r 984a4af2ed4e src/share/native/sun/security/ec/ecc_impl.h +#endif + +#endif /* _ECC_IMPL_H */ -diff -r 984a4af2ed4e src/share/native/sun/security/ec/impl/ecc_impl.h ---- openjdk/jdk/src/share/native/sun/security/ec/impl/ecc_impl.h -+++ /dev/null +diff -r afd392dfaed5 -r 48c15869ecd5 src/share/native/sun/security/ec/impl/ecc_impl.h +--- openjdk/jdk/src/share/native/sun/security/ec/impl/ecc_impl.h Tue Jan 26 22:26:26 2016 +0000 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,271 +0,0 @@ -/* -- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. +- * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - * - * This library is free software; you can redistribute it and/or @@ -442,7 +441,7 @@ diff -r 984a4af2ed4e src/share/native/sun/security/ec/impl/ecc_impl.h - * Dr Vipul Gupta and - * Douglas Stebila , Sun Microsystems Laboratories - * -- * Last Modified Date from the Original Code: May 2017 +- * Last Modified Date from the Original Code: November 2013 - *********************************************************************** */ - -#ifndef _ECC_IMPL_H @@ -666,7 +665,7 @@ diff -r 984a4af2ed4e src/share/native/sun/security/ec/impl/ecc_impl.h - const unsigned char* random, int randomlen, int); -/* This function has been modified to accept an array of random bytes */ -extern SECStatus ECDSA_SignDigest(ECPrivateKey *, SECItem *, const SECItem *, -- const unsigned char* random, int randomlen, int, int timing); +- const unsigned char* random, int randomlen, int); -extern SECStatus ECDSA_VerifyDigest(ECPublicKey *, const SECItem *, - const SECItem *, int); -extern SECStatus ECDH_Derive(SECItem *, ECParams *, SECItem *, boolean_t, @@ -677,9 +676,9 @@ diff -r 984a4af2ed4e src/share/native/sun/security/ec/impl/ecc_impl.h -#endif - -#endif /* _ECC_IMPL_H */ -diff -r 984a4af2ed4e src/solaris/javavm/export/jni_md.h ---- openjdk/jdk/src/solaris/javavm/export/jni_md.h -+++ openjdk/jdk/src/solaris/javavm/export/jni_md.h +diff -r afd392dfaed5 -r 48c15869ecd5 src/solaris/javavm/export/jni_md.h +--- openjdk/jdk/src/solaris/javavm/export/jni_md.h Tue Jan 26 22:26:26 2016 +0000 ++++ openjdk/jdk/src/solaris/javavm/export/jni_md.h Wed Jan 27 02:54:06 2016 +0000 @@ -36,6 +36,11 @@ #define JNIEXPORT #define JNIIMPORT diff --git a/SOURCES/pr2888.patch b/SOURCES/pr2888.patch new file mode 100644 index 0000000..fc8f981 --- /dev/null +++ b/SOURCES/pr2888.patch @@ -0,0 +1,60 @@ +# HG changeset patch +# User andrew +# Date 1459487045 -3600 +# Fri Apr 01 06:04:05 2016 +0100 +# Node ID 3334efeacd8327a14b7d2f392f4546e3c29c594b +# Parent 6b81fd2227d14226f2121f2d51b464536925686e +PR2888: OpenJDK should check for system cacerts database (e.g. /etc/pki/java/cacerts) + +diff --git a/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java b/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java +--- openjdk/jdk/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java ++++ openjdk/jdk/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java +@@ -174,15 +174,20 @@ + storeFile = new File(storeFileName); + fis = getFileInputStream(storeFile); + } else { +- String javaHome = props.get("javaHome"); +- storeFile = new File(javaHome + sep + "lib" + sep +- + "security" + sep + +- "jssecacerts"); ++ /* Check system cacerts DB first; /etc/pki/java/cacerts */ ++ storeFile = new File(sep + "etc" + sep + "pki" + sep ++ + "java" + sep + "cacerts"); + if ((fis = getFileInputStream(storeFile)) == null) { ++ String javaHome = props.get("javaHome"); + storeFile = new File(javaHome + sep + "lib" + sep +- + "security" + sep + +- "cacerts"); +- fis = getFileInputStream(storeFile); ++ + "security" + sep + ++ "jssecacerts"); ++ if ((fis = getFileInputStream(storeFile)) == null) { ++ storeFile = new File(javaHome + sep + "lib" + sep ++ + "security" + sep + ++ "cacerts"); ++ fis = getFileInputStream(storeFile); ++ } + } + } + +diff --git a/src/share/classes/sun/security/tools/KeyStoreUtil.java b/src/share/classes/sun/security/tools/KeyStoreUtil.java +--- openjdk/jdk/src/share/classes/sun/security/tools/KeyStoreUtil.java ++++ openjdk/jdk/src/share/classes/sun/security/tools/KeyStoreUtil.java +@@ -87,9 +87,14 @@ + throws Exception + { + String sep = File.separator; +- File file = new File(System.getProperty("java.home") + sep +- + "lib" + sep + "security" + sep +- + "cacerts"); ++ /* Check system cacerts DB first; /etc/pki/java/cacerts */ ++ File file = new File(sep + "etc" + sep + "pki" + sep ++ + "java" + sep + "cacerts"); ++ if (!file.exists()) { ++ file = new File(System.getProperty("java.home") + sep ++ + "lib" + sep + "security" + sep ++ + "cacerts"); ++ } + if (!file.exists()) { + return null; + } diff --git a/SOURCES/pr2899.patch b/SOURCES/pr2899.patch index ffdefb0..58fb3c8 100644 --- a/SOURCES/pr2899.patch +++ b/SOURCES/pr2899.patch @@ -6,19 +6,18 @@ # Parent 8957aff589013e671f02d38023d5ff245ef27e87 PR2899: Don't use WithSeed versions of NSS functions as they don't fully process the seed Contributed-by: Alex Kashchenko -Updated 2017/07/04 to accomodate 8175110 by Andrew Hughes -diff -r e5fdbb82bd49 src/share/native/sun/security/ec/ecc_impl.h ---- openjdk/jdk/src/share/native/sun/security/ec/ecc_impl.h -+++ openjdk/jdk/src/share/native/sun/security/ec/ecc_impl.h +diff -r 8957aff58901 -r 9dc0eca5fa89 src/share/native/sun/security/ec/ecc_impl.h +--- openjdk/jdk/src/share/native/sun/security/ec/ecc_impl.h Wed Mar 30 04:48:56 2016 +0100 ++++ openjdk/jdk/src/share/native/sun/security/ec/ecc_impl.h Wed Mar 30 05:54:40 2016 +0100 @@ -267,8 +267,8 @@ #ifdef SYSTEM_NSS #define EC_DecodeParams(a,b,c) EC_DecodeParams(a,b) -#define EC_NewKey(a,b,c,d,e) EC_NewKeyFromSeed(a,b,c,d) --#define ECDSA_SignDigest(a,b,c,d,e,f,g) ECDSA_SignDigestWithSeed(a,b,c,d,e) +-#define ECDSA_SignDigest(a,b,c,d,e,f) ECDSA_SignDigestWithSeed(a,b,c,d,e) +#define EC_NewKey(a,b,c,d,e) EC_NewKey(a,b) -+#define ECDSA_SignDigest(a,b,c,d,e,f,g) ECDSA_SignDigest(a,b,c) ++#define ECDSA_SignDigest(a,b,c,d,e,f) ECDSA_SignDigest(a,b,c) #define ECDSA_VerifyDigest(a,b,c,d) ECDSA_VerifyDigest(a,b,c) #define ECDH_Derive(a,b,c,d,e,f) ECDH_Derive(a,b,c,d,e) #else diff --git a/SOURCES/pr2934.patch b/SOURCES/pr2934.patch index 83385da..21e769d 100644 --- a/SOURCES/pr2934.patch +++ b/SOURCES/pr2934.patch @@ -6,11 +6,10 @@ # Parent 3fa42705acab6d69b6141f47ebba4f85739a338c PR2934: SunEC provider throwing KeyException with current NSS Summary: Initialise the random number generator and feed the seed to it. -Updated 2017/07/04 to accomodate 8175110 -diff -r 8aed1e903a4c src/share/native/sun/security/ec/ECC_JNI.cpp ---- openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp -+++ openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp +diff -r 3fa42705acab -r dab76de2f91c src/share/native/sun/security/ec/ECC_JNI.cpp +--- openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp Wed Apr 20 03:39:11 2016 +0100 ++++ openjdk/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp Fri Apr 22 19:17:13 2016 +0100 @@ -134,8 +134,17 @@ env->GetByteArrayRegion(seed, 0, jSeedLength, pSeedBuffer); @@ -43,7 +42,7 @@ diff -r 8aed1e903a4c src/share/native/sun/security/ec/ECC_JNI.cpp + != SECSuccess) { +#else if (ECDSA_SignDigest(&privKey, &signature_item, &digest_item, - (unsigned char *) pSeedBuffer, jSeedLength, 0, timing) != SECSuccess) { + (unsigned char *) pSeedBuffer, jSeedLength, 0) != SECSuccess) { +#endif ThrowException(env, KEY_EXCEPTION); goto cleanup; @@ -66,9 +65,9 @@ diff -r 8aed1e903a4c src/share/native/sun/security/ec/ECC_JNI.cpp if (SECOID_Shutdown() != SECSuccess) { ThrowException(env, INTERNAL_ERROR); } -diff -r 8aed1e903a4c src/share/native/sun/security/ec/ecc_impl.h ---- openjdk/jdk/src/share/native/sun/security/ec/ecc_impl.h -+++ openjdk/jdk/src/share/native/sun/security/ec/ecc_impl.h +diff -r 3fa42705acab -r dab76de2f91c src/share/native/sun/security/ec/ecc_impl.h +--- openjdk/jdk/src/share/native/sun/security/ec/ecc_impl.h Wed Apr 20 03:39:11 2016 +0100 ++++ openjdk/jdk/src/share/native/sun/security/ec/ecc_impl.h Fri Apr 22 19:17:13 2016 +0100 @@ -254,8 +254,10 @@ This function is no longer required because the random bytes are now supplied by the caller. Force a failure. @@ -85,7 +84,7 @@ diff -r 8aed1e903a4c src/share/native/sun/security/ec/ecc_impl.h #ifdef SYSTEM_NSS #define EC_DecodeParams(a,b,c) EC_DecodeParams(a,b) -#define EC_NewKey(a,b,c,d,e) EC_NewKey(a,b) --#define ECDSA_SignDigest(a,b,c,d,e,f,g) ECDSA_SignDigest(a,b,c) +-#define ECDSA_SignDigest(a,b,c,d,e,f) ECDSA_SignDigest(a,b,c) #define ECDSA_VerifyDigest(a,b,c,d) ECDSA_VerifyDigest(a,b,c) #define ECDH_Derive(a,b,c,d,e,f) ECDH_Derive(a,b,c,d,e) #else diff --git a/SPECS/java-1.8.0-openjdk.spec b/SPECS/java-1.8.0-openjdk.spec index 968a97f..bb472d8 100644 --- a/SPECS/java-1.8.0-openjdk.spec +++ b/SPECS/java-1.8.0-openjdk.spec @@ -34,6 +34,13 @@ %global include_debug_build 0 %endif +# On x86_64 and AArch64, we use the Shenandoah HotSpot +%ifarch x86_64 %{aarch64} +%global use_shenandoah_hotspot 1 +%else +%global use_shenandoah_hotspot 0 +%endif + %if %{include_debug_build} %global build_loop2 %{debug_suffix} %else @@ -95,50 +102,64 @@ %global __provides_exclude ^(%{_privatelibs})$ %global __requires_exclude ^(%{_privatelibs})$ +# In some cases, the arch used by the JDK does +# not match _arch. +# Also, in some cases, the machine name used by SystemTap +# does not match that given by _build_cpu %ifarch x86_64 %global archinstall amd64 +%global stapinstall x86_64 %endif %ifarch ppc %global archinstall ppc +%global stapinstall powerpc %endif %ifarch %{ppc64be} %global archinstall ppc64 +%global stapinstall powerpc %endif %ifarch %{ppc64le} %global archinstall ppc64le +%global stapinstall powerpc %endif %ifarch %{ix86} %global archinstall i386 +%global stapinstall i386 %endif %ifarch ia64 %global archinstall ia64 +%global stapinstall ia64 %endif %ifarch s390 %global archinstall s390 +%global stapinstall s390 %endif %ifarch s390x %global archinstall s390x +%global stapinstall s390 %endif %ifarch %{arm} %global archinstall arm +%global stapinstall arm %endif %ifarch %{aarch64} %global archinstall aarch64 +%global stapinstall arm64 %endif # 32 bit sparc, optimized for v9 %ifarch sparcv9 %global archinstall sparc +%global stapinstall %{_build_cpu} %endif # 64 bit sparc %ifarch sparc64 %global archinstall sparcv9 +%global stapinstall %{_build_cpu} %endif %ifnarch %{jit_arches} %global archinstall %{_arch} %endif - - %ifarch %{jit_arches} %global with_systemtap 1 %else @@ -157,7 +178,11 @@ # note, following three variables are sedded from update_sources if used correctly. Hardcode them rather there. %global project aarch64-port %global repo jdk8u -%global revision aarch64-jdk8u141-b16 +%global revision aarch64-jdk8u131-b12 +%global shenandoah_project aarch64-port +%global shenandoah_repo jdk8u-shenandoah +%global shenandoah_revision aarch64-shenandoah-jdk8u131-b12 + # eg # jdk8u60-b27 -> jdk8u60 or # aarch64-jdk8u60-b27 -> aarch64-jdk8u60 (dont forget spec escape % by %%) %global whole_update %(VERSION=%{revision}; echo ${VERSION%%-*}) # eg jdk8u60 -> 60 or aarch64-jdk8u60 -> 60 @@ -201,18 +226,12 @@ # for the primary arch for now). Systemtap uses the machine name # aka build_cpu as architecture specific directory name. %global tapsetroot /usr/share/systemtap -%global tapsetdir %{tapsetroot}/tapset/%{_build_cpu} +%global tapsetdir %{tapsetroot}/tapset/%{stapinstall} %endif # not-duplicated scriplets for normal/debug packages %global update_desktop_icons /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : -%global check_sum_presented_in_spec() %{expand: -md5sum %1 -currentMd5sum=`md5sum %1 | sed "s;\\s.*;;"` -specfile=%{_specdir}/%{name}.spec -grep -e md5sum -A 20 $specfile | grep $currentMd5sum -} %global post_script() %{expand: update-desktop-database %{_datadir}/applications &> /dev/null || : @@ -222,37 +241,6 @@ exit 0 %global post_headless() %{expand: -# FIXME: identical binaries are copied, not linked. This needs to be -# fixed upstream. -# The pretrans lua scriptlet prevents an unmodified java.security -# from being replaced via an update. It gets created as -# java.security.rpmnew instead. This invalidates the patch of -# JDK-8061210 of the January 2015 CPU, JDK-8043201 of the -# July 2015 CPU and JDK-8141287 of the January 2016 CPU. We -# fix this via a post scriptlet which runs on updates. -if [ "$1" -gt 1 ]; then - javasecurity="%{_jvmdir}/%{uniquesuffix}/jre/lib/security/java.security" - sum=$(md5sum "${javasecurity}" | cut -d' ' -f1) - # This is the md5sum of an unmodified java.security file - if [ "${sum}" = '1690ac33955594f71dc952c9e83fd396' -o \\ - "${sum}" = 'b138695d0c0ea947e64a21a627d973ba' -o \\ - "${sum}" = 'd17958676bdb9f9d941c8a59655311fb' -o \\ - "${sum}" = '5463aef7dbf0bbcfe79e0336a7f92701' -o \\ - "${sum}" = '400cc64d4dd31f36dc0cc2c701d603db' -o \\ - "${sum}" = '321342219bb130d238ff144b9e5dbfc1' -o \\ - "${sum}" = '134a37a84983b620f4d8d51a550c0c38' -o \\ - "${sum}" = '5ea976e209d0d0b5b6ab148416123e02' -o \\ - "${sum}" = '5ab4c77cf14fbd7f7ee6f51a7a73d88c' -o \\ - "${sum}" = 'b727442b4ac0e3b8a26ec9741ad463e5' -o \\ - "${sum}" = 'a59c6d96aeae1303fb8ba85e97588e9d' -o \\ - "${sum}" = '3cd782982a47aa06399f5258ede65577' -o \\ - "${sum}" = 'f87e2b039e6d5a6b34c451e4f9f18dfb' ]; then - if [ -f "${javasecurity}.rpmnew" ]; then - mv -f "${javasecurity}.rpmnew" "${javasecurity}" - fi - fi -fi - %ifarch %{jit_arches} # MetaspaceShared::generate_vtable_methods not implemented for PPC JIT %ifnarch %{power64} @@ -317,6 +305,15 @@ update-alternatives --install %{_jvmdir}/jre-%{javaver}-%{origin} jre_%{javaver} update-desktop-database %{_datadir}/applications &> /dev/null || : /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : + +# see pretrans where this file is declared +# also see that pretrans is only for nondebug +if [ ! "%1" == %{debug_suffix} ]; then + if [ -f %{_libexecdir}/copy_jdk_configs_fixFiles.sh ] ; then + sh %{_libexecdir}/copy_jdk_configs_fixFiles.sh %{rpm_state_dir}/%{name}.%{_arch} %{_jvmdir}/%{sdkdir %%1} + fi +fi + exit 0 } @@ -644,8 +641,8 @@ Requires: fontconfig%{?_isa} Requires: xorg-x11-fonts-Type1 # Requires rest of java -Requires: %{name}-headless%1 = %{epoch}:%{version}-%{release} -OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release} +Requires: %{name}-headless%1%{?_isa} = %{epoch}:%{version}-%{release} +OrderWithRequires: %{name}-headless%1%{?_isa} = %{epoch}:%{version}-%{release} # Standard JPackage base provides. @@ -677,7 +674,7 @@ Requires: lksctp-tools%{?_isa} Requires: nss%{?_isa} %{NSS_BUILDTIME_VERSION} Requires: nss-softokn%{?_isa} %{NSSSOFTOKN_BUILDTIME_VERSION} # tool to copy jdk's configs - should be Recommends only, but then only dnf/yum eforce it, not rpm transaction and so no configs are persisted when pure rpm -u is run. I t may be consiedered as regression -Requires: copy-jdk-configs >= 1.1-3 +Requires: copy-jdk-configs >= 2.2 OrderWithRequires: copy-jdk-configs # Post requires alternatives to install tool alternatives. Requires(post): %{_sbindir}/alternatives @@ -716,8 +713,8 @@ Provides: /usr/bin/jjs %global java_devel_rpo() %{expand: # Require base package. -Requires: %{name}%1 = %{epoch}:%{version}-%{release} -OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release} +Requires: %{name}%1%{?_isa} = %{epoch}:%{version}-%{release} +OrderWithRequires: %{name}-headless%1%{?_isa} = %{epoch}:%{version}-%{release} # Post requires alternatives to install tool alternatives. Requires(post): %{_sbindir}/alternatives # in version 1.7 and higher for --family switch @@ -742,14 +739,16 @@ Provides: java-devel%1 = %{epoch}:%{javaver} %global java_demo_rpo() %{expand: -Requires: %{name}%1 = %{epoch}:%{version}-%{release} -OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release} +Requires: %{name}%1%{?_isa} = %{epoch}:%{version}-%{release} +OrderWithRequires: %{name}-headless%1%{?_isa} = %{epoch}:%{version}-%{release} + +Provides: java-%{javaver}-%{origin}-demo = %{epoch}:%{version}-%{release} #Obsoletes: java-1.7.0-openjdk-demo%1 } %global java_javadoc_rpo() %{expand: -OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release} +OrderWithRequires: %{name}-headless%1%{?_isa} = %{epoch}:%{version}-%{release} # Post requires alternatives to install javadoc alternative. Requires(post): %{_sbindir}/alternatives # in version 1.7 and higher for --family switch @@ -762,21 +761,28 @@ Requires(postun): chkconfig >= 1.7 # Standard JPackage javadoc provides. Provides: java-javadoc%1 = %{epoch}:%{version}-%{release} Provides: java-%{javaver}-javadoc%1 = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-%{origin}-javadoc = %{epoch}:%{version}-%{release} #Obsoletes: java-1.7.0-openjdk-javadoc%1 } %global java_src_rpo() %{expand: -Requires: %{name}-headless%1 = %{epoch}:%{version}-%{release} +Requires: %{name}-headless%1%{?_isa} = %{epoch}:%{version}-%{release} +# Standard JPackage javadoc provides. +Provides: java-src%1 = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-src%1 = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-%{origin}-src = %{epoch}:%{version}-%{release} #Obsoletes: java-1.7.0-openjdk-src%1 } %global java_accessibility_rpo() %{expand: -Requires: java-atk-wrapper -Requires: %{name}%1 = %{epoch}:%{version}-%{release} -OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release} +Requires: java-atk-wrapper%{?_isa} +Requires: %{name}%1%{?_isa} = %{epoch}:%{version}-%{release} +OrderWithRequires: %{name}-headless%1%{?_isa} = %{epoch}:%{version}-%{release} + +Provides: java-%{javaver}-%{origin}-accessibility = %{epoch}:%{version}-%{release} #Obsoletes: java-1.7.0-openjdk-accessibility%1 } @@ -786,7 +792,7 @@ OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release} Name: java-%{javaver}-%{origin} Version: %{javaver}.%{updatever} -Release: 1.%{buildver}%{?dist} +Release: 11.%{buildver}%{?dist} # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons, # and this change was brought into RHEL-4. java-1.5.0-ibm packages # also included the epoch in their virtual provides. This created a @@ -811,6 +817,16 @@ URL: http://openjdk.java.net/ # where the source is obtained from http://hg.openjdk.java.net/%%{project}/%%{repo} Source0: %{project}-%{repo}-%{revision}.tar.xz +# Shenandoah HotSpot +# aarch64-port/jdk8u-shenandoah contains an integration forest of +# OpenJDK 8u, the aarch64 port and Shenandoah +# To regenerate, use: +# VERSION=%%{shenandoah_revision} +# FILE_NAME_ROOT=%%{shenandoah_project}-%%{shenandoah_repo}-${VERSION} +# REPO_ROOT= REPOS=hotspot generate_source_tarball.sh +# where the source is obtained from http://hg.openjdk.java.net/%%{project}/%%{repo} +Source1: %{shenandoah_project}-%{shenandoah_repo}-%{shenandoah_revision}.tar.xz + # Custom README for -src subpackage Source2: README.src @@ -818,14 +834,14 @@ Source2: README.src # They are based on code contained in the IcedTea7 project. # Systemtap tapsets. Zipped up to keep it small. -Source8: systemtap-tapset-3.1.0.tar.xz +Source8: systemtap-tapset-3.4.0pre01.tar.xz # Desktop files. Adapated from IcedTea. Source9: jconsole.desktop.in Source10: policytool.desktop.in # nss configuration file -Source11: nss.cfg +Source11: nss.cfg.in # Removed libraries that we link instead Source12: %{name}-remove-intree-libraries.sh @@ -879,6 +895,11 @@ Patch509: rh1176206-root.patch Patch523: pr2974-rh1337583.patch # PR3083, RH1346460: Regression in SSL debug output without an ECC provider Patch528: pr3083-rh1346460.patch +# Patches 204 and 205 stop the build adding .gnu_debuglink sections to unstripped files +Patch204: hotspot-remove-debuglink.patch +Patch205: dont-add-unnecessary-debug-links.patch +# Enable debug information for assembly code files +Patch206: hotspot-assembler-debuginfo.patch # Arch-specific upstreamable patches # PR2415: JVM -Xmx requirement is too high on s390 @@ -909,20 +930,36 @@ Patch507: pr2842-02.patch Patch400: 8154313.patch # S6260348, PR3066: GTK+ L&F JTextComponent not respecting desktop caret blink rate Patch526: 6260348-pr3066.patch -# 8181419, PR3413, RH1463144: Race in jdwp invoker handling may lead to crashes or invalid results -Patch553: 8181419-pr3413-rh1463144.patch +# 8061305, PR3335, RH1423421: Javadoc crashes when method name ends with "Property" +Patch538: 8061305-pr3335-rh1423421.patch +# 8175813, PR3394, RH1448880: PPC64: "mbind: Invalid argument" when -XX:+UseNUMA is used +Patch550: 8175813-pr3394-rh1448880.patch +# 8181055, PR3394, RH1448880: PPC64: "mbind: Invalid argument" still seen after 8175813 +Patch551: 8181055-pr3394-rh1448880.patch + +# Patches upstream and appearing in 8u131 +# 6515172, PR3346: Runtime.availableProcessors() ignores Linux taskset command +Patch542: 6515172-pr3346.patch # Patches upstream and appearing in 8u152 # 8153711, PR3313, RH1284948: [REDO] JDWP: Memory Leak: GlobalRefs never deleted when processing invokeMethod command Patch535: 8153711-pr3313-rh1284948.patch +# 8144566, PR3352: Custom HostnameVerifier disables SNI extension +Patch544: 8144566-pr3352.patch +# 8155049, PR3352: New tests from 8144566 fail with "No expected Server Name Indication" +Patch545: 8155049-pr3352.patch # 8162384, PR3122, RH1358661: Performance regression: bimorphic inlining may be bypassed by type speculation Patch532: 8162384-pr3122-rh1358661.patch +# 8165231, RH1437545: java.nio.Bits.unaligned() doesn't return true on ppc +Patch546: 8165231-rh1437545.patch # 8173941, PR3326: SA does not work if executable is DSO Patch547: 8173941-pr3326.patch -# 8179084, PR3409, RH1455694: HotSpot VM fails to start when AggressiveHeap is set -Patch552: 8179084-pr3409-rh1455694.patch -# 8175887, PR3415: C1 value numbering handling of Unsafe.get*Volatile is incorrect -Patch554: 8175887-pr3415.patch +# 8174164, PR3334, RH1417266: SafePointNode::_replaced_nodes breaks with irreducible loops" +Patch537: 8174164-pr3334-rh1417266.patch +# 8174729, PR3336, RH1420518: Race Condition in java.lang.reflect.WeakCache +Patch548: 8174729-pr3336-rh1420518.patch +# 8175097, PR3334, RH1417266: [TESTBUG] 8174164 fix missed the test +Patch549: 8175097-pr3334-rh1417266.patch # Patches ineligible for 8u # 8043805: Allow using a system-installed libjpeg @@ -935,6 +972,8 @@ Patch525: pr1834-rh1022017.patch Patch533: rh1367357.patch # Turn on AssumeMP by default on RHEL systems Patch534: always_assumemp.patch +# PR2888: OpenJDK should check for system cacerts database (e.g. /etc/pki/java/cacerts) +Patch539: pr2888.patch # Non-OpenJDK fixes @@ -944,10 +983,12 @@ BuildRequires: alsa-lib-devel BuildRequires: binutils BuildRequires: cups-devel BuildRequires: desktop-file-utils +BuildRequires: elfutils BuildRequires: fontconfig BuildRequires: freetype-devel BuildRequires: giflib-devel BuildRequires: gcc-c++ +BuildRequires: gdb BuildRequires: gtk2-devel BuildRequires: lcms2-devel BuildRequires: libjpeg-devel @@ -980,8 +1021,6 @@ BuildRequires: gcc >= 4.8.3-8 # Build requirements for SunEC system NSS support BuildRequires: nss-softokn-freebl-devel >= 3.16.1 -# cacerts build requirement. -BuildRequires: openssl %if %{with_systemtap} BuildRequires: systemtap-sdt-devel %endif @@ -1201,6 +1240,16 @@ if [ $prioritylength -ne 7 ] ; then fi # For old patches ln -s openjdk jdk8 +%if %{use_shenandoah_hotspot} +# On Shenandoah-supported architectures, replace HotSpot with +# the Shenandoah version +pushd openjdk +tar -xf %{SOURCE1} +rm -rf hotspot +mv openjdk/hotspot . +rm -rf openjdk +popd +%endif cp %{SOURCE2} . @@ -1221,6 +1270,11 @@ sh %{SOURCE12} %patch202 %patch203 +# Debugging fixes +%patch204 +%patch205 +%patch206 + %patch1 %patch3 %patch5 @@ -1260,14 +1314,22 @@ sh %{SOURCE12} %patch528 %patch532 %patch535 +%patch537 +%patch538 +%patch542 +%patch544 +%patch545 +%patch546 %patch547 -%patch552 -%patch553 -%patch554 +%patch548 +%patch549 +%patch550 +%patch551 # RPM-only fixes %patch525 %patch533 +%patch539 # RHEL-only patches %if 0%{?rhel} @@ -1313,8 +1375,8 @@ for file in %{SOURCE9} %{SOURCE10} ; do done done -# this is check which controls, that latest java.security is included in post(_headless) -%{check_sum_presented_in_spec openjdk/jdk/src/share/lib/security/java.security-linux} +# Setup nss.cfg +sed -e s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g %{SOURCE11} > nss.cfg %build @@ -1417,7 +1479,7 @@ popd >& /dev/null export JAVA_HOME=$(pwd)/%{buildoutputdir $suffix}/images/%{j2sdkimage} # Install nss.cfg right away as we will be using the JRE above -install -m 644 %{SOURCE11} $JAVA_HOME/jre/lib/security/ +install -m 644 nss.cfg $JAVA_HOME/jre/lib/security/ # Use system-wide tzdata rm $JAVA_HOME/jre/lib/tzdb.dat @@ -1433,9 +1495,6 @@ for suffix in %{rev_build_loop} ; do export JAVA_HOME=$(pwd)/%{buildoutputdir $suffix}/images/%{j2sdkimage} -# check java.security in this build is also in this specfile -%{check_sum_presented_in_spec $JAVA_HOME/jre/lib/security/java.security} - # Check unlimited policy has been used $JAVA_HOME/bin/javac -d . %{SOURCE13} $JAVA_HOME/bin/java TestCryptoLevel @@ -1445,18 +1504,62 @@ $JAVA_HOME/bin/javac -d . %{SOURCE14} $JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||") # Check debug symbols are present and can identify code -SERVER_JVM="$JAVA_HOME/jre/lib/%{archinstall}/server/libjvm.so" -if [ -f "$SERVER_JVM" ] ; then - nm -aCl "$SERVER_JVM" | grep javaCalls.cpp -fi -CLIENT_JVM="$JAVA_HOME/jre/lib/%{archinstall}/client/libjvm.so" -if [ -f "$CLIENT_JVM" ] ; then - nm -aCl "$CLIENT_JVM" | grep javaCalls.cpp -fi -ZERO_JVM="$JAVA_HOME/jre/lib/%{archinstall}/zero/libjvm.so" -if [ -f "$ZERO_JVM" ] ; then - nm -aCl "$ZERO_JVM" | grep javaCalls.cpp -fi +find "$JAVA_HOME" -iname '*.so' -print0 | while read -d $'\0' lib +do + if [ -f "$lib" ] ; then + echo "Testing $lib for debug symbols" + # All these tests rely on RPM failing the build if the exit code of any set + # of piped commands is non-zero. + + # Test for .debug_* sections in the shared object. This is the main test. + # Stripped objects will not contain these. + eu-readelf -S "$lib" | grep "] .debug_" + test $(eu-readelf -S "$lib" | grep -E "\]\ .debug_(info|abbrev)" | wc --lines) == 2 + + # Test FILE symbols. These will most likely be removed by anyting that + # manipulates symbol tables because it's generally useless. So a nice test + # that nothing has messed with symbols. + old_IFS="$IFS" + IFS=$'\n' + for line in $(eu-readelf -s "$lib" | grep "00000000 0 FILE LOCAL DEFAULT") + do + # We expect to see .cpp files, except for architectures like aarch64 and + # s390 where we expect .o and .oS files + echo "$line" | grep -E "ABS ((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx|o|oS))?$" + done + IFS="$old_IFS" + + # If this is the JVM, look for javaCalls.(cpp|o) in FILEs, for extra sanity checking. + if [ "`basename $lib`" = "libjvm.so" ]; then + eu-readelf -s "$lib" | \ + grep -E "00000000 0 FILE LOCAL DEFAULT ABS javaCalls.(cpp|o)$" + fi + + # Test that there are no .gnu_debuglink sections pointing to another + # debuginfo file. There shouldn't be any debuginfo files, so the link makes + # no sense either. + eu-readelf -S "$lib" | grep 'gnu' + if eu-readelf -S "$lib" | grep '] .gnu_debuglink' | grep PROGBITS; then + echo "bad .gnu_debuglink section." + eu-readelf -x .gnu_debuglink "$lib" + false + fi + fi +done + +# Make sure gdb can do a backtrace based on line numbers on libjvm.so +gdb -q "$JAVA_HOME/bin/java" < - 1:1.8.0.141-1.b16 -- Update to aarch64-jdk8u141-b16. -- Revert change to remove-intree-libraries.sh following backout of 8173207 -- Resolves: rhbz#1466509 - -* Wed Jul 05 2017 Andrew Hughes - 1:1.8.0.141-0.b15 -- Update to aarch64-jdk8u141-b15. -- Update location of OpenJDK system library source code in remove-intree-libraries.sh -- Drop upstreamed patches for 6515172, 8144566, 8155049, 8165231, 8174164, 8174729 and 8175097. -- Update PR1983, PR2899 and PR2934 (SunEC + system NSS) to accomodate 8175110. -- Add MD5 checksum for the new java.security file (SHA1 disabled for server-side certificates in jdkCA) -- Resolves: rhbz#1466509 - -* Wed Jul 05 2017 Andrew Hughes - 1:1.8.0.131-4.b12 -- Add backports from 8u152 (8179084/RH1455694, 8181419/RH1463144, 8175887) ahead of July CPU. -- Resolves: rhbz#1466509 - -* Thu Apr 27 2017 Andrew Hughes - 1:1.8.0.131-3.b12 +* Tue Jun 13 2017 Jiri Vanek - 1:1.8.0.131-11.b12 +- make to use latest c-j-c and so fix persisting issues with java.security and other configfiles +- 1183793 is missing blocker +- Resolves: rhbz#1448880 + +* Wed May 31 2017 Zhengyu Gu - 1:1.8.0.131-10.b12 +- Added 8181055-pr3394-rh1448880.patch to fix a corner case of previous change +- Resolves: rhbz#1448880 + +* Fri May 19 2017 Andrew Hughes - 1:1.8.0.131-9.b12 +- Move 8175813/PR3394/RH1448880 to correct section and document. +- Resolves: rhbz#1448880 + +* Fri May 19 2017 Jiri Vanek - 1:1.8.0.131-9.b12 +- Added and applied patch550 8175813-rh1448880.patch +- Resolves: rhbz#1448880 + +* Fri May 12 2017 Andrew Hughes - 1:1.8.0.131-8.b12 +- Restore cacerts symlink as some broken apps hardcode the path (see RH1448802) +- Resolves: rhbz#1319875 + +* Mon May 01 2017 Andrew Hughes - 1:1.8.0.131-7.b12 +- Fix misspelt accessibility Provides +- Resolves: rhbz#1438514 + +* Thu Apr 27 2017 Andrew Hughes - 1:1.8.0.131-6.b12 - Update to aarch64-jdk8u131-b12 and aarch64-shenandoah-jdk8u131-b12 for AArch64 8168699 fix -- Resolves: rhbz#1449258 +- Resolves: rhbz#1443417 -* Thu Apr 13 2017 Andrew Hughes - 1:1.8.0.131-2.b13 -- Backport "S8153711: [REDO] JDWP: Memory Leak: GlobalRefs never deleted when processing invokeMethod command" -- Resolves: rhbz#1442162 +* Fri Apr 21 2017 Jiri Vanek - 1:1.8.0.131-5.b11 +- Minor tweaks +- Resolves: rhbz#1438514 + +* Tue Apr 18 2017 Andrew Hughes - 1:1.8.0.131-4.b11 +- Rename SystemTap tapset tarball to avoid conflicts with previous version. +- Resolves: rhbz#1438514 + +* Fri Apr 14 2017 Andrew Hughes - 1:1.8.0.131-3.b11 +- Bump release to make sure y-stream takes priority over z-stream. +- Resolves: rhbz#1438514 + +* Thu Apr 13 2017 Andrew Hughes - 1:1.8.0.131-2.b11 +- Update tapset tarball to include the better error handling in PR3348 +- http://icedtea.classpath.org/hg/icedtea8/rev/14fc67a5d5a3 +- Resolves: rhbz#1438514 * Thu Apr 13 2017 Andrew Hughes - 1:1.8.0.131-1.b11 -- Update to aarch64-jdk8u131-b11. +- Update to aarch64-jdk8u131-b11 and aarch64-shenandoah-jdk8u131-b11. - Drop upstreamed patches for 8147910, 8161993, 8170888 and 8173783. - Update generate_source_tarball.sh to remove patch remnants. -- Cleanup tarball creation documentation to avoid duplication. +- Cleanup Shenandoah tarball referencing and document how to create it. - Add MD5 checksum for the new java.security file (MD5 disabled for JAR signing) - Resolves: rhbz#1438751 -* Fri Apr 07 2017 Andrew Hughes - 1:1.8.0.121-1.b13 +* Fri Apr 07 2017 Andrew Hughes - 1:1.8.0.121-10.b14 - Add backports from 8u131 and 8u152 ahead of April CPU. - Apply backports before local RPM fixes so they will be the same as when applied upstream - Adjust RH1022017 following application of 8173783 - Resolves: rhbz#1438751 -* Mon Jan 16 2017 Andrew Hughes - 1:1.8.0.121-0.b13 +* Fri Apr 07 2017 Andrew Hughes - 1:1.8.0.121-10.b14 +- Move unprocessed nss.cfg to nss.cfg.in and add missing substitution to create nss.cfg for install +- Resolves: rhbz#1429774 + +* Mon Mar 20 2017 Andrew Hughes - 1:1.8.0.121-9.b14 +- Actually fix SystemTap source tarball name to match new one +- Resolves: rhbz#1373848 + +* Sat Mar 18 2017 Andrew Hughes - 1:1.8.0.121-9.b14 +- Introduce stapinstall variable to set SystemTap arch directory correctly (e.g. arm64 on aarch64) +- Update jstack tapset to handle AArch64 +- Resolves: rhbz#1373848 + +* Mon Mar 13 2017 jvanek - 1:1.8.0.121-8.b14 +- self-sependencies restricted by isa +- Resolves: rhbz#1388520 + +* Wed Mar 08 2017 jvanek - 1:1.8.0.121-7.b14 +- updated to aarch64-shenandoah-jdk8u121-b14-shenandoah-merge-2017-03-08 (from aarch64-port/jdk8u-shenandoah) of hotspot +- used aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u121-b14-shenandoah-merge-2017-03-09.tar.xz as new sources for hotspot +- Resolves: rhbz#1400306 + +* Fri Mar 03 2017 Andrew Hughes - 1:1.8.0.121-6.b14 +- Restore .gitignore lines removed by "Fedora sync" +- Resolves: rhbz#1400306 + +* Fri Mar 03 2017 Andrew Hughes - 1:1.8.0.121-6.b14 +- Patch OpenJDK to check the system cacerts database directly +- Remove unneeded symlink to the system cacerts database +- Drop outdated openssl dependency from when the RPM built the cacerts database +- Resolves: rhbz#1319875 + +* Fri Mar 03 2017 Andrew Hughes - 1:1.8.0.121-6.b14 +- Regenerate tarball with correct version of PR2126 patch. +- Update generate_source_tarball.sh script to download correct version. +- Resolves: rhbz#1400306 + +* Fri Mar 03 2017 Andrew Hughes - 1:1.8.0.121-6.b14 +- Properly document recently added patches. +- Resolves: rhbz#1400306 + +* Tue Feb 28 2017 jvanek - 1:1.8.0.121-5.b14 +- shenandoah enabled on aarch64 +- Resolves: rhbz#1400306 + +* Tue Feb 28 2017 jvanek - 1:1.8.0.121-4.b14 +- added shenandoah hotspot +- sync with fedora +- Resolves: rhbz#1400306 +- Resolves: rhbz#1390708 +- Resolves: rhbz#1388520 +- Resolves: rhbz#1403992 + +* Mon Feb 20 2017 Andrew Hughes - 1:1.8.0.121-3.b13 +- Backport "8170888: [linux] Experimental support for cgroup memory limits in container (ie Docker) environments" +- Resolves: rhbz#1390708 + +* Fri Feb 17 2017 Andrew Hughes - 1:1.8.0.121-2.b13 +- Backport "S8153711: [REDO] JDWP: Memory Leak: GlobalRefs never deleted when processing invokeMethod command" +- Resolves: rhbz#1284948 + +* Mon Jan 16 2017 Andrew Hughes - 1:1.8.0.121-1.b13 - Update to aarch64-jdk8u121-b13. - Add MD5 checksum for the new java.security file (EC < 224, DSA < 1024 restricted) - Update PR1834/RH1022017 fix to reduce curves reported by SSL to apply against u121. - Resolves: rhbz#1410612 -* Sun Jan 15 2017 Andrew Hughes - 1:1.8.0.112-0.b16 +* Mon Jan 16 2017 Andrew Hughes - 1:1.8.0.112-1.b16 +- Fix accidental change of line in updated size_t patch. +- Resolves: rhbz#1391132 + +* Sun Jan 15 2017 Andrew Hughes - 1:1.8.0.112-1.b16 - Update to aarch64-jdk8u112-b16. - Drop upstreamed patches for 8044762, 8049226, 8154210, 8158260 and 8160122. - Re-generate size_t and key size (RH1163501) patches against u112. -- Resolves: rhbz#1410612 +- Resolves: rhbz#1391132 -* Thu Jan 12 2017 Andrew Hughes - 1:1.8.0.111-4.b18 +* Thu Jan 12 2017 Andrew Hughes - 1:1.8.0.111-5.b18 - Use java-1.7.0-openjdk to bootstrap on RHEL to allow us to use main build target -- Resolves: rhbz#1410612 +- Resolves: rhbz#1391132 * Mon Jan 09 2017 Andrew Hughes - 1:1.8.0.111-4.b18 -- Update to aarch64-jdk8u111-b18, synced with upstream u111, S8170873 and new AArch64 fixes - Replace our correct version of 8159244 with the amendment to the 8u version from 8160122. -- Resolves: rhbz#1410612 +- Resolves: rhbz#1391132 + +* Mon Jan 09 2017 Andrew Hughes - 1:1.8.0.111-4.b18 +- Update to aarch64-jdk8u111-b18, synced with upstream u111, S8170873 and new AArch64 fixes +- Resolves: rhbz#1391132 * Mon Nov 07 2016 Andrew Hughes - 1:1.8.0.111-3.b15 - Add MD5 checksum from RHEL 7.2 security update so the 7.3 one overwrites it. -- Resolves: rhbz#1382736 +- Resolves: rhbz#1391132 * Mon Oct 10 2016 Andrew Hughes - 1:1.8.0.111-2.b15 - Turn debug builds on for all JIT architectures. Always AssumeMP on RHEL.