Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
List overview
Download
scm-commits
April 2017
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
scm-commits@lists.fedoraproject.org
1 participants
14047 discussions
Start a n
N
ew thread
akasko pushed to java-1.8.0-openjdk-aarch32 (f26). "8u131 update"
by notificationsï¼ fedoraproject.org
30 Apr '17
30 Apr '17
From f7e4c1a5736d2776cdd4a8f3f93ca340c2de868a Mon Sep 17 00:00:00 2001 From: Alex Kashchenko <akashche(a)redhat.com> Date: Sun, 30 Apr 2017 18:18:49 +0000 Subject: 8u131 update --- .gitignore | 2 + 8061305-pr3335-rh1423421.patch | 33 ++ 8144566-pr3352.patch | 911 ++++++++++++++++++++++++++++++++++++++++ 8153711-pr3313-rh1284948.patch | 669 +++++++++++++++++++++++++++++ 8155049-pr3352.patch | 41 ++ 8162384-pr3122-rh1358661.patch | 54 +++ 8165231-rh1437545.patch | 48 +++ 8173941-pr3326.patch | 77 ++++ 8174164-pr3334-rh1417266.patch | 79 ++++ 8174729-pr3336-rh1420518.patch | 122 ++++++ 8175097-pr3334-rh1417266.patch | 100 +++++ java-1.8.0-openjdk-aarch32.spec | 257 ++++++++---- nss.cfg | 5 - nss.cfg.in | 5 + pr1834-rh1022017.patch | 4 +- pr2888.patch | 60 +++ sources | 4 +- 17 files changed, 2371 insertions(+), 100 deletions(-) create mode 100644 8061305-pr3335-rh1423421.patch create mode 100644 8144566-pr3352.patch create mode 100644 8153711-pr3313-rh1284948.patch create mode 100644 8155049-pr3352.patch create mode 100644 8162384-pr3122-rh1358661.patch create mode 100644 8165231-rh1437545.patch create mode 100644 8173941-pr3326.patch create mode 100644 8174164-pr3334-rh1417266.patch create mode 100644 8174729-pr3336-rh1420518.patch create mode 100644 8175097-pr3334-rh1417266.patch delete mode 100644 nss.cfg create mode 100644 nss.cfg.in create mode 100644 pr2888.patch diff --git a/.gitignore b/.gitignore index 6c608c3..70f7217 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ /systemtap-tapset-3.1.0.tar.xz /aarch32-port-jdk8u-jdk8u112-b16-aarch32-161109.tar.xz /aarch32-port-jdk8u-jdk8u121-b13-aarch32-170210.tar.xz +/aarch32-port-jdk8u-jdk8u131-b12-aarch32-170420.tar.xz +/systemtap-tapset-3.4.0pre01.tar.xz diff --git a/8061305-pr3335-rh1423421.patch b/8061305-pr3335-rh1423421.patch new file mode 100644 index 0000000..384c52a --- /dev/null +++ b/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/8144566-pr3352.patch b/8144566-pr3352.patch new file mode 100644 index 0000000..9a2a294 --- /dev/null +++ b/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.<SNIServerName>emptyList(); + Collection<SNIMatcher> sniMatchers = + Collections.<SNIMatcher>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<SNIServerName> sniNames = params.getServerNames(); + if (sniNames != null) { ++ noSniExtension = sniNames.isEmpty(); + serverNames = sniNames; + } + + Collection<SNIMatcher> 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/8153711-pr3313-rh1284948.patch b/8153711-pr3313-rh1284948.patch new file mode 100644 index 0000000..b93fa06 --- /dev/null +++ b/8153711-pr3313-rh1284948.patch @@ -0,0 +1,669 @@ +# HG changeset patch +# User sgehwolf +# Date 1458555849 -3600 +# Mon Mar 21 11:24:09 2016 +0100 +# Node ID 9f6a0864a734ae3fd0eb198768db7cdee53ba0ed +# Parent 1179be40f1e3b59a890e96a5a9d3ff6fc18a2846 +8153711, PR3313: [REDO] JDWP: Memory Leak: GlobalRefs never deleted when processing invokeMethod command +Summary: Delete global references in invoker_completeInvokeRequest() +Reviewed-by: sspitsyn, dsamersoff + +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 +@@ -211,6 +211,62 @@ + return error; + } + ++/* ++ * 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(). ++ */ ++static void ++deleteGlobalArgumentRefs(JNIEnv *env, InvokeRequest *request) ++{ ++ void *cursor; ++ jint argIndex = 0; ++ jvalue *argument = request->arguments; ++ jbyte argumentTag = firstArgumentTypeTag(request->methodSignature, &cursor); ++ ++ if (request->clazz != NULL) { ++ tossGlobalRef(env, &(request->clazz)); ++ } ++ if (request->instance != NULL) { ++ tossGlobalRef(env, &(request->instance)); ++ } ++ /* Delete global argument references */ ++ while (argIndex < request->argumentCount) { ++ if ((argumentTag == JDWP_TAG(OBJECT)) || ++ (argumentTag == JDWP_TAG(ARRAY))) { ++ if (argument->l != NULL) { ++ tossGlobalRef(env, &(argument->l)); ++ } ++ } ++ argument++; ++ argIndex++; ++ argumentTag = nextArgumentTypeTag(&cursor); ++ } ++} ++ + static jvmtiError + fillInvokeRequest(JNIEnv *env, InvokeRequest *request, + jbyte invokeType, jbyte options, jint id, +@@ -320,6 +376,8 @@ + invokeConstructor(JNIEnv *env, InvokeRequest *request) + { + jobject object; ++ ++ JDI_ASSERT_MSG(request->clazz, "Request clazz null"); + object = JNI_FUNC_PTR(env,NewObjectA)(env, request->clazz, + request->method, + request->arguments); +@@ -336,6 +394,7 @@ + case JDWP_TAG(OBJECT): + case JDWP_TAG(ARRAY): { + jobject object; ++ JDI_ASSERT_MSG(request->clazz, "Request clazz null"); + object = JNI_FUNC_PTR(env,CallStaticObjectMethodA)(env, + request->clazz, + request->method, +@@ -424,6 +483,7 @@ + case JDWP_TAG(OBJECT): + case JDWP_TAG(ARRAY): { + jobject object; ++ JDI_ASSERT_MSG(request->instance, "Request instance null"); + object = JNI_FUNC_PTR(env,CallObjectMethodA)(env, + request->instance, + request->method, +@@ -511,6 +571,8 @@ + case JDWP_TAG(OBJECT): + case JDWP_TAG(ARRAY): { + jobject object; ++ JDI_ASSERT_MSG(request->clazz, "Request clazz null"); ++ JDI_ASSERT_MSG(request->instance, "Request instance null"); + object = JNI_FUNC_PTR(env,CallNonvirtualObjectMethodA)(env, + request->instance, + request->clazz, +@@ -607,6 +669,8 @@ + JNIEnv *env; + jboolean startNow; + InvokeRequest *request; ++ jbyte options; ++ jbyte invokeType; + + JDI_ASSERT(thread); + +@@ -623,6 +687,9 @@ + if (startNow) { + request->started = JNI_TRUE; + } ++ options = request->options; ++ invokeType = request->invokeType; ++ + debugMonitorExit(invokerLock); + + if (!startNow) { +@@ -637,7 +704,7 @@ + + JNI_FUNC_PTR(env,ExceptionClear)(env); + +- switch (request->invokeType) { ++ switch (invokeType) { + case INVOKE_CONSTRUCTOR: + invokeConstructor(env, request); + break; +@@ -645,7 +712,7 @@ + invokeStatic(env, request); + break; + case INVOKE_INSTANCE: +- if (request->options & JDWP_INVOKE_OPTIONS(NONVIRTUAL) ) { ++ if (options & JDWP_INVOKE_OPTIONS(NONVIRTUAL) ) { + invokeNonvirtual(env, request); + } else { + invokeVirtual(env, request); +@@ -723,12 +790,23 @@ + } + + /* ++ * At this time, there's no need to retain global references on ++ * arguments since the reply is processed. No one will deal with ++ * this request ID anymore, so we must call deleteGlobalArgumentRefs(). ++ * ++ * We cannot delete saved exception or return value references ++ * since otherwise a deleted handle would escape when writing ++ * the response to the stream. Instead, we clean those refs up ++ * after writing the respone. ++ */ ++ deleteGlobalArgumentRefs(env, request); ++ ++ /* + * Give up the lock before I/O operation + */ + debugMonitorExit(invokerLock); + eventHandler_unlock(); + +- + if (!detached) { + outStream_initReply(&out, id); + (void)outStream_writeValue(env, &out, tag, returnValue); +@@ -736,6 +814,16 @@ + (void)outStream_writeObjectRef(env, &out, exc); + outStream_sendReply(&out); + } ++ ++ /* ++ * Delete potentially saved global references of return value ++ * and exception ++ */ ++ eventHandler_lock(); // for proper lock order ++ debugMonitorEnter(invokerLock); ++ deletePotentiallySavedGlobalRefs(env, request); ++ debugMonitorExit(invokerLock); ++ eventHandler_unlock(); + } + + jboolean +diff --git a/test/com/sun/jdi/oom/@debuggeeVMOptions b/test/com/sun/jdi/oom/@debuggeeVMOptions +new file mode 100644 +--- /dev/null ++++ openjdk/jdk/test/com/sun/jdi/oom/@debuggeeVMOptions +@@ -0,0 +1,1 @@ ++-Xmx40m +\ No newline at end of file +diff --git a/test/com/sun/jdi/oom/OomDebugTest.java b/test/com/sun/jdi/oom/OomDebugTest.java +new file mode 100644 +--- /dev/null ++++ openjdk/jdk/test/com/sun/jdi/oom/OomDebugTest.java +@@ -0,0 +1,417 @@ ++/* ++ * Copyright (c) 2016 Red Hat Inc. ++ * ++ * 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 8153711 ++ * @summary JDWP: Memory Leak (global references not deleted after invokeMethod). ++ * ++ * @author Severin Gehwolf <sgehwolf(a)redhat.com> ++ * ++ * @library .. ++ * @run build TestScaffold VMConnection TargetListener TargetAdapter ++ * @run compile -g OomDebugTest.java ++ * @run shell OomDebugTestSetup.sh ++ * @run main OomDebugTest OomDebugTestTarget test1 ++ * @run main OomDebugTest OomDebugTestTarget test2 ++ * @run main OomDebugTest OomDebugTestTarget test3 ++ * @run main OomDebugTest OomDebugTestTarget test4 ++ * @run main OomDebugTest OomDebugTestTarget test5 ++ */ ++import java.io.File; ++import java.io.FileInputStream; ++import java.io.FileNotFoundException; ++import java.io.FileOutputStream; ++import java.io.IOException; ++import java.util.ArrayList; ++import java.util.Arrays; ++import java.util.Collections; ++import java.util.HashSet; ++import java.util.List; ++import java.util.Properties; ++import java.util.Set; ++ ++import com.sun.jdi.ArrayReference; ++import com.sun.jdi.ArrayType; ++import com.sun.jdi.ClassType; ++import com.sun.jdi.Field; ++import com.sun.jdi.InvocationException; ++import com.sun.jdi.Method; ++import com.sun.jdi.ObjectReference; ++import com.sun.jdi.ReferenceType; ++import com.sun.jdi.StackFrame; ++import com.sun.jdi.VMOutOfMemoryException; ++import com.sun.jdi.Value; ++import com.sun.jdi.event.BreakpointEvent; ++import com.sun.jdi.event.ExceptionEvent; ++ ++/***************** Target program **********************/ ++ ++class OomDebugTestTarget { ++ ++ OomDebugTestTarget() { ++ System.out.println("DEBUG: invoked constructor"); ++ } ++ static class FooCls { ++ @SuppressWarnings("unused") ++ private byte[] bytes = new byte[3000000]; ++ }; ++ ++ FooCls fooCls = new FooCls(); ++ byte[] byteArray = new byte[0]; ++ ++ void testMethod(FooCls foo) { ++ System.out.println("DEBUG: invoked 'void testMethod(FooCls)', foo == " + foo); ++ } ++ ++ void testPrimitive(byte[] foo) { ++ System.out.println("DEBUG: invoked 'void testPrimitive(byte[])', foo == " + foo); ++ } ++ ++ byte[] testPrimitiveArrRetval() { ++ System.out.println("DEBUG: invoked 'byte[] testPrimitiveArrRetval()'"); ++ return new byte[3000000]; ++ } ++ ++ FooCls testFooClsRetval() { ++ System.out.println("DEBUG: invoked 'FooCls testFooClsRetval()'"); ++ return new FooCls(); ++ } ++ ++ public void entry() {} ++ ++ public static void main(String[] args){ ++ System.out.println("DEBUG: OomDebugTestTarget.main"); ++ new OomDebugTestTarget().entry(); ++ } ++} ++ ++/***************** Test program ************************/ ++ ++public class OomDebugTest extends TestScaffold { ++ ++ private static final String[] ALL_TESTS = new String[] { ++ "test1", "test2", "test3", "test4", "test5" ++ }; ++ private static final Set<String> ALL_TESTS_SET = new HashSet<String>(); ++ static { ++ ALL_TESTS_SET.addAll(Arrays.asList(ALL_TESTS)); ++ } ++ private static final String TEST_CLASSES = System.getProperty("test.classes", "."); ++ private static final File RESULT_FILE = new File(TEST_CLASSES, "results.properties"); ++ private static final String LAST_TEST = ALL_TESTS[ALL_TESTS.length - 1]; ++ private ReferenceType targetClass; ++ private ObjectReference thisObject; ++ private int failedTests; ++ private final String testMethod; ++ ++ public OomDebugTest(String[] args) { ++ super(args); ++ if (args.length != 2) { ++ throw new RuntimeException("Wrong number of command-line arguments specified."); ++ } ++ this.testMethod = args[1]; ++ } ++ ++ @Override ++ protected void runTests() throws Exception { ++ try { ++ addListener(new TargetAdapter() { ++ ++ @Override ++ public void exceptionThrown(ExceptionEvent event) { ++ String name = event.exception().referenceType().name(); ++ System.err.println("DEBUG: Exception thrown in debuggee was: " + name); ++ } ++ }); ++ /* ++ * Get to the top of entry() ++ * to determine targetClass and mainThread ++ */ ++ BreakpointEvent bpe = startTo("OomDebugTestTarget", "entry", "()V"); ++ targetClass = bpe.location().declaringType(); ++ ++ mainThread = bpe.thread(); ++ ++ StackFrame frame = mainThread.frame(0); ++ thisObject = frame.thisObject(); ++ java.lang.reflect.Method m = findTestMethod(); ++ m.invoke(this); ++ } catch (NoSuchMethodException e) { ++ e.printStackTrace(); ++ failure(); ++ } catch (SecurityException e) { ++ e.printStackTrace(); ++ failure(); ++ } ++ /* ++ * resume the target, listening for events ++ */ ++ listenUntilVMDisconnect(); ++ } ++ ++ private java.lang.reflect.Method findTestMethod() ++ throws NoSuchMethodException, SecurityException { ++ return OomDebugTest.class.getDeclaredMethod(testMethod); ++ } ++ ++ private void failure() { ++ failedTests++; ++ } ++ ++ /* ++ * Test case: Object reference as method parameter. ++ */ ++ @SuppressWarnings("unused") // called via reflection ++ private void test1() throws Exception { ++ System.out.println("DEBUG: ------------> Running test1"); ++ try { ++ Field field = targetClass.fieldByName("fooCls"); ++ ClassType clsType = (ClassType)field.type(); ++ Method constructor = getConstructorForClass(clsType); ++ for (int i = 0; i < 15; i++) { ++ @SuppressWarnings({ "rawtypes", "unchecked" }) ++ ObjectReference objRef = clsType.newInstance(mainThread, ++ constructor, ++ new ArrayList(0), ++ ObjectReference.INVOKE_NONVIRTUAL); ++ if (objRef.isCollected()) { ++ System.out.println("DEBUG: Object got GC'ed before we can use it. NO-OP."); ++ continue; ++ } ++ invoke("testMethod", "(LOomDebugTestTarget$FooCls;)V", objRef); ++ } ++ } catch (InvocationException e) { ++ handleFailure(e); ++ } ++ } ++ ++ /* ++ * Test case: Array reference as method parameter. ++ */ ++ @SuppressWarnings("unused") // called via reflection ++ private void test2() throws Exception { ++ System.out.println("DEBUG: ------------> Running test2"); ++ try { ++ Field field = targetClass.fieldByName("byteArray"); ++ ArrayType arrType = (ArrayType)field.type(); ++ ++ for (int i = 0; i < 15; i++) { ++ ArrayReference byteArrayVal = arrType.newInstance(3000000); ++ if (byteArrayVal.isCollected()) { ++ System.out.println("DEBUG: Object got GC'ed before we can use it. NO-OP."); ++ continue; ++ } ++ invoke("testPrimitive", "([B)V", byteArrayVal); ++ } ++ } catch (VMOutOfMemoryException e) { ++ defaultHandleOOMFailure(e); ++ } ++ } ++ ++ /* ++ * Test case: Array reference as return value. ++ */ ++ @SuppressWarnings("unused") // called via reflection ++ private void test3() throws Exception { ++ System.out.println("DEBUG: ------------> Running test3"); ++ try { ++ for (int i = 0; i < 15; i++) { ++ invoke("testPrimitiveArrRetval", ++ "()[B", ++ Collections.EMPTY_LIST, ++ vm().mirrorOfVoid()); ++ } ++ } catch (InvocationException e) { ++ handleFailure(e); ++ } ++ } ++ ++ /* ++ * Test case: Object reference as return value. ++ */ ++ @SuppressWarnings("unused") // called via reflection ++ private void test4() throws Exception { ++ System.out.println("DEBUG: ------------> Running test4"); ++ try { ++ for (int i = 0; i < 15; i++) { ++ invoke("testFooClsRetval", ++ "()LOomDebugTestTarget$FooCls;", ++ Collections.EMPTY_LIST, ++ vm().mirrorOfVoid()); ++ } ++ } catch (InvocationException e) { ++ handleFailure(e); ++ } ++ } ++ ++ /* ++ * Test case: Constructor ++ */ ++ @SuppressWarnings({ "unused", "unchecked", "rawtypes" }) // called via reflection ++ private void test5() throws Exception { ++ System.out.println("DEBUG: ------------> Running test5"); ++ try { ++ ClassType type = (ClassType)thisObject.type(); ++ for (int i = 0; i < 15; i++) { ++ type.newInstance(mainThread, ++ findMethod(targetClass, "<init>", "()V"), ++ new ArrayList(0), ++ ObjectReference.INVOKE_NONVIRTUAL); ++ } ++ } catch (InvocationException e) { ++ handleFailure(e); ++ } ++ } ++ ++ private Method getConstructorForClass(ClassType clsType) { ++ List<Method> methods = clsType.methodsByName("<init>"); ++ if (methods.size() != 1) { ++ throw new RuntimeException("FAIL. Expected only one, the default, constructor"); ++ } ++ return methods.get(0); ++ } ++ ++ private void handleFailure(InvocationException e) { ++ // There is no good way to see the OOME diagnostic message in the target since the ++ // TestScaffold might throw an exception while trying to print the stack trace. I.e ++ // it might get a a VMDisconnectedException before the stack trace printing finishes. ++ System.err.println("FAILURE: InvocationException thrown. Trying to determine cause..."); ++ defaultHandleOOMFailure(e); ++ } ++ ++ private void defaultHandleOOMFailure(Exception e) { ++ e.printStackTrace(); ++ failure(); ++ } ++ ++ @SuppressWarnings({ "rawtypes", "unchecked" }) ++ void invoke(String methodName, String methodSig, Value value) ++ throws Exception { ++ List args = new ArrayList(1); ++ args.add(value); ++ invoke(methodName, methodSig, args, value); ++ } ++ ++ void invoke(String methodName, ++ String methodSig, ++ @SuppressWarnings("rawtypes") List args, ++ Value value) throws Exception { ++ Method method = findMethod(targetClass, methodName, methodSig); ++ if ( method == null) { ++ failure("FAILED: Can't find method: " ++ + methodName + " for class = " + targetClass); ++ return; ++ } ++ invoke(method, args, value); ++ } ++ ++ @SuppressWarnings({ "rawtypes", "unchecked" }) ++ void invoke(Method method, List args, Value value) throws Exception { ++ thisObject.invokeMethod(mainThread, method, args, 0); ++ System.out.println("DEBUG: Done invoking method via debugger."); ++ } ++ ++ Value fieldValue(String fieldName) { ++ Field field = targetClass.fieldByName(fieldName); ++ return thisObject.getValue(field); ++ } ++ ++ // Determine the pass/fail status on some heuristic and don't fail the ++ // test if < 3 of the total number of tests (currently 5) fail. This also ++ // has the nice side effect that all tests are first attempted and only ++ // all tests ran an overall pass/fail status is determined. ++ private static void determineOverallTestStatus(OomDebugTest oomTest) ++ throws IOException, FileNotFoundException { ++ Properties resultProps = new Properties(); ++ if (!RESULT_FILE.exists()) { ++ RESULT_FILE.createNewFile(); ++ } ++ FileInputStream fin = null; ++ try { ++ fin = new FileInputStream(RESULT_FILE); ++ resultProps.load(fin); ++ resultProps.put(oomTest.testMethod, ++ Integer.toString(oomTest.failedTests)); ++ } finally { ++ if (fin != null) { ++ fin.close(); ++ } ++ } ++ System.out.println("DEBUG: Finished running test '" ++ + oomTest.testMethod + "'."); ++ if (LAST_TEST.equals(oomTest.testMethod)) { ++ System.out.println("DEBUG: Determining overall test status."); ++ Set<String> actualTestsRun = new HashSet<String>(); ++ int totalTests = ALL_TESTS.length; ++ int failedTests = 0; ++ for (Object key: resultProps.keySet()) { ++ actualTestsRun.add((String)key); ++ Object propVal = resultProps.get(key); ++ int value = Integer.parseInt((String)propVal); ++ failedTests += value; ++ } ++ if (!ALL_TESTS_SET.equals(actualTestsRun)) { ++ String errorMsg = "Test failed! Expected to run tests '" ++ + ALL_TESTS_SET + "', but only these were run '" ++ + actualTestsRun + "'"; ++ throw new RuntimeException(errorMsg); ++ } ++ if (failedTests >= 3) { ++ String errorMsg = "Test failed. Expected < 3 sub-tests to fail " ++ + "for a pass. Got " + failedTests ++ + " failed tests out of " + totalTests + "."; ++ throw new RuntimeException(errorMsg); ++ } ++ RESULT_FILE.delete(); ++ System.out.println("All " + totalTests + " tests passed."); ++ } else { ++ System.out.println("DEBUG: More tests to run. Continuing."); ++ FileOutputStream fout = null; ++ try { ++ fout = new FileOutputStream(RESULT_FILE); ++ resultProps.store(fout, "Storing results after test " ++ + oomTest.testMethod); ++ } finally { ++ if (fout != null) { ++ fout.close(); ++ } ++ } ++ } ++ } ++ ++ public static void main(String[] args) throws Exception { ++ System.setProperty("test.vm.opts", "-Xmx40m"); // Set debuggee VM option ++ OomDebugTest oomTest = new OomDebugTest(args); ++ try { ++ oomTest.startTests(); ++ } catch (Throwable e) { ++ System.out.println("DEBUG: Got exception for test run. " + e); ++ e.printStackTrace(); ++ oomTest.failure(); ++ } ++ determineOverallTestStatus(oomTest); ++ } ++ ++} +diff --git a/test/com/sun/jdi/oom/OomDebugTestSetup.sh b/test/com/sun/jdi/oom/OomDebugTestSetup.sh +new file mode 100644 +--- /dev/null ++++ openjdk/jdk/test/com/sun/jdi/oom/OomDebugTestSetup.sh +@@ -0,0 +1,46 @@ ++#!/bin/sh ++# ++# Copyright (c) 2016 Red Hat Inc. ++# 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. ++# ++ ++ ++if [ "${TESTSRC}" = "" ] ++then ++ echo "TESTSRC not set. Test cannot execute. Failed." ++ exit 1 ++fi ++echo "TESTSRC=${TESTSRC}" ++ ++if [ "${TESTJAVA}" = "" ] ++then ++ echo "TESTJAVA not set. Test cannot execute. Failed." ++ exit 1 ++fi ++echo "TESTJAVA=${TESTJAVA}" ++ ++if [ "${TESTCLASSES}" = "" ] ++then ++ echo "TESTCLASSES not set. Test cannot execute. Failed." ++ exit 1 ++fi ++ ++cp ${TESTSRC}/@debuggeeVMOptions ${TESTCLASSES}/ diff --git a/8155049-pr3352.patch b/8155049-pr3352.patch new file mode 100644 index 0000000..68cf02f --- /dev/null +++ b/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/8162384-pr3122-rh1358661.patch b/8162384-pr3122-rh1358661.patch new file mode 100644 index 0000000..ff38413 --- /dev/null +++ b/8162384-pr3122-rh1358661.patch @@ -0,0 +1,54 @@ +# HG changeset patch +# User roland +# Date 1469615613 -7200 +# Wed Jul 27 12:33:33 2016 +0200 +# Node ID fd29eff8b797daa41a68394ced7fe80c9e8c96e9 +# Parent ee9bffb3bd390b2ad805c7b59d7d2ab8a68a4367 +8162384, PR3122: Performance regression: bimorphic inlining may be bypassed by type speculation +Summary: when speculation fails at a call fallback to profile data at the call site +Reviewed-by: kvn + +diff -r ee9bffb3bd39 -r fd29eff8b797 src/share/vm/opto/doCall.cpp +--- openjdk/hotspot/src/share/vm/opto/doCall.cpp Mon Aug 01 16:33:54 2016 +0100 ++++ openjdk/hotspot/src/share/vm/opto/doCall.cpp Wed Jul 27 12:33:33 2016 +0200 +@@ -205,16 +205,22 @@ + + int morphism = profile.morphism(); + if (speculative_receiver_type != NULL) { +- // We have a speculative type, we should be able to resolve +- // the call. We do that before looking at the profiling at +- // this invoke because it may lead to bimorphic inlining which +- // a speculative type should help us avoid. +- receiver_method = callee->resolve_invoke(jvms->method()->holder(), +- speculative_receiver_type); +- if (receiver_method == NULL) { ++ if (!too_many_traps(caller, bci, Deoptimization::Reason_speculate_class_check)) { ++ // We have a speculative type, we should be able to resolve ++ // the call. We do that before looking at the profiling at ++ // this invoke because it may lead to bimorphic inlining which ++ // a speculative type should help us avoid. ++ receiver_method = callee->resolve_invoke(jvms->method()->holder(), ++ speculative_receiver_type); ++ if (receiver_method == NULL) { ++ speculative_receiver_type = NULL; ++ } else { ++ morphism = 1; ++ } ++ } else { ++ // speculation failed before. Use profiling at the call ++ // (could allow bimorphic inlining for instance). + speculative_receiver_type = NULL; +- } else { +- morphism = 1; + } + } + if (receiver_method == NULL && +@@ -252,7 +258,7 @@ + Deoptimization::Reason_bimorphic : + (speculative_receiver_type == NULL ? Deoptimization::Reason_class_check : Deoptimization::Reason_speculate_class_check); + if ((morphism == 1 || (morphism == 2 && next_hit_cg != NULL)) && +- !too_many_traps(jvms->method(), jvms->bci(), reason) ++ !too_many_traps(caller, bci, reason) + ) { + // Generate uncommon trap for class check failure path + // in case of monomorphic or bimorphic virtual call site. diff --git a/8165231-rh1437545.patch b/8165231-rh1437545.patch new file mode 100644 index 0000000..e0d5be7 --- /dev/null +++ b/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/8173941-pr3326.patch b/8173941-pr3326.patch new file mode 100644 index 0000000..50e74f6 --- /dev/null +++ b/8173941-pr3326.patch @@ -0,0 +1,77 @@ +# HG changeset patch +# User ysuenaga +# Date 1487123491 18000 +# Tue Feb 14 20:51:31 2017 -0500 +# Node ID 15922b2f31db4857ec84efdf533c41b19e68030b +# Parent 652fe741b8f2bfdacba66d772cc89fe7ec6dea66 +8173941, PR3326: SA does not work if executable is DSO +Reviewed-by: aph, dsamersoff + +diff --git a/agent/src/os/linux/elfmacros.h b/agent/src/os/linux/elfmacros.h +--- openjdk/hotspot/agent/src/os/linux/elfmacros.h ++++ openjdk/hotspot/agent/src/os/linux/elfmacros.h +@@ -33,6 +33,7 @@ + #define ELF_NHDR Elf64_Nhdr + #define ELF_DYN Elf64_Dyn + #define ELF_ADDR Elf64_Addr ++#define ELF_AUXV Elf64_auxv_t + + #define ELF_ST_TYPE ELF64_ST_TYPE + +@@ -45,6 +46,7 @@ + #define ELF_NHDR Elf32_Nhdr + #define ELF_DYN Elf32_Dyn + #define ELF_ADDR Elf32_Addr ++#define ELF_AUXV Elf32_auxv_t + + #define ELF_ST_TYPE ELF32_ST_TYPE + +diff --git a/agent/src/os/linux/ps_core.c b/agent/src/os/linux/ps_core.c +--- openjdk/hotspot/agent/src/os/linux/ps_core.c ++++ openjdk/hotspot/agent/src/os/linux/ps_core.c +@@ -642,6 +642,18 @@ + if (core_handle_prstatus(ph, descdata, notep->n_descsz) != true) { + return false; + } ++ } else if (notep->n_type == NT_AUXV) { ++ // Get first segment from entry point ++ ELF_AUXV *auxv = (ELF_AUXV *)descdata; ++ while (auxv->a_type != AT_NULL) { ++ if (auxv->a_type == AT_ENTRY) { ++ // Set entry point address to address of dynamic section. ++ // We will adjust it in read_exec_segments(). ++ ph->core->dynamic_addr = auxv->a_un.a_val; ++ break; ++ } ++ auxv++; ++ } + } + p = descdata + ROUNDUP(notep->n_descsz, 4); + } +@@ -826,7 +838,13 @@ + + // from PT_DYNAMIC we want to read address of first link_map addr + case PT_DYNAMIC: { +- ph->core->dynamic_addr = exec_php->p_vaddr; ++ if (exec_ehdr->e_type == ET_EXEC) { ++ ph->core->dynamic_addr = exec_php->p_vaddr; ++ } else { // ET_DYN ++ // dynamic_addr has entry point of executable. ++ // Thus we should substract it. ++ ph->core->dynamic_addr += exec_php->p_vaddr - exec_ehdr->e_entry; ++ } + print_debug("address of _DYNAMIC is 0x%lx\n", ph->core->dynamic_addr); + break; + } +@@ -1024,8 +1042,9 @@ + goto err; + } + +- if (read_elf_header(ph->core->exec_fd, &exec_ehdr) != true || exec_ehdr.e_type != ET_EXEC) { +- print_debug("executable file is not a valid ELF ET_EXEC file\n"); ++ if (read_elf_header(ph->core->exec_fd, &exec_ehdr) != true || ++ ((exec_ehdr.e_type != ET_EXEC) && (exec_ehdr.e_type != ET_DYN))) { ++ print_debug("executable file is not a valid ELF file\n"); + goto err; + } + diff --git a/8174164-pr3334-rh1417266.patch b/8174164-pr3334-rh1417266.patch new file mode 100644 index 0000000..494883f --- /dev/null +++ b/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/8174729-pr3336-rh1420518.patch b/8174729-pr3336-rh1420518.patch new file mode 100644 index 0000000..3d67850 --- /dev/null +++ b/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<V> 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/8175097-pr3334-rh1417266.patch b/8175097-pr3334-rh1417266.patch new file mode 100644 index 0000000..e80dd11 --- /dev/null +++ b/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/java-1.8.0-openjdk-aarch32.spec b/java-1.8.0-openjdk-aarch32.spec index f93c0a3..0dc47f5 100644 --- a/java-1.8.0-openjdk-aarch32.spec +++ b/java-1.8.0-openjdk-aarch32.spec @@ -35,6 +35,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 @@ -50,7 +57,7 @@ %ifarch %{jit_arches} %global bootstrap_build 1 %else -%global bootstrap_build 0 +%global bootstrap_build 1 %endif %if %{bootstrap_build} @@ -108,55 +115,70 @@ %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 +%ifarch %{jit_arches} +%global with_systemtap 0 +%else %global with_systemtap 0 -#%endif +%endif # Convert an absolute path to a relative path. Each symbolic link is # specified relative to the directory in which it is installed so that @@ -170,7 +192,7 @@ # note, following three variables are sedded from update_sources if used correctly. Hardcode them rather there. %global project aarch32-port %global repo jdk8u -%global revision jdk8u121-b13-aarch32-170210 +%global revision jdk8u131-b12-aarch32-170420 # 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 @@ -214,18 +236,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 || : @@ -235,38 +251,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}" = '059d61cfbb47e337b011ecda9350db9b' -o \\ - "${sum}" = '0dd41ddb4d1fb25975f7faab2c23e151' -o \\ - "${sum}" = '59dafb237e5def3ccf8a3ad589fb2777' -o \\ - "${sum}" = '84d16306cd4c2ae76ba81a3775e92cee' -o \\ - "${sum}" = '5ab4c77cf14fbd7f7ee6f51a7a73d88c' -o \\ - "${sum}" = 'b727442b4ac0e3b8a26ec9741ad463e5' -o \\ - "${sum}" = 'a59c6d96aeae1303fb8ba85e97588e9d' ]; 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 @@ -334,6 +318,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 } @@ -546,7 +539,6 @@ exit 0 %{_jvmprivdir}/* %{jvmjardir %%1} %dir %{_jvmdir}/%{jredir %%1}/lib/security -%{_jvmdir}/%{jredir %%1}/lib/security/cacerts %config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/US_export_policy.jar %config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/local_policy.jar %config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/java.policy @@ -663,8 +655,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. @@ -696,7 +688,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 @@ -735,8 +727,8 @@ Obsoletes: java-1.7.0-openjdk-headless%1 %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 @@ -761,14 +753,14 @@ Obsoletes: java-1.5.0-gcj-devel%1 %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} 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 @@ -787,15 +779,15 @@ 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} 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} Obsoletes: java-1.7.0-openjdk-accessibility%1 } @@ -805,7 +797,7 @@ Obsoletes: java-1.7.0-openjdk-accessibility%1 Name: java-%{javaver}-%{origin}-aarch32 Version: %{javaver}.%{updatever} -Release: 3.%{buildver}%{?dist} +Release: 1.%{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 @@ -834,14 +826,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: java-1.8.0-openjdk-remove-intree-libraries.sh @@ -895,7 +887,25 @@ 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 +#Patch100: %{name}-s390-java-opts.patch +# Type fixing for s390 +#Patch102: %{name}-size_t.patch +# Use "%z" for size_t on s390 as size_t != intptr_t +#Patch103: s390-size_t_format_flags.patch + +# Patches which need backporting to 8u +# S8073139, RH1191652; fix name of ppc64le architecture +#Patch601: %{name}-rh1191652-root.patch +#Patch602: %{name}-rh1191652-jdk.patch +#Patch603: %{name}-rh1191652-hotspot-aarch64.patch # Include all sources in src.zip Patch7: include-all-srcs.patch # 8035341: Allow using a system installed libpng @@ -912,14 +922,37 @@ Patch507: pr2842-02.patch Patch400: 8154313.patch # S6260348, PR3066: GTK+ L&F JTextComponent not respecting desktop caret blink rate Patch526: 6260348-pr3066.patch +# 8061305, PR3335, RH1423421: Javadoc crashes when method name ends with "Property" +Patch538: 8061305-pr3335-rh1423421.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 +# 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 Patch201: system-libjpeg.patch -# Pathces 204-206 are serving for better check of debug symbols in native liraries -Patch204: hotspot-remove-debuglink.patch -Patch205: dont-add-unnecessary-debug-links.patch -Patch206: hotspot-assembler-debuginfo.patch +# custom securities Patch207: PR3183.patch # Local fixes @@ -927,12 +960,13 @@ Patch207: PR3183.patch Patch525: pr1834-rh1022017.patch # RH1367357: lcms2: Out-of-bounds read in Type_MLU_Read() 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 -# AArch32 upstream changes - - BuildRequires: autoconf BuildRequires: automake BuildRequires: alsa-lib-devel @@ -971,8 +1005,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 @@ -1197,6 +1229,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 %{SOURCE999} +rm -rf hotspot +mv openjdk/hotspot . +rm -rf openjdk +popd +%endif cp %{SOURCE2} . @@ -1212,9 +1254,12 @@ cp %{SOURCE101} openjdk/common/autoconf/build-aux/ # Remove libraries that are linked sh %{SOURCE12} +# System library fixes %patch201 %patch202 %patch203 + +# Debugging fixes %patch204 %patch205 %patch206 @@ -1225,6 +1270,20 @@ sh %{SOURCE12} %patch5 %patch7 +# s390 build fixes +#%patch100 +#%patch102 +#%patch103 + +# ppc64le fixes + +#%patch603 +#%patch601 +#%patch602 + +# Zero fixes. + +# Upstreamable fixes %patch502 %patch504 %patch506 @@ -1241,12 +1300,29 @@ sh %{SOURCE12} %patch518 %patch400 %patch523 -%patch525 +%patch526 %patch528 +%patch532 +%patch535 +%patch537 +%patch538 +#%patch542 +%patch544 +%patch545 +%patch546 +%patch547 +%patch548 +%patch549 + +# RPM-only fixes +%patch525 %patch533 +%patch539 -# AArch32 upstream patches - +# RHEL-only patches +%if 0%{?rhel} +%patch534 +%endif # Extract systemtap tapsets %if %{with_systemtap} @@ -1287,8 +1363,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 @@ -1391,7 +1467,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 @@ -1407,9 +1483,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 @@ -1429,7 +1502,7 @@ do # 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" | egrep "\]\ .debug_(info|abbrev)" | wc --lines) == 2 + 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 @@ -1440,14 +1513,14 @@ do do # We expect to see .cpp files, except for architectures like aarch64 and # s390 where we expect .o and .oS files - echo "$line" | egrep "ABS ((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx|o|oS))?$" + 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" | \ - egrep "00000000 0 FILE LOCAL DEFAULT ABS javaCalls.(cpp|o)$" + grep -E "00000000 0 FILE LOCAL DEFAULT ABS javaCalls.(cpp|o)$" fi # Test that there are no .gnu_debuglink sections pointing to another @@ -1491,7 +1564,6 @@ $JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LocalVariableTable done %install -rm -rf $RPM_BUILD_ROOT STRIP_KEEP_SYMTAB=libjvm* for suffix in %{build_loop} ; do @@ -1570,13 +1642,8 @@ popd popd %endif - # Install cacerts symlink. + # Remove empty cacerts database. rm -f $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}/lib/security/cacerts - pushd $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}/lib/security - RELATIVE=$(%{abs2rel} %{_sysconfdir}/pki/java \ - %{_jvmdir}/%{jredir $suffix}/lib/security) - ln -sf $RELATIVE/cacerts . - popd # Install extension symlinks. install -d -m 755 $RPM_BUILD_ROOT%{jvmjardir $suffix} @@ -1788,7 +1855,7 @@ else end end -- run contetn of included file with fake args -arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}"} +arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}", "--temp", "%{rpm_state_dir}/%{name}.%{_arch}"} require "copy_jdk_configs.lua" %post @@ -1928,6 +1995,14 @@ require "copy_jdk_configs.lua" %endif %changelog +* Sat Apr 29 2017 Alex Kashchenko <akashche(a)redhat.com> - 1:1.8.0.131-1.170420 +- update sources to 8u131 +- sync with mainline package + +* Wed Apr 12 2017 Alex Kashchenko <akashche(a)redhat.com> - 1:1.8.0.121-4.170210 +- sync with mainline package +- add 8175234-aarch32 upstream patch + * Tue Feb 28 2017 Alex Kashchenko <akashche(a)redhat.com> - 1:1.8.0.121-3.170210 - rebuild because of NSS diff --git a/nss.cfg b/nss.cfg deleted file mode 100644 index 377a39c..0000000 --- a/nss.cfg +++ /dev/null @@ -1,5 +0,0 @@ -name = NSS -nssLibraryDirectory = @NSS_LIBDIR@ -nssDbMode = noDb -attributes = compatibility -handleStartupErrors = ignoreMultipleInitialisation diff --git a/nss.cfg.in b/nss.cfg.in new file mode 100644 index 0000000..377a39c --- /dev/null +++ b/nss.cfg.in @@ -0,0 +1,5 @@ +name = NSS +nssLibraryDirectory = @NSS_LIBDIR@ +nssDbMode = noDb +attributes = compatibility +handleStartupErrors = ignoreMultipleInitialisation diff --git a/pr1834-rh1022017.patch b/pr1834-rh1022017.patch index 3585029..4983884 100644 --- a/pr1834-rh1022017.patch +++ b/pr1834-rh1022017.patch @@ -1,8 +1,8 @@ diff --git a/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java b/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java --- openjdk/jdk/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java +++ openjdk/jdk/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java -@@ -160,20 +160,10 @@ - } +@@ -168,20 +168,10 @@ + "contains no supported elliptic curves"); } } else { // default curves - int[] ids; diff --git a/pr2888.patch b/pr2888.patch new file mode 100644 index 0000000..fc8f981 --- /dev/null +++ b/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 b/sources index fa92507..92a8fc8 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (systemtap-tapset-3.1.0.tar.xz) = e3558dc9d56dff5125a869807135e84ca73a2640d8d8fff2f45dc0dd7d153b81b48c08480e09a75667eba62362f74091465fac622aa0d9b104bfb18b4eba80e1 -SHA512 (aarch32-port-jdk8u-jdk8u121-b13-aarch32-170210.tar.xz) = 2ea4732cd9c90aedbe27cf6cc35df5777c75d668e15daca7911004d93f5b68fc4231df1eabd8739f1afb1afd9ea8574c8bfbe11322cde7664aba0cd8091e584b +SHA512 (systemtap-tapset-3.4.0pre01.tar.xz) = 4446fa20f88bbce53b583484bf06cb2b476c9372beb898dc2b7739eaa5c98b9979fbd72e12474fb344833d831a19366b82216ee03b452411745e6cd3527faa4e +SHA512 (aarch32-port-jdk8u-jdk8u131-b12-aarch32-170420.tar.xz) = 8cfca4b5f9d58fc22ea9011182dbb58f5614e23281d781c335ed9ae069e0e6587fb82f3b733e3f38e258e802342e679a6177ea59ec45f7bb9253c2b88bfe73e7 -- cgit v1.1
https://src.fedoraproject.org/cgit/java-1.8.0-openjdk-aarch32.git/commit/?h…
1
0
0
0
akasko pushed to java-1.8.0-openjdk-aarch32 (f25). "8u131 update"
by notificationsï¼ fedoraproject.org
30 Apr '17
30 Apr '17
From f7e4c1a5736d2776cdd4a8f3f93ca340c2de868a Mon Sep 17 00:00:00 2001 From: Alex Kashchenko <akashche(a)redhat.com> Date: Sun, 30 Apr 2017 18:18:49 +0000 Subject: 8u131 update --- .gitignore | 2 + 8061305-pr3335-rh1423421.patch | 33 ++ 8144566-pr3352.patch | 911 ++++++++++++++++++++++++++++++++++++++++ 8153711-pr3313-rh1284948.patch | 669 +++++++++++++++++++++++++++++ 8155049-pr3352.patch | 41 ++ 8162384-pr3122-rh1358661.patch | 54 +++ 8165231-rh1437545.patch | 48 +++ 8173941-pr3326.patch | 77 ++++ 8174164-pr3334-rh1417266.patch | 79 ++++ 8174729-pr3336-rh1420518.patch | 122 ++++++ 8175097-pr3334-rh1417266.patch | 100 +++++ java-1.8.0-openjdk-aarch32.spec | 257 ++++++++---- nss.cfg | 5 - nss.cfg.in | 5 + pr1834-rh1022017.patch | 4 +- pr2888.patch | 60 +++ sources | 4 +- 17 files changed, 2371 insertions(+), 100 deletions(-) create mode 100644 8061305-pr3335-rh1423421.patch create mode 100644 8144566-pr3352.patch create mode 100644 8153711-pr3313-rh1284948.patch create mode 100644 8155049-pr3352.patch create mode 100644 8162384-pr3122-rh1358661.patch create mode 100644 8165231-rh1437545.patch create mode 100644 8173941-pr3326.patch create mode 100644 8174164-pr3334-rh1417266.patch create mode 100644 8174729-pr3336-rh1420518.patch create mode 100644 8175097-pr3334-rh1417266.patch delete mode 100644 nss.cfg create mode 100644 nss.cfg.in create mode 100644 pr2888.patch diff --git a/.gitignore b/.gitignore index 6c608c3..70f7217 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ /systemtap-tapset-3.1.0.tar.xz /aarch32-port-jdk8u-jdk8u112-b16-aarch32-161109.tar.xz /aarch32-port-jdk8u-jdk8u121-b13-aarch32-170210.tar.xz +/aarch32-port-jdk8u-jdk8u131-b12-aarch32-170420.tar.xz +/systemtap-tapset-3.4.0pre01.tar.xz diff --git a/8061305-pr3335-rh1423421.patch b/8061305-pr3335-rh1423421.patch new file mode 100644 index 0000000..384c52a --- /dev/null +++ b/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/8144566-pr3352.patch b/8144566-pr3352.patch new file mode 100644 index 0000000..9a2a294 --- /dev/null +++ b/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.<SNIServerName>emptyList(); + Collection<SNIMatcher> sniMatchers = + Collections.<SNIMatcher>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<SNIServerName> sniNames = params.getServerNames(); + if (sniNames != null) { ++ noSniExtension = sniNames.isEmpty(); + serverNames = sniNames; + } + + Collection<SNIMatcher> 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/8153711-pr3313-rh1284948.patch b/8153711-pr3313-rh1284948.patch new file mode 100644 index 0000000..b93fa06 --- /dev/null +++ b/8153711-pr3313-rh1284948.patch @@ -0,0 +1,669 @@ +# HG changeset patch +# User sgehwolf +# Date 1458555849 -3600 +# Mon Mar 21 11:24:09 2016 +0100 +# Node ID 9f6a0864a734ae3fd0eb198768db7cdee53ba0ed +# Parent 1179be40f1e3b59a890e96a5a9d3ff6fc18a2846 +8153711, PR3313: [REDO] JDWP: Memory Leak: GlobalRefs never deleted when processing invokeMethod command +Summary: Delete global references in invoker_completeInvokeRequest() +Reviewed-by: sspitsyn, dsamersoff + +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 +@@ -211,6 +211,62 @@ + return error; + } + ++/* ++ * 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(). ++ */ ++static void ++deleteGlobalArgumentRefs(JNIEnv *env, InvokeRequest *request) ++{ ++ void *cursor; ++ jint argIndex = 0; ++ jvalue *argument = request->arguments; ++ jbyte argumentTag = firstArgumentTypeTag(request->methodSignature, &cursor); ++ ++ if (request->clazz != NULL) { ++ tossGlobalRef(env, &(request->clazz)); ++ } ++ if (request->instance != NULL) { ++ tossGlobalRef(env, &(request->instance)); ++ } ++ /* Delete global argument references */ ++ while (argIndex < request->argumentCount) { ++ if ((argumentTag == JDWP_TAG(OBJECT)) || ++ (argumentTag == JDWP_TAG(ARRAY))) { ++ if (argument->l != NULL) { ++ tossGlobalRef(env, &(argument->l)); ++ } ++ } ++ argument++; ++ argIndex++; ++ argumentTag = nextArgumentTypeTag(&cursor); ++ } ++} ++ + static jvmtiError + fillInvokeRequest(JNIEnv *env, InvokeRequest *request, + jbyte invokeType, jbyte options, jint id, +@@ -320,6 +376,8 @@ + invokeConstructor(JNIEnv *env, InvokeRequest *request) + { + jobject object; ++ ++ JDI_ASSERT_MSG(request->clazz, "Request clazz null"); + object = JNI_FUNC_PTR(env,NewObjectA)(env, request->clazz, + request->method, + request->arguments); +@@ -336,6 +394,7 @@ + case JDWP_TAG(OBJECT): + case JDWP_TAG(ARRAY): { + jobject object; ++ JDI_ASSERT_MSG(request->clazz, "Request clazz null"); + object = JNI_FUNC_PTR(env,CallStaticObjectMethodA)(env, + request->clazz, + request->method, +@@ -424,6 +483,7 @@ + case JDWP_TAG(OBJECT): + case JDWP_TAG(ARRAY): { + jobject object; ++ JDI_ASSERT_MSG(request->instance, "Request instance null"); + object = JNI_FUNC_PTR(env,CallObjectMethodA)(env, + request->instance, + request->method, +@@ -511,6 +571,8 @@ + case JDWP_TAG(OBJECT): + case JDWP_TAG(ARRAY): { + jobject object; ++ JDI_ASSERT_MSG(request->clazz, "Request clazz null"); ++ JDI_ASSERT_MSG(request->instance, "Request instance null"); + object = JNI_FUNC_PTR(env,CallNonvirtualObjectMethodA)(env, + request->instance, + request->clazz, +@@ -607,6 +669,8 @@ + JNIEnv *env; + jboolean startNow; + InvokeRequest *request; ++ jbyte options; ++ jbyte invokeType; + + JDI_ASSERT(thread); + +@@ -623,6 +687,9 @@ + if (startNow) { + request->started = JNI_TRUE; + } ++ options = request->options; ++ invokeType = request->invokeType; ++ + debugMonitorExit(invokerLock); + + if (!startNow) { +@@ -637,7 +704,7 @@ + + JNI_FUNC_PTR(env,ExceptionClear)(env); + +- switch (request->invokeType) { ++ switch (invokeType) { + case INVOKE_CONSTRUCTOR: + invokeConstructor(env, request); + break; +@@ -645,7 +712,7 @@ + invokeStatic(env, request); + break; + case INVOKE_INSTANCE: +- if (request->options & JDWP_INVOKE_OPTIONS(NONVIRTUAL) ) { ++ if (options & JDWP_INVOKE_OPTIONS(NONVIRTUAL) ) { + invokeNonvirtual(env, request); + } else { + invokeVirtual(env, request); +@@ -723,12 +790,23 @@ + } + + /* ++ * At this time, there's no need to retain global references on ++ * arguments since the reply is processed. No one will deal with ++ * this request ID anymore, so we must call deleteGlobalArgumentRefs(). ++ * ++ * We cannot delete saved exception or return value references ++ * since otherwise a deleted handle would escape when writing ++ * the response to the stream. Instead, we clean those refs up ++ * after writing the respone. ++ */ ++ deleteGlobalArgumentRefs(env, request); ++ ++ /* + * Give up the lock before I/O operation + */ + debugMonitorExit(invokerLock); + eventHandler_unlock(); + +- + if (!detached) { + outStream_initReply(&out, id); + (void)outStream_writeValue(env, &out, tag, returnValue); +@@ -736,6 +814,16 @@ + (void)outStream_writeObjectRef(env, &out, exc); + outStream_sendReply(&out); + } ++ ++ /* ++ * Delete potentially saved global references of return value ++ * and exception ++ */ ++ eventHandler_lock(); // for proper lock order ++ debugMonitorEnter(invokerLock); ++ deletePotentiallySavedGlobalRefs(env, request); ++ debugMonitorExit(invokerLock); ++ eventHandler_unlock(); + } + + jboolean +diff --git a/test/com/sun/jdi/oom/@debuggeeVMOptions b/test/com/sun/jdi/oom/@debuggeeVMOptions +new file mode 100644 +--- /dev/null ++++ openjdk/jdk/test/com/sun/jdi/oom/@debuggeeVMOptions +@@ -0,0 +1,1 @@ ++-Xmx40m +\ No newline at end of file +diff --git a/test/com/sun/jdi/oom/OomDebugTest.java b/test/com/sun/jdi/oom/OomDebugTest.java +new file mode 100644 +--- /dev/null ++++ openjdk/jdk/test/com/sun/jdi/oom/OomDebugTest.java +@@ -0,0 +1,417 @@ ++/* ++ * Copyright (c) 2016 Red Hat Inc. ++ * ++ * 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 8153711 ++ * @summary JDWP: Memory Leak (global references not deleted after invokeMethod). ++ * ++ * @author Severin Gehwolf <sgehwolf(a)redhat.com> ++ * ++ * @library .. ++ * @run build TestScaffold VMConnection TargetListener TargetAdapter ++ * @run compile -g OomDebugTest.java ++ * @run shell OomDebugTestSetup.sh ++ * @run main OomDebugTest OomDebugTestTarget test1 ++ * @run main OomDebugTest OomDebugTestTarget test2 ++ * @run main OomDebugTest OomDebugTestTarget test3 ++ * @run main OomDebugTest OomDebugTestTarget test4 ++ * @run main OomDebugTest OomDebugTestTarget test5 ++ */ ++import java.io.File; ++import java.io.FileInputStream; ++import java.io.FileNotFoundException; ++import java.io.FileOutputStream; ++import java.io.IOException; ++import java.util.ArrayList; ++import java.util.Arrays; ++import java.util.Collections; ++import java.util.HashSet; ++import java.util.List; ++import java.util.Properties; ++import java.util.Set; ++ ++import com.sun.jdi.ArrayReference; ++import com.sun.jdi.ArrayType; ++import com.sun.jdi.ClassType; ++import com.sun.jdi.Field; ++import com.sun.jdi.InvocationException; ++import com.sun.jdi.Method; ++import com.sun.jdi.ObjectReference; ++import com.sun.jdi.ReferenceType; ++import com.sun.jdi.StackFrame; ++import com.sun.jdi.VMOutOfMemoryException; ++import com.sun.jdi.Value; ++import com.sun.jdi.event.BreakpointEvent; ++import com.sun.jdi.event.ExceptionEvent; ++ ++/***************** Target program **********************/ ++ ++class OomDebugTestTarget { ++ ++ OomDebugTestTarget() { ++ System.out.println("DEBUG: invoked constructor"); ++ } ++ static class FooCls { ++ @SuppressWarnings("unused") ++ private byte[] bytes = new byte[3000000]; ++ }; ++ ++ FooCls fooCls = new FooCls(); ++ byte[] byteArray = new byte[0]; ++ ++ void testMethod(FooCls foo) { ++ System.out.println("DEBUG: invoked 'void testMethod(FooCls)', foo == " + foo); ++ } ++ ++ void testPrimitive(byte[] foo) { ++ System.out.println("DEBUG: invoked 'void testPrimitive(byte[])', foo == " + foo); ++ } ++ ++ byte[] testPrimitiveArrRetval() { ++ System.out.println("DEBUG: invoked 'byte[] testPrimitiveArrRetval()'"); ++ return new byte[3000000]; ++ } ++ ++ FooCls testFooClsRetval() { ++ System.out.println("DEBUG: invoked 'FooCls testFooClsRetval()'"); ++ return new FooCls(); ++ } ++ ++ public void entry() {} ++ ++ public static void main(String[] args){ ++ System.out.println("DEBUG: OomDebugTestTarget.main"); ++ new OomDebugTestTarget().entry(); ++ } ++} ++ ++/***************** Test program ************************/ ++ ++public class OomDebugTest extends TestScaffold { ++ ++ private static final String[] ALL_TESTS = new String[] { ++ "test1", "test2", "test3", "test4", "test5" ++ }; ++ private static final Set<String> ALL_TESTS_SET = new HashSet<String>(); ++ static { ++ ALL_TESTS_SET.addAll(Arrays.asList(ALL_TESTS)); ++ } ++ private static final String TEST_CLASSES = System.getProperty("test.classes", "."); ++ private static final File RESULT_FILE = new File(TEST_CLASSES, "results.properties"); ++ private static final String LAST_TEST = ALL_TESTS[ALL_TESTS.length - 1]; ++ private ReferenceType targetClass; ++ private ObjectReference thisObject; ++ private int failedTests; ++ private final String testMethod; ++ ++ public OomDebugTest(String[] args) { ++ super(args); ++ if (args.length != 2) { ++ throw new RuntimeException("Wrong number of command-line arguments specified."); ++ } ++ this.testMethod = args[1]; ++ } ++ ++ @Override ++ protected void runTests() throws Exception { ++ try { ++ addListener(new TargetAdapter() { ++ ++ @Override ++ public void exceptionThrown(ExceptionEvent event) { ++ String name = event.exception().referenceType().name(); ++ System.err.println("DEBUG: Exception thrown in debuggee was: " + name); ++ } ++ }); ++ /* ++ * Get to the top of entry() ++ * to determine targetClass and mainThread ++ */ ++ BreakpointEvent bpe = startTo("OomDebugTestTarget", "entry", "()V"); ++ targetClass = bpe.location().declaringType(); ++ ++ mainThread = bpe.thread(); ++ ++ StackFrame frame = mainThread.frame(0); ++ thisObject = frame.thisObject(); ++ java.lang.reflect.Method m = findTestMethod(); ++ m.invoke(this); ++ } catch (NoSuchMethodException e) { ++ e.printStackTrace(); ++ failure(); ++ } catch (SecurityException e) { ++ e.printStackTrace(); ++ failure(); ++ } ++ /* ++ * resume the target, listening for events ++ */ ++ listenUntilVMDisconnect(); ++ } ++ ++ private java.lang.reflect.Method findTestMethod() ++ throws NoSuchMethodException, SecurityException { ++ return OomDebugTest.class.getDeclaredMethod(testMethod); ++ } ++ ++ private void failure() { ++ failedTests++; ++ } ++ ++ /* ++ * Test case: Object reference as method parameter. ++ */ ++ @SuppressWarnings("unused") // called via reflection ++ private void test1() throws Exception { ++ System.out.println("DEBUG: ------------> Running test1"); ++ try { ++ Field field = targetClass.fieldByName("fooCls"); ++ ClassType clsType = (ClassType)field.type(); ++ Method constructor = getConstructorForClass(clsType); ++ for (int i = 0; i < 15; i++) { ++ @SuppressWarnings({ "rawtypes", "unchecked" }) ++ ObjectReference objRef = clsType.newInstance(mainThread, ++ constructor, ++ new ArrayList(0), ++ ObjectReference.INVOKE_NONVIRTUAL); ++ if (objRef.isCollected()) { ++ System.out.println("DEBUG: Object got GC'ed before we can use it. NO-OP."); ++ continue; ++ } ++ invoke("testMethod", "(LOomDebugTestTarget$FooCls;)V", objRef); ++ } ++ } catch (InvocationException e) { ++ handleFailure(e); ++ } ++ } ++ ++ /* ++ * Test case: Array reference as method parameter. ++ */ ++ @SuppressWarnings("unused") // called via reflection ++ private void test2() throws Exception { ++ System.out.println("DEBUG: ------------> Running test2"); ++ try { ++ Field field = targetClass.fieldByName("byteArray"); ++ ArrayType arrType = (ArrayType)field.type(); ++ ++ for (int i = 0; i < 15; i++) { ++ ArrayReference byteArrayVal = arrType.newInstance(3000000); ++ if (byteArrayVal.isCollected()) { ++ System.out.println("DEBUG: Object got GC'ed before we can use it. NO-OP."); ++ continue; ++ } ++ invoke("testPrimitive", "([B)V", byteArrayVal); ++ } ++ } catch (VMOutOfMemoryException e) { ++ defaultHandleOOMFailure(e); ++ } ++ } ++ ++ /* ++ * Test case: Array reference as return value. ++ */ ++ @SuppressWarnings("unused") // called via reflection ++ private void test3() throws Exception { ++ System.out.println("DEBUG: ------------> Running test3"); ++ try { ++ for (int i = 0; i < 15; i++) { ++ invoke("testPrimitiveArrRetval", ++ "()[B", ++ Collections.EMPTY_LIST, ++ vm().mirrorOfVoid()); ++ } ++ } catch (InvocationException e) { ++ handleFailure(e); ++ } ++ } ++ ++ /* ++ * Test case: Object reference as return value. ++ */ ++ @SuppressWarnings("unused") // called via reflection ++ private void test4() throws Exception { ++ System.out.println("DEBUG: ------------> Running test4"); ++ try { ++ for (int i = 0; i < 15; i++) { ++ invoke("testFooClsRetval", ++ "()LOomDebugTestTarget$FooCls;", ++ Collections.EMPTY_LIST, ++ vm().mirrorOfVoid()); ++ } ++ } catch (InvocationException e) { ++ handleFailure(e); ++ } ++ } ++ ++ /* ++ * Test case: Constructor ++ */ ++ @SuppressWarnings({ "unused", "unchecked", "rawtypes" }) // called via reflection ++ private void test5() throws Exception { ++ System.out.println("DEBUG: ------------> Running test5"); ++ try { ++ ClassType type = (ClassType)thisObject.type(); ++ for (int i = 0; i < 15; i++) { ++ type.newInstance(mainThread, ++ findMethod(targetClass, "<init>", "()V"), ++ new ArrayList(0), ++ ObjectReference.INVOKE_NONVIRTUAL); ++ } ++ } catch (InvocationException e) { ++ handleFailure(e); ++ } ++ } ++ ++ private Method getConstructorForClass(ClassType clsType) { ++ List<Method> methods = clsType.methodsByName("<init>"); ++ if (methods.size() != 1) { ++ throw new RuntimeException("FAIL. Expected only one, the default, constructor"); ++ } ++ return methods.get(0); ++ } ++ ++ private void handleFailure(InvocationException e) { ++ // There is no good way to see the OOME diagnostic message in the target since the ++ // TestScaffold might throw an exception while trying to print the stack trace. I.e ++ // it might get a a VMDisconnectedException before the stack trace printing finishes. ++ System.err.println("FAILURE: InvocationException thrown. Trying to determine cause..."); ++ defaultHandleOOMFailure(e); ++ } ++ ++ private void defaultHandleOOMFailure(Exception e) { ++ e.printStackTrace(); ++ failure(); ++ } ++ ++ @SuppressWarnings({ "rawtypes", "unchecked" }) ++ void invoke(String methodName, String methodSig, Value value) ++ throws Exception { ++ List args = new ArrayList(1); ++ args.add(value); ++ invoke(methodName, methodSig, args, value); ++ } ++ ++ void invoke(String methodName, ++ String methodSig, ++ @SuppressWarnings("rawtypes") List args, ++ Value value) throws Exception { ++ Method method = findMethod(targetClass, methodName, methodSig); ++ if ( method == null) { ++ failure("FAILED: Can't find method: " ++ + methodName + " for class = " + targetClass); ++ return; ++ } ++ invoke(method, args, value); ++ } ++ ++ @SuppressWarnings({ "rawtypes", "unchecked" }) ++ void invoke(Method method, List args, Value value) throws Exception { ++ thisObject.invokeMethod(mainThread, method, args, 0); ++ System.out.println("DEBUG: Done invoking method via debugger."); ++ } ++ ++ Value fieldValue(String fieldName) { ++ Field field = targetClass.fieldByName(fieldName); ++ return thisObject.getValue(field); ++ } ++ ++ // Determine the pass/fail status on some heuristic and don't fail the ++ // test if < 3 of the total number of tests (currently 5) fail. This also ++ // has the nice side effect that all tests are first attempted and only ++ // all tests ran an overall pass/fail status is determined. ++ private static void determineOverallTestStatus(OomDebugTest oomTest) ++ throws IOException, FileNotFoundException { ++ Properties resultProps = new Properties(); ++ if (!RESULT_FILE.exists()) { ++ RESULT_FILE.createNewFile(); ++ } ++ FileInputStream fin = null; ++ try { ++ fin = new FileInputStream(RESULT_FILE); ++ resultProps.load(fin); ++ resultProps.put(oomTest.testMethod, ++ Integer.toString(oomTest.failedTests)); ++ } finally { ++ if (fin != null) { ++ fin.close(); ++ } ++ } ++ System.out.println("DEBUG: Finished running test '" ++ + oomTest.testMethod + "'."); ++ if (LAST_TEST.equals(oomTest.testMethod)) { ++ System.out.println("DEBUG: Determining overall test status."); ++ Set<String> actualTestsRun = new HashSet<String>(); ++ int totalTests = ALL_TESTS.length; ++ int failedTests = 0; ++ for (Object key: resultProps.keySet()) { ++ actualTestsRun.add((String)key); ++ Object propVal = resultProps.get(key); ++ int value = Integer.parseInt((String)propVal); ++ failedTests += value; ++ } ++ if (!ALL_TESTS_SET.equals(actualTestsRun)) { ++ String errorMsg = "Test failed! Expected to run tests '" ++ + ALL_TESTS_SET + "', but only these were run '" ++ + actualTestsRun + "'"; ++ throw new RuntimeException(errorMsg); ++ } ++ if (failedTests >= 3) { ++ String errorMsg = "Test failed. Expected < 3 sub-tests to fail " ++ + "for a pass. Got " + failedTests ++ + " failed tests out of " + totalTests + "."; ++ throw new RuntimeException(errorMsg); ++ } ++ RESULT_FILE.delete(); ++ System.out.println("All " + totalTests + " tests passed."); ++ } else { ++ System.out.println("DEBUG: More tests to run. Continuing."); ++ FileOutputStream fout = null; ++ try { ++ fout = new FileOutputStream(RESULT_FILE); ++ resultProps.store(fout, "Storing results after test " ++ + oomTest.testMethod); ++ } finally { ++ if (fout != null) { ++ fout.close(); ++ } ++ } ++ } ++ } ++ ++ public static void main(String[] args) throws Exception { ++ System.setProperty("test.vm.opts", "-Xmx40m"); // Set debuggee VM option ++ OomDebugTest oomTest = new OomDebugTest(args); ++ try { ++ oomTest.startTests(); ++ } catch (Throwable e) { ++ System.out.println("DEBUG: Got exception for test run. " + e); ++ e.printStackTrace(); ++ oomTest.failure(); ++ } ++ determineOverallTestStatus(oomTest); ++ } ++ ++} +diff --git a/test/com/sun/jdi/oom/OomDebugTestSetup.sh b/test/com/sun/jdi/oom/OomDebugTestSetup.sh +new file mode 100644 +--- /dev/null ++++ openjdk/jdk/test/com/sun/jdi/oom/OomDebugTestSetup.sh +@@ -0,0 +1,46 @@ ++#!/bin/sh ++# ++# Copyright (c) 2016 Red Hat Inc. ++# 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. ++# ++ ++ ++if [ "${TESTSRC}" = "" ] ++then ++ echo "TESTSRC not set. Test cannot execute. Failed." ++ exit 1 ++fi ++echo "TESTSRC=${TESTSRC}" ++ ++if [ "${TESTJAVA}" = "" ] ++then ++ echo "TESTJAVA not set. Test cannot execute. Failed." ++ exit 1 ++fi ++echo "TESTJAVA=${TESTJAVA}" ++ ++if [ "${TESTCLASSES}" = "" ] ++then ++ echo "TESTCLASSES not set. Test cannot execute. Failed." ++ exit 1 ++fi ++ ++cp ${TESTSRC}/@debuggeeVMOptions ${TESTCLASSES}/ diff --git a/8155049-pr3352.patch b/8155049-pr3352.patch new file mode 100644 index 0000000..68cf02f --- /dev/null +++ b/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/8162384-pr3122-rh1358661.patch b/8162384-pr3122-rh1358661.patch new file mode 100644 index 0000000..ff38413 --- /dev/null +++ b/8162384-pr3122-rh1358661.patch @@ -0,0 +1,54 @@ +# HG changeset patch +# User roland +# Date 1469615613 -7200 +# Wed Jul 27 12:33:33 2016 +0200 +# Node ID fd29eff8b797daa41a68394ced7fe80c9e8c96e9 +# Parent ee9bffb3bd390b2ad805c7b59d7d2ab8a68a4367 +8162384, PR3122: Performance regression: bimorphic inlining may be bypassed by type speculation +Summary: when speculation fails at a call fallback to profile data at the call site +Reviewed-by: kvn + +diff -r ee9bffb3bd39 -r fd29eff8b797 src/share/vm/opto/doCall.cpp +--- openjdk/hotspot/src/share/vm/opto/doCall.cpp Mon Aug 01 16:33:54 2016 +0100 ++++ openjdk/hotspot/src/share/vm/opto/doCall.cpp Wed Jul 27 12:33:33 2016 +0200 +@@ -205,16 +205,22 @@ + + int morphism = profile.morphism(); + if (speculative_receiver_type != NULL) { +- // We have a speculative type, we should be able to resolve +- // the call. We do that before looking at the profiling at +- // this invoke because it may lead to bimorphic inlining which +- // a speculative type should help us avoid. +- receiver_method = callee->resolve_invoke(jvms->method()->holder(), +- speculative_receiver_type); +- if (receiver_method == NULL) { ++ if (!too_many_traps(caller, bci, Deoptimization::Reason_speculate_class_check)) { ++ // We have a speculative type, we should be able to resolve ++ // the call. We do that before looking at the profiling at ++ // this invoke because it may lead to bimorphic inlining which ++ // a speculative type should help us avoid. ++ receiver_method = callee->resolve_invoke(jvms->method()->holder(), ++ speculative_receiver_type); ++ if (receiver_method == NULL) { ++ speculative_receiver_type = NULL; ++ } else { ++ morphism = 1; ++ } ++ } else { ++ // speculation failed before. Use profiling at the call ++ // (could allow bimorphic inlining for instance). + speculative_receiver_type = NULL; +- } else { +- morphism = 1; + } + } + if (receiver_method == NULL && +@@ -252,7 +258,7 @@ + Deoptimization::Reason_bimorphic : + (speculative_receiver_type == NULL ? Deoptimization::Reason_class_check : Deoptimization::Reason_speculate_class_check); + if ((morphism == 1 || (morphism == 2 && next_hit_cg != NULL)) && +- !too_many_traps(jvms->method(), jvms->bci(), reason) ++ !too_many_traps(caller, bci, reason) + ) { + // Generate uncommon trap for class check failure path + // in case of monomorphic or bimorphic virtual call site. diff --git a/8165231-rh1437545.patch b/8165231-rh1437545.patch new file mode 100644 index 0000000..e0d5be7 --- /dev/null +++ b/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/8173941-pr3326.patch b/8173941-pr3326.patch new file mode 100644 index 0000000..50e74f6 --- /dev/null +++ b/8173941-pr3326.patch @@ -0,0 +1,77 @@ +# HG changeset patch +# User ysuenaga +# Date 1487123491 18000 +# Tue Feb 14 20:51:31 2017 -0500 +# Node ID 15922b2f31db4857ec84efdf533c41b19e68030b +# Parent 652fe741b8f2bfdacba66d772cc89fe7ec6dea66 +8173941, PR3326: SA does not work if executable is DSO +Reviewed-by: aph, dsamersoff + +diff --git a/agent/src/os/linux/elfmacros.h b/agent/src/os/linux/elfmacros.h +--- openjdk/hotspot/agent/src/os/linux/elfmacros.h ++++ openjdk/hotspot/agent/src/os/linux/elfmacros.h +@@ -33,6 +33,7 @@ + #define ELF_NHDR Elf64_Nhdr + #define ELF_DYN Elf64_Dyn + #define ELF_ADDR Elf64_Addr ++#define ELF_AUXV Elf64_auxv_t + + #define ELF_ST_TYPE ELF64_ST_TYPE + +@@ -45,6 +46,7 @@ + #define ELF_NHDR Elf32_Nhdr + #define ELF_DYN Elf32_Dyn + #define ELF_ADDR Elf32_Addr ++#define ELF_AUXV Elf32_auxv_t + + #define ELF_ST_TYPE ELF32_ST_TYPE + +diff --git a/agent/src/os/linux/ps_core.c b/agent/src/os/linux/ps_core.c +--- openjdk/hotspot/agent/src/os/linux/ps_core.c ++++ openjdk/hotspot/agent/src/os/linux/ps_core.c +@@ -642,6 +642,18 @@ + if (core_handle_prstatus(ph, descdata, notep->n_descsz) != true) { + return false; + } ++ } else if (notep->n_type == NT_AUXV) { ++ // Get first segment from entry point ++ ELF_AUXV *auxv = (ELF_AUXV *)descdata; ++ while (auxv->a_type != AT_NULL) { ++ if (auxv->a_type == AT_ENTRY) { ++ // Set entry point address to address of dynamic section. ++ // We will adjust it in read_exec_segments(). ++ ph->core->dynamic_addr = auxv->a_un.a_val; ++ break; ++ } ++ auxv++; ++ } + } + p = descdata + ROUNDUP(notep->n_descsz, 4); + } +@@ -826,7 +838,13 @@ + + // from PT_DYNAMIC we want to read address of first link_map addr + case PT_DYNAMIC: { +- ph->core->dynamic_addr = exec_php->p_vaddr; ++ if (exec_ehdr->e_type == ET_EXEC) { ++ ph->core->dynamic_addr = exec_php->p_vaddr; ++ } else { // ET_DYN ++ // dynamic_addr has entry point of executable. ++ // Thus we should substract it. ++ ph->core->dynamic_addr += exec_php->p_vaddr - exec_ehdr->e_entry; ++ } + print_debug("address of _DYNAMIC is 0x%lx\n", ph->core->dynamic_addr); + break; + } +@@ -1024,8 +1042,9 @@ + goto err; + } + +- if (read_elf_header(ph->core->exec_fd, &exec_ehdr) != true || exec_ehdr.e_type != ET_EXEC) { +- print_debug("executable file is not a valid ELF ET_EXEC file\n"); ++ if (read_elf_header(ph->core->exec_fd, &exec_ehdr) != true || ++ ((exec_ehdr.e_type != ET_EXEC) && (exec_ehdr.e_type != ET_DYN))) { ++ print_debug("executable file is not a valid ELF file\n"); + goto err; + } + diff --git a/8174164-pr3334-rh1417266.patch b/8174164-pr3334-rh1417266.patch new file mode 100644 index 0000000..494883f --- /dev/null +++ b/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/8174729-pr3336-rh1420518.patch b/8174729-pr3336-rh1420518.patch new file mode 100644 index 0000000..3d67850 --- /dev/null +++ b/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<V> 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/8175097-pr3334-rh1417266.patch b/8175097-pr3334-rh1417266.patch new file mode 100644 index 0000000..e80dd11 --- /dev/null +++ b/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/java-1.8.0-openjdk-aarch32.spec b/java-1.8.0-openjdk-aarch32.spec index f93c0a3..0dc47f5 100644 --- a/java-1.8.0-openjdk-aarch32.spec +++ b/java-1.8.0-openjdk-aarch32.spec @@ -35,6 +35,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 @@ -50,7 +57,7 @@ %ifarch %{jit_arches} %global bootstrap_build 1 %else -%global bootstrap_build 0 +%global bootstrap_build 1 %endif %if %{bootstrap_build} @@ -108,55 +115,70 @@ %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 +%ifarch %{jit_arches} +%global with_systemtap 0 +%else %global with_systemtap 0 -#%endif +%endif # Convert an absolute path to a relative path. Each symbolic link is # specified relative to the directory in which it is installed so that @@ -170,7 +192,7 @@ # note, following three variables are sedded from update_sources if used correctly. Hardcode them rather there. %global project aarch32-port %global repo jdk8u -%global revision jdk8u121-b13-aarch32-170210 +%global revision jdk8u131-b12-aarch32-170420 # 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 @@ -214,18 +236,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 || : @@ -235,38 +251,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}" = '059d61cfbb47e337b011ecda9350db9b' -o \\ - "${sum}" = '0dd41ddb4d1fb25975f7faab2c23e151' -o \\ - "${sum}" = '59dafb237e5def3ccf8a3ad589fb2777' -o \\ - "${sum}" = '84d16306cd4c2ae76ba81a3775e92cee' -o \\ - "${sum}" = '5ab4c77cf14fbd7f7ee6f51a7a73d88c' -o \\ - "${sum}" = 'b727442b4ac0e3b8a26ec9741ad463e5' -o \\ - "${sum}" = 'a59c6d96aeae1303fb8ba85e97588e9d' ]; 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 @@ -334,6 +318,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 } @@ -546,7 +539,6 @@ exit 0 %{_jvmprivdir}/* %{jvmjardir %%1} %dir %{_jvmdir}/%{jredir %%1}/lib/security -%{_jvmdir}/%{jredir %%1}/lib/security/cacerts %config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/US_export_policy.jar %config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/local_policy.jar %config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/java.policy @@ -663,8 +655,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. @@ -696,7 +688,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 @@ -735,8 +727,8 @@ Obsoletes: java-1.7.0-openjdk-headless%1 %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 @@ -761,14 +753,14 @@ Obsoletes: java-1.5.0-gcj-devel%1 %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} 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 @@ -787,15 +779,15 @@ 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} 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} Obsoletes: java-1.7.0-openjdk-accessibility%1 } @@ -805,7 +797,7 @@ Obsoletes: java-1.7.0-openjdk-accessibility%1 Name: java-%{javaver}-%{origin}-aarch32 Version: %{javaver}.%{updatever} -Release: 3.%{buildver}%{?dist} +Release: 1.%{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 @@ -834,14 +826,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: java-1.8.0-openjdk-remove-intree-libraries.sh @@ -895,7 +887,25 @@ 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 +#Patch100: %{name}-s390-java-opts.patch +# Type fixing for s390 +#Patch102: %{name}-size_t.patch +# Use "%z" for size_t on s390 as size_t != intptr_t +#Patch103: s390-size_t_format_flags.patch + +# Patches which need backporting to 8u +# S8073139, RH1191652; fix name of ppc64le architecture +#Patch601: %{name}-rh1191652-root.patch +#Patch602: %{name}-rh1191652-jdk.patch +#Patch603: %{name}-rh1191652-hotspot-aarch64.patch # Include all sources in src.zip Patch7: include-all-srcs.patch # 8035341: Allow using a system installed libpng @@ -912,14 +922,37 @@ Patch507: pr2842-02.patch Patch400: 8154313.patch # S6260348, PR3066: GTK+ L&F JTextComponent not respecting desktop caret blink rate Patch526: 6260348-pr3066.patch +# 8061305, PR3335, RH1423421: Javadoc crashes when method name ends with "Property" +Patch538: 8061305-pr3335-rh1423421.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 +# 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 Patch201: system-libjpeg.patch -# Pathces 204-206 are serving for better check of debug symbols in native liraries -Patch204: hotspot-remove-debuglink.patch -Patch205: dont-add-unnecessary-debug-links.patch -Patch206: hotspot-assembler-debuginfo.patch +# custom securities Patch207: PR3183.patch # Local fixes @@ -927,12 +960,13 @@ Patch207: PR3183.patch Patch525: pr1834-rh1022017.patch # RH1367357: lcms2: Out-of-bounds read in Type_MLU_Read() 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 -# AArch32 upstream changes - - BuildRequires: autoconf BuildRequires: automake BuildRequires: alsa-lib-devel @@ -971,8 +1005,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 @@ -1197,6 +1229,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 %{SOURCE999} +rm -rf hotspot +mv openjdk/hotspot . +rm -rf openjdk +popd +%endif cp %{SOURCE2} . @@ -1212,9 +1254,12 @@ cp %{SOURCE101} openjdk/common/autoconf/build-aux/ # Remove libraries that are linked sh %{SOURCE12} +# System library fixes %patch201 %patch202 %patch203 + +# Debugging fixes %patch204 %patch205 %patch206 @@ -1225,6 +1270,20 @@ sh %{SOURCE12} %patch5 %patch7 +# s390 build fixes +#%patch100 +#%patch102 +#%patch103 + +# ppc64le fixes + +#%patch603 +#%patch601 +#%patch602 + +# Zero fixes. + +# Upstreamable fixes %patch502 %patch504 %patch506 @@ -1241,12 +1300,29 @@ sh %{SOURCE12} %patch518 %patch400 %patch523 -%patch525 +%patch526 %patch528 +%patch532 +%patch535 +%patch537 +%patch538 +#%patch542 +%patch544 +%patch545 +%patch546 +%patch547 +%patch548 +%patch549 + +# RPM-only fixes +%patch525 %patch533 +%patch539 -# AArch32 upstream patches - +# RHEL-only patches +%if 0%{?rhel} +%patch534 +%endif # Extract systemtap tapsets %if %{with_systemtap} @@ -1287,8 +1363,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 @@ -1391,7 +1467,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 @@ -1407,9 +1483,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 @@ -1429,7 +1502,7 @@ do # 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" | egrep "\]\ .debug_(info|abbrev)" | wc --lines) == 2 + 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 @@ -1440,14 +1513,14 @@ do do # We expect to see .cpp files, except for architectures like aarch64 and # s390 where we expect .o and .oS files - echo "$line" | egrep "ABS ((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx|o|oS))?$" + 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" | \ - egrep "00000000 0 FILE LOCAL DEFAULT ABS javaCalls.(cpp|o)$" + grep -E "00000000 0 FILE LOCAL DEFAULT ABS javaCalls.(cpp|o)$" fi # Test that there are no .gnu_debuglink sections pointing to another @@ -1491,7 +1564,6 @@ $JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LocalVariableTable done %install -rm -rf $RPM_BUILD_ROOT STRIP_KEEP_SYMTAB=libjvm* for suffix in %{build_loop} ; do @@ -1570,13 +1642,8 @@ popd popd %endif - # Install cacerts symlink. + # Remove empty cacerts database. rm -f $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}/lib/security/cacerts - pushd $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}/lib/security - RELATIVE=$(%{abs2rel} %{_sysconfdir}/pki/java \ - %{_jvmdir}/%{jredir $suffix}/lib/security) - ln -sf $RELATIVE/cacerts . - popd # Install extension symlinks. install -d -m 755 $RPM_BUILD_ROOT%{jvmjardir $suffix} @@ -1788,7 +1855,7 @@ else end end -- run contetn of included file with fake args -arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}"} +arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}", "--temp", "%{rpm_state_dir}/%{name}.%{_arch}"} require "copy_jdk_configs.lua" %post @@ -1928,6 +1995,14 @@ require "copy_jdk_configs.lua" %endif %changelog +* Sat Apr 29 2017 Alex Kashchenko <akashche(a)redhat.com> - 1:1.8.0.131-1.170420 +- update sources to 8u131 +- sync with mainline package + +* Wed Apr 12 2017 Alex Kashchenko <akashche(a)redhat.com> - 1:1.8.0.121-4.170210 +- sync with mainline package +- add 8175234-aarch32 upstream patch + * Tue Feb 28 2017 Alex Kashchenko <akashche(a)redhat.com> - 1:1.8.0.121-3.170210 - rebuild because of NSS diff --git a/nss.cfg b/nss.cfg deleted file mode 100644 index 377a39c..0000000 --- a/nss.cfg +++ /dev/null @@ -1,5 +0,0 @@ -name = NSS -nssLibraryDirectory = @NSS_LIBDIR@ -nssDbMode = noDb -attributes = compatibility -handleStartupErrors = ignoreMultipleInitialisation diff --git a/nss.cfg.in b/nss.cfg.in new file mode 100644 index 0000000..377a39c --- /dev/null +++ b/nss.cfg.in @@ -0,0 +1,5 @@ +name = NSS +nssLibraryDirectory = @NSS_LIBDIR@ +nssDbMode = noDb +attributes = compatibility +handleStartupErrors = ignoreMultipleInitialisation diff --git a/pr1834-rh1022017.patch b/pr1834-rh1022017.patch index 3585029..4983884 100644 --- a/pr1834-rh1022017.patch +++ b/pr1834-rh1022017.patch @@ -1,8 +1,8 @@ diff --git a/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java b/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java --- openjdk/jdk/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java +++ openjdk/jdk/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java -@@ -160,20 +160,10 @@ - } +@@ -168,20 +168,10 @@ + "contains no supported elliptic curves"); } } else { // default curves - int[] ids; diff --git a/pr2888.patch b/pr2888.patch new file mode 100644 index 0000000..fc8f981 --- /dev/null +++ b/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 b/sources index fa92507..92a8fc8 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (systemtap-tapset-3.1.0.tar.xz) = e3558dc9d56dff5125a869807135e84ca73a2640d8d8fff2f45dc0dd7d153b81b48c08480e09a75667eba62362f74091465fac622aa0d9b104bfb18b4eba80e1 -SHA512 (aarch32-port-jdk8u-jdk8u121-b13-aarch32-170210.tar.xz) = 2ea4732cd9c90aedbe27cf6cc35df5777c75d668e15daca7911004d93f5b68fc4231df1eabd8739f1afb1afd9ea8574c8bfbe11322cde7664aba0cd8091e584b +SHA512 (systemtap-tapset-3.4.0pre01.tar.xz) = 4446fa20f88bbce53b583484bf06cb2b476c9372beb898dc2b7739eaa5c98b9979fbd72e12474fb344833d831a19366b82216ee03b452411745e6cd3527faa4e +SHA512 (aarch32-port-jdk8u-jdk8u131-b12-aarch32-170420.tar.xz) = 8cfca4b5f9d58fc22ea9011182dbb58f5614e23281d781c335ed9ae069e0e6587fb82f3b733e3f38e258e802342e679a6177ea59ec45f7bb9253c2b88bfe73e7 -- cgit v1.1
https://src.fedoraproject.org/cgit/java-1.8.0-openjdk-aarch32.git/commit/?h…
1
0
0
0
akasko pushed to java-1.8.0-openjdk-aarch32 (f25). "merge branch f24"
by notificationsï¼ fedoraproject.org
30 Apr '17
30 Apr '17
From f7e4c1a5736d2776cdd4a8f3f93ca340c2de868a Mon Sep 17 00:00:00 2001 From: Alex Kashchenko <akashche(a)redhat.com> Date: Sun, 30 Apr 2017 18:18:49 +0000 Subject: 8u131 update --- .gitignore | 2 + 8061305-pr3335-rh1423421.patch | 33 ++ 8144566-pr3352.patch | 911 ++++++++++++++++++++++++++++++++++++++++ 8153711-pr3313-rh1284948.patch | 669 +++++++++++++++++++++++++++++ 8155049-pr3352.patch | 41 ++ 8162384-pr3122-rh1358661.patch | 54 +++ 8165231-rh1437545.patch | 48 +++ 8173941-pr3326.patch | 77 ++++ 8174164-pr3334-rh1417266.patch | 79 ++++ 8174729-pr3336-rh1420518.patch | 122 ++++++ 8175097-pr3334-rh1417266.patch | 100 +++++ java-1.8.0-openjdk-aarch32.spec | 257 ++++++++---- nss.cfg | 5 - nss.cfg.in | 5 + pr1834-rh1022017.patch | 4 +- pr2888.patch | 60 +++ sources | 4 +- 17 files changed, 2371 insertions(+), 100 deletions(-) create mode 100644 8061305-pr3335-rh1423421.patch create mode 100644 8144566-pr3352.patch create mode 100644 8153711-pr3313-rh1284948.patch create mode 100644 8155049-pr3352.patch create mode 100644 8162384-pr3122-rh1358661.patch create mode 100644 8165231-rh1437545.patch create mode 100644 8173941-pr3326.patch create mode 100644 8174164-pr3334-rh1417266.patch create mode 100644 8174729-pr3336-rh1420518.patch create mode 100644 8175097-pr3334-rh1417266.patch delete mode 100644 nss.cfg create mode 100644 nss.cfg.in create mode 100644 pr2888.patch diff --git a/.gitignore b/.gitignore index 6c608c3..70f7217 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ /systemtap-tapset-3.1.0.tar.xz /aarch32-port-jdk8u-jdk8u112-b16-aarch32-161109.tar.xz /aarch32-port-jdk8u-jdk8u121-b13-aarch32-170210.tar.xz +/aarch32-port-jdk8u-jdk8u131-b12-aarch32-170420.tar.xz +/systemtap-tapset-3.4.0pre01.tar.xz diff --git a/8061305-pr3335-rh1423421.patch b/8061305-pr3335-rh1423421.patch new file mode 100644 index 0000000..384c52a --- /dev/null +++ b/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/8144566-pr3352.patch b/8144566-pr3352.patch new file mode 100644 index 0000000..9a2a294 --- /dev/null +++ b/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.<SNIServerName>emptyList(); + Collection<SNIMatcher> sniMatchers = + Collections.<SNIMatcher>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<SNIServerName> sniNames = params.getServerNames(); + if (sniNames != null) { ++ noSniExtension = sniNames.isEmpty(); + serverNames = sniNames; + } + + Collection<SNIMatcher> 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/8153711-pr3313-rh1284948.patch b/8153711-pr3313-rh1284948.patch new file mode 100644 index 0000000..b93fa06 --- /dev/null +++ b/8153711-pr3313-rh1284948.patch @@ -0,0 +1,669 @@ +# HG changeset patch +# User sgehwolf +# Date 1458555849 -3600 +# Mon Mar 21 11:24:09 2016 +0100 +# Node ID 9f6a0864a734ae3fd0eb198768db7cdee53ba0ed +# Parent 1179be40f1e3b59a890e96a5a9d3ff6fc18a2846 +8153711, PR3313: [REDO] JDWP: Memory Leak: GlobalRefs never deleted when processing invokeMethod command +Summary: Delete global references in invoker_completeInvokeRequest() +Reviewed-by: sspitsyn, dsamersoff + +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 +@@ -211,6 +211,62 @@ + return error; + } + ++/* ++ * 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(). ++ */ ++static void ++deleteGlobalArgumentRefs(JNIEnv *env, InvokeRequest *request) ++{ ++ void *cursor; ++ jint argIndex = 0; ++ jvalue *argument = request->arguments; ++ jbyte argumentTag = firstArgumentTypeTag(request->methodSignature, &cursor); ++ ++ if (request->clazz != NULL) { ++ tossGlobalRef(env, &(request->clazz)); ++ } ++ if (request->instance != NULL) { ++ tossGlobalRef(env, &(request->instance)); ++ } ++ /* Delete global argument references */ ++ while (argIndex < request->argumentCount) { ++ if ((argumentTag == JDWP_TAG(OBJECT)) || ++ (argumentTag == JDWP_TAG(ARRAY))) { ++ if (argument->l != NULL) { ++ tossGlobalRef(env, &(argument->l)); ++ } ++ } ++ argument++; ++ argIndex++; ++ argumentTag = nextArgumentTypeTag(&cursor); ++ } ++} ++ + static jvmtiError + fillInvokeRequest(JNIEnv *env, InvokeRequest *request, + jbyte invokeType, jbyte options, jint id, +@@ -320,6 +376,8 @@ + invokeConstructor(JNIEnv *env, InvokeRequest *request) + { + jobject object; ++ ++ JDI_ASSERT_MSG(request->clazz, "Request clazz null"); + object = JNI_FUNC_PTR(env,NewObjectA)(env, request->clazz, + request->method, + request->arguments); +@@ -336,6 +394,7 @@ + case JDWP_TAG(OBJECT): + case JDWP_TAG(ARRAY): { + jobject object; ++ JDI_ASSERT_MSG(request->clazz, "Request clazz null"); + object = JNI_FUNC_PTR(env,CallStaticObjectMethodA)(env, + request->clazz, + request->method, +@@ -424,6 +483,7 @@ + case JDWP_TAG(OBJECT): + case JDWP_TAG(ARRAY): { + jobject object; ++ JDI_ASSERT_MSG(request->instance, "Request instance null"); + object = JNI_FUNC_PTR(env,CallObjectMethodA)(env, + request->instance, + request->method, +@@ -511,6 +571,8 @@ + case JDWP_TAG(OBJECT): + case JDWP_TAG(ARRAY): { + jobject object; ++ JDI_ASSERT_MSG(request->clazz, "Request clazz null"); ++ JDI_ASSERT_MSG(request->instance, "Request instance null"); + object = JNI_FUNC_PTR(env,CallNonvirtualObjectMethodA)(env, + request->instance, + request->clazz, +@@ -607,6 +669,8 @@ + JNIEnv *env; + jboolean startNow; + InvokeRequest *request; ++ jbyte options; ++ jbyte invokeType; + + JDI_ASSERT(thread); + +@@ -623,6 +687,9 @@ + if (startNow) { + request->started = JNI_TRUE; + } ++ options = request->options; ++ invokeType = request->invokeType; ++ + debugMonitorExit(invokerLock); + + if (!startNow) { +@@ -637,7 +704,7 @@ + + JNI_FUNC_PTR(env,ExceptionClear)(env); + +- switch (request->invokeType) { ++ switch (invokeType) { + case INVOKE_CONSTRUCTOR: + invokeConstructor(env, request); + break; +@@ -645,7 +712,7 @@ + invokeStatic(env, request); + break; + case INVOKE_INSTANCE: +- if (request->options & JDWP_INVOKE_OPTIONS(NONVIRTUAL) ) { ++ if (options & JDWP_INVOKE_OPTIONS(NONVIRTUAL) ) { + invokeNonvirtual(env, request); + } else { + invokeVirtual(env, request); +@@ -723,12 +790,23 @@ + } + + /* ++ * At this time, there's no need to retain global references on ++ * arguments since the reply is processed. No one will deal with ++ * this request ID anymore, so we must call deleteGlobalArgumentRefs(). ++ * ++ * We cannot delete saved exception or return value references ++ * since otherwise a deleted handle would escape when writing ++ * the response to the stream. Instead, we clean those refs up ++ * after writing the respone. ++ */ ++ deleteGlobalArgumentRefs(env, request); ++ ++ /* + * Give up the lock before I/O operation + */ + debugMonitorExit(invokerLock); + eventHandler_unlock(); + +- + if (!detached) { + outStream_initReply(&out, id); + (void)outStream_writeValue(env, &out, tag, returnValue); +@@ -736,6 +814,16 @@ + (void)outStream_writeObjectRef(env, &out, exc); + outStream_sendReply(&out); + } ++ ++ /* ++ * Delete potentially saved global references of return value ++ * and exception ++ */ ++ eventHandler_lock(); // for proper lock order ++ debugMonitorEnter(invokerLock); ++ deletePotentiallySavedGlobalRefs(env, request); ++ debugMonitorExit(invokerLock); ++ eventHandler_unlock(); + } + + jboolean +diff --git a/test/com/sun/jdi/oom/@debuggeeVMOptions b/test/com/sun/jdi/oom/@debuggeeVMOptions +new file mode 100644 +--- /dev/null ++++ openjdk/jdk/test/com/sun/jdi/oom/@debuggeeVMOptions +@@ -0,0 +1,1 @@ ++-Xmx40m +\ No newline at end of file +diff --git a/test/com/sun/jdi/oom/OomDebugTest.java b/test/com/sun/jdi/oom/OomDebugTest.java +new file mode 100644 +--- /dev/null ++++ openjdk/jdk/test/com/sun/jdi/oom/OomDebugTest.java +@@ -0,0 +1,417 @@ ++/* ++ * Copyright (c) 2016 Red Hat Inc. ++ * ++ * 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 8153711 ++ * @summary JDWP: Memory Leak (global references not deleted after invokeMethod). ++ * ++ * @author Severin Gehwolf <sgehwolf(a)redhat.com> ++ * ++ * @library .. ++ * @run build TestScaffold VMConnection TargetListener TargetAdapter ++ * @run compile -g OomDebugTest.java ++ * @run shell OomDebugTestSetup.sh ++ * @run main OomDebugTest OomDebugTestTarget test1 ++ * @run main OomDebugTest OomDebugTestTarget test2 ++ * @run main OomDebugTest OomDebugTestTarget test3 ++ * @run main OomDebugTest OomDebugTestTarget test4 ++ * @run main OomDebugTest OomDebugTestTarget test5 ++ */ ++import java.io.File; ++import java.io.FileInputStream; ++import java.io.FileNotFoundException; ++import java.io.FileOutputStream; ++import java.io.IOException; ++import java.util.ArrayList; ++import java.util.Arrays; ++import java.util.Collections; ++import java.util.HashSet; ++import java.util.List; ++import java.util.Properties; ++import java.util.Set; ++ ++import com.sun.jdi.ArrayReference; ++import com.sun.jdi.ArrayType; ++import com.sun.jdi.ClassType; ++import com.sun.jdi.Field; ++import com.sun.jdi.InvocationException; ++import com.sun.jdi.Method; ++import com.sun.jdi.ObjectReference; ++import com.sun.jdi.ReferenceType; ++import com.sun.jdi.StackFrame; ++import com.sun.jdi.VMOutOfMemoryException; ++import com.sun.jdi.Value; ++import com.sun.jdi.event.BreakpointEvent; ++import com.sun.jdi.event.ExceptionEvent; ++ ++/***************** Target program **********************/ ++ ++class OomDebugTestTarget { ++ ++ OomDebugTestTarget() { ++ System.out.println("DEBUG: invoked constructor"); ++ } ++ static class FooCls { ++ @SuppressWarnings("unused") ++ private byte[] bytes = new byte[3000000]; ++ }; ++ ++ FooCls fooCls = new FooCls(); ++ byte[] byteArray = new byte[0]; ++ ++ void testMethod(FooCls foo) { ++ System.out.println("DEBUG: invoked 'void testMethod(FooCls)', foo == " + foo); ++ } ++ ++ void testPrimitive(byte[] foo) { ++ System.out.println("DEBUG: invoked 'void testPrimitive(byte[])', foo == " + foo); ++ } ++ ++ byte[] testPrimitiveArrRetval() { ++ System.out.println("DEBUG: invoked 'byte[] testPrimitiveArrRetval()'"); ++ return new byte[3000000]; ++ } ++ ++ FooCls testFooClsRetval() { ++ System.out.println("DEBUG: invoked 'FooCls testFooClsRetval()'"); ++ return new FooCls(); ++ } ++ ++ public void entry() {} ++ ++ public static void main(String[] args){ ++ System.out.println("DEBUG: OomDebugTestTarget.main"); ++ new OomDebugTestTarget().entry(); ++ } ++} ++ ++/***************** Test program ************************/ ++ ++public class OomDebugTest extends TestScaffold { ++ ++ private static final String[] ALL_TESTS = new String[] { ++ "test1", "test2", "test3", "test4", "test5" ++ }; ++ private static final Set<String> ALL_TESTS_SET = new HashSet<String>(); ++ static { ++ ALL_TESTS_SET.addAll(Arrays.asList(ALL_TESTS)); ++ } ++ private static final String TEST_CLASSES = System.getProperty("test.classes", "."); ++ private static final File RESULT_FILE = new File(TEST_CLASSES, "results.properties"); ++ private static final String LAST_TEST = ALL_TESTS[ALL_TESTS.length - 1]; ++ private ReferenceType targetClass; ++ private ObjectReference thisObject; ++ private int failedTests; ++ private final String testMethod; ++ ++ public OomDebugTest(String[] args) { ++ super(args); ++ if (args.length != 2) { ++ throw new RuntimeException("Wrong number of command-line arguments specified."); ++ } ++ this.testMethod = args[1]; ++ } ++ ++ @Override ++ protected void runTests() throws Exception { ++ try { ++ addListener(new TargetAdapter() { ++ ++ @Override ++ public void exceptionThrown(ExceptionEvent event) { ++ String name = event.exception().referenceType().name(); ++ System.err.println("DEBUG: Exception thrown in debuggee was: " + name); ++ } ++ }); ++ /* ++ * Get to the top of entry() ++ * to determine targetClass and mainThread ++ */ ++ BreakpointEvent bpe = startTo("OomDebugTestTarget", "entry", "()V"); ++ targetClass = bpe.location().declaringType(); ++ ++ mainThread = bpe.thread(); ++ ++ StackFrame frame = mainThread.frame(0); ++ thisObject = frame.thisObject(); ++ java.lang.reflect.Method m = findTestMethod(); ++ m.invoke(this); ++ } catch (NoSuchMethodException e) { ++ e.printStackTrace(); ++ failure(); ++ } catch (SecurityException e) { ++ e.printStackTrace(); ++ failure(); ++ } ++ /* ++ * resume the target, listening for events ++ */ ++ listenUntilVMDisconnect(); ++ } ++ ++ private java.lang.reflect.Method findTestMethod() ++ throws NoSuchMethodException, SecurityException { ++ return OomDebugTest.class.getDeclaredMethod(testMethod); ++ } ++ ++ private void failure() { ++ failedTests++; ++ } ++ ++ /* ++ * Test case: Object reference as method parameter. ++ */ ++ @SuppressWarnings("unused") // called via reflection ++ private void test1() throws Exception { ++ System.out.println("DEBUG: ------------> Running test1"); ++ try { ++ Field field = targetClass.fieldByName("fooCls"); ++ ClassType clsType = (ClassType)field.type(); ++ Method constructor = getConstructorForClass(clsType); ++ for (int i = 0; i < 15; i++) { ++ @SuppressWarnings({ "rawtypes", "unchecked" }) ++ ObjectReference objRef = clsType.newInstance(mainThread, ++ constructor, ++ new ArrayList(0), ++ ObjectReference.INVOKE_NONVIRTUAL); ++ if (objRef.isCollected()) { ++ System.out.println("DEBUG: Object got GC'ed before we can use it. NO-OP."); ++ continue; ++ } ++ invoke("testMethod", "(LOomDebugTestTarget$FooCls;)V", objRef); ++ } ++ } catch (InvocationException e) { ++ handleFailure(e); ++ } ++ } ++ ++ /* ++ * Test case: Array reference as method parameter. ++ */ ++ @SuppressWarnings("unused") // called via reflection ++ private void test2() throws Exception { ++ System.out.println("DEBUG: ------------> Running test2"); ++ try { ++ Field field = targetClass.fieldByName("byteArray"); ++ ArrayType arrType = (ArrayType)field.type(); ++ ++ for (int i = 0; i < 15; i++) { ++ ArrayReference byteArrayVal = arrType.newInstance(3000000); ++ if (byteArrayVal.isCollected()) { ++ System.out.println("DEBUG: Object got GC'ed before we can use it. NO-OP."); ++ continue; ++ } ++ invoke("testPrimitive", "([B)V", byteArrayVal); ++ } ++ } catch (VMOutOfMemoryException e) { ++ defaultHandleOOMFailure(e); ++ } ++ } ++ ++ /* ++ * Test case: Array reference as return value. ++ */ ++ @SuppressWarnings("unused") // called via reflection ++ private void test3() throws Exception { ++ System.out.println("DEBUG: ------------> Running test3"); ++ try { ++ for (int i = 0; i < 15; i++) { ++ invoke("testPrimitiveArrRetval", ++ "()[B", ++ Collections.EMPTY_LIST, ++ vm().mirrorOfVoid()); ++ } ++ } catch (InvocationException e) { ++ handleFailure(e); ++ } ++ } ++ ++ /* ++ * Test case: Object reference as return value. ++ */ ++ @SuppressWarnings("unused") // called via reflection ++ private void test4() throws Exception { ++ System.out.println("DEBUG: ------------> Running test4"); ++ try { ++ for (int i = 0; i < 15; i++) { ++ invoke("testFooClsRetval", ++ "()LOomDebugTestTarget$FooCls;", ++ Collections.EMPTY_LIST, ++ vm().mirrorOfVoid()); ++ } ++ } catch (InvocationException e) { ++ handleFailure(e); ++ } ++ } ++ ++ /* ++ * Test case: Constructor ++ */ ++ @SuppressWarnings({ "unused", "unchecked", "rawtypes" }) // called via reflection ++ private void test5() throws Exception { ++ System.out.println("DEBUG: ------------> Running test5"); ++ try { ++ ClassType type = (ClassType)thisObject.type(); ++ for (int i = 0; i < 15; i++) { ++ type.newInstance(mainThread, ++ findMethod(targetClass, "<init>", "()V"), ++ new ArrayList(0), ++ ObjectReference.INVOKE_NONVIRTUAL); ++ } ++ } catch (InvocationException e) { ++ handleFailure(e); ++ } ++ } ++ ++ private Method getConstructorForClass(ClassType clsType) { ++ List<Method> methods = clsType.methodsByName("<init>"); ++ if (methods.size() != 1) { ++ throw new RuntimeException("FAIL. Expected only one, the default, constructor"); ++ } ++ return methods.get(0); ++ } ++ ++ private void handleFailure(InvocationException e) { ++ // There is no good way to see the OOME diagnostic message in the target since the ++ // TestScaffold might throw an exception while trying to print the stack trace. I.e ++ // it might get a a VMDisconnectedException before the stack trace printing finishes. ++ System.err.println("FAILURE: InvocationException thrown. Trying to determine cause..."); ++ defaultHandleOOMFailure(e); ++ } ++ ++ private void defaultHandleOOMFailure(Exception e) { ++ e.printStackTrace(); ++ failure(); ++ } ++ ++ @SuppressWarnings({ "rawtypes", "unchecked" }) ++ void invoke(String methodName, String methodSig, Value value) ++ throws Exception { ++ List args = new ArrayList(1); ++ args.add(value); ++ invoke(methodName, methodSig, args, value); ++ } ++ ++ void invoke(String methodName, ++ String methodSig, ++ @SuppressWarnings("rawtypes") List args, ++ Value value) throws Exception { ++ Method method = findMethod(targetClass, methodName, methodSig); ++ if ( method == null) { ++ failure("FAILED: Can't find method: " ++ + methodName + " for class = " + targetClass); ++ return; ++ } ++ invoke(method, args, value); ++ } ++ ++ @SuppressWarnings({ "rawtypes", "unchecked" }) ++ void invoke(Method method, List args, Value value) throws Exception { ++ thisObject.invokeMethod(mainThread, method, args, 0); ++ System.out.println("DEBUG: Done invoking method via debugger."); ++ } ++ ++ Value fieldValue(String fieldName) { ++ Field field = targetClass.fieldByName(fieldName); ++ return thisObject.getValue(field); ++ } ++ ++ // Determine the pass/fail status on some heuristic and don't fail the ++ // test if < 3 of the total number of tests (currently 5) fail. This also ++ // has the nice side effect that all tests are first attempted and only ++ // all tests ran an overall pass/fail status is determined. ++ private static void determineOverallTestStatus(OomDebugTest oomTest) ++ throws IOException, FileNotFoundException { ++ Properties resultProps = new Properties(); ++ if (!RESULT_FILE.exists()) { ++ RESULT_FILE.createNewFile(); ++ } ++ FileInputStream fin = null; ++ try { ++ fin = new FileInputStream(RESULT_FILE); ++ resultProps.load(fin); ++ resultProps.put(oomTest.testMethod, ++ Integer.toString(oomTest.failedTests)); ++ } finally { ++ if (fin != null) { ++ fin.close(); ++ } ++ } ++ System.out.println("DEBUG: Finished running test '" ++ + oomTest.testMethod + "'."); ++ if (LAST_TEST.equals(oomTest.testMethod)) { ++ System.out.println("DEBUG: Determining overall test status."); ++ Set<String> actualTestsRun = new HashSet<String>(); ++ int totalTests = ALL_TESTS.length; ++ int failedTests = 0; ++ for (Object key: resultProps.keySet()) { ++ actualTestsRun.add((String)key); ++ Object propVal = resultProps.get(key); ++ int value = Integer.parseInt((String)propVal); ++ failedTests += value; ++ } ++ if (!ALL_TESTS_SET.equals(actualTestsRun)) { ++ String errorMsg = "Test failed! Expected to run tests '" ++ + ALL_TESTS_SET + "', but only these were run '" ++ + actualTestsRun + "'"; ++ throw new RuntimeException(errorMsg); ++ } ++ if (failedTests >= 3) { ++ String errorMsg = "Test failed. Expected < 3 sub-tests to fail " ++ + "for a pass. Got " + failedTests ++ + " failed tests out of " + totalTests + "."; ++ throw new RuntimeException(errorMsg); ++ } ++ RESULT_FILE.delete(); ++ System.out.println("All " + totalTests + " tests passed."); ++ } else { ++ System.out.println("DEBUG: More tests to run. Continuing."); ++ FileOutputStream fout = null; ++ try { ++ fout = new FileOutputStream(RESULT_FILE); ++ resultProps.store(fout, "Storing results after test " ++ + oomTest.testMethod); ++ } finally { ++ if (fout != null) { ++ fout.close(); ++ } ++ } ++ } ++ } ++ ++ public static void main(String[] args) throws Exception { ++ System.setProperty("test.vm.opts", "-Xmx40m"); // Set debuggee VM option ++ OomDebugTest oomTest = new OomDebugTest(args); ++ try { ++ oomTest.startTests(); ++ } catch (Throwable e) { ++ System.out.println("DEBUG: Got exception for test run. " + e); ++ e.printStackTrace(); ++ oomTest.failure(); ++ } ++ determineOverallTestStatus(oomTest); ++ } ++ ++} +diff --git a/test/com/sun/jdi/oom/OomDebugTestSetup.sh b/test/com/sun/jdi/oom/OomDebugTestSetup.sh +new file mode 100644 +--- /dev/null ++++ openjdk/jdk/test/com/sun/jdi/oom/OomDebugTestSetup.sh +@@ -0,0 +1,46 @@ ++#!/bin/sh ++# ++# Copyright (c) 2016 Red Hat Inc. ++# 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. ++# ++ ++ ++if [ "${TESTSRC}" = "" ] ++then ++ echo "TESTSRC not set. Test cannot execute. Failed." ++ exit 1 ++fi ++echo "TESTSRC=${TESTSRC}" ++ ++if [ "${TESTJAVA}" = "" ] ++then ++ echo "TESTJAVA not set. Test cannot execute. Failed." ++ exit 1 ++fi ++echo "TESTJAVA=${TESTJAVA}" ++ ++if [ "${TESTCLASSES}" = "" ] ++then ++ echo "TESTCLASSES not set. Test cannot execute. Failed." ++ exit 1 ++fi ++ ++cp ${TESTSRC}/@debuggeeVMOptions ${TESTCLASSES}/ diff --git a/8155049-pr3352.patch b/8155049-pr3352.patch new file mode 100644 index 0000000..68cf02f --- /dev/null +++ b/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/8162384-pr3122-rh1358661.patch b/8162384-pr3122-rh1358661.patch new file mode 100644 index 0000000..ff38413 --- /dev/null +++ b/8162384-pr3122-rh1358661.patch @@ -0,0 +1,54 @@ +# HG changeset patch +# User roland +# Date 1469615613 -7200 +# Wed Jul 27 12:33:33 2016 +0200 +# Node ID fd29eff8b797daa41a68394ced7fe80c9e8c96e9 +# Parent ee9bffb3bd390b2ad805c7b59d7d2ab8a68a4367 +8162384, PR3122: Performance regression: bimorphic inlining may be bypassed by type speculation +Summary: when speculation fails at a call fallback to profile data at the call site +Reviewed-by: kvn + +diff -r ee9bffb3bd39 -r fd29eff8b797 src/share/vm/opto/doCall.cpp +--- openjdk/hotspot/src/share/vm/opto/doCall.cpp Mon Aug 01 16:33:54 2016 +0100 ++++ openjdk/hotspot/src/share/vm/opto/doCall.cpp Wed Jul 27 12:33:33 2016 +0200 +@@ -205,16 +205,22 @@ + + int morphism = profile.morphism(); + if (speculative_receiver_type != NULL) { +- // We have a speculative type, we should be able to resolve +- // the call. We do that before looking at the profiling at +- // this invoke because it may lead to bimorphic inlining which +- // a speculative type should help us avoid. +- receiver_method = callee->resolve_invoke(jvms->method()->holder(), +- speculative_receiver_type); +- if (receiver_method == NULL) { ++ if (!too_many_traps(caller, bci, Deoptimization::Reason_speculate_class_check)) { ++ // We have a speculative type, we should be able to resolve ++ // the call. We do that before looking at the profiling at ++ // this invoke because it may lead to bimorphic inlining which ++ // a speculative type should help us avoid. ++ receiver_method = callee->resolve_invoke(jvms->method()->holder(), ++ speculative_receiver_type); ++ if (receiver_method == NULL) { ++ speculative_receiver_type = NULL; ++ } else { ++ morphism = 1; ++ } ++ } else { ++ // speculation failed before. Use profiling at the call ++ // (could allow bimorphic inlining for instance). + speculative_receiver_type = NULL; +- } else { +- morphism = 1; + } + } + if (receiver_method == NULL && +@@ -252,7 +258,7 @@ + Deoptimization::Reason_bimorphic : + (speculative_receiver_type == NULL ? Deoptimization::Reason_class_check : Deoptimization::Reason_speculate_class_check); + if ((morphism == 1 || (morphism == 2 && next_hit_cg != NULL)) && +- !too_many_traps(jvms->method(), jvms->bci(), reason) ++ !too_many_traps(caller, bci, reason) + ) { + // Generate uncommon trap for class check failure path + // in case of monomorphic or bimorphic virtual call site. diff --git a/8165231-rh1437545.patch b/8165231-rh1437545.patch new file mode 100644 index 0000000..e0d5be7 --- /dev/null +++ b/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/8173941-pr3326.patch b/8173941-pr3326.patch new file mode 100644 index 0000000..50e74f6 --- /dev/null +++ b/8173941-pr3326.patch @@ -0,0 +1,77 @@ +# HG changeset patch +# User ysuenaga +# Date 1487123491 18000 +# Tue Feb 14 20:51:31 2017 -0500 +# Node ID 15922b2f31db4857ec84efdf533c41b19e68030b +# Parent 652fe741b8f2bfdacba66d772cc89fe7ec6dea66 +8173941, PR3326: SA does not work if executable is DSO +Reviewed-by: aph, dsamersoff + +diff --git a/agent/src/os/linux/elfmacros.h b/agent/src/os/linux/elfmacros.h +--- openjdk/hotspot/agent/src/os/linux/elfmacros.h ++++ openjdk/hotspot/agent/src/os/linux/elfmacros.h +@@ -33,6 +33,7 @@ + #define ELF_NHDR Elf64_Nhdr + #define ELF_DYN Elf64_Dyn + #define ELF_ADDR Elf64_Addr ++#define ELF_AUXV Elf64_auxv_t + + #define ELF_ST_TYPE ELF64_ST_TYPE + +@@ -45,6 +46,7 @@ + #define ELF_NHDR Elf32_Nhdr + #define ELF_DYN Elf32_Dyn + #define ELF_ADDR Elf32_Addr ++#define ELF_AUXV Elf32_auxv_t + + #define ELF_ST_TYPE ELF32_ST_TYPE + +diff --git a/agent/src/os/linux/ps_core.c b/agent/src/os/linux/ps_core.c +--- openjdk/hotspot/agent/src/os/linux/ps_core.c ++++ openjdk/hotspot/agent/src/os/linux/ps_core.c +@@ -642,6 +642,18 @@ + if (core_handle_prstatus(ph, descdata, notep->n_descsz) != true) { + return false; + } ++ } else if (notep->n_type == NT_AUXV) { ++ // Get first segment from entry point ++ ELF_AUXV *auxv = (ELF_AUXV *)descdata; ++ while (auxv->a_type != AT_NULL) { ++ if (auxv->a_type == AT_ENTRY) { ++ // Set entry point address to address of dynamic section. ++ // We will adjust it in read_exec_segments(). ++ ph->core->dynamic_addr = auxv->a_un.a_val; ++ break; ++ } ++ auxv++; ++ } + } + p = descdata + ROUNDUP(notep->n_descsz, 4); + } +@@ -826,7 +838,13 @@ + + // from PT_DYNAMIC we want to read address of first link_map addr + case PT_DYNAMIC: { +- ph->core->dynamic_addr = exec_php->p_vaddr; ++ if (exec_ehdr->e_type == ET_EXEC) { ++ ph->core->dynamic_addr = exec_php->p_vaddr; ++ } else { // ET_DYN ++ // dynamic_addr has entry point of executable. ++ // Thus we should substract it. ++ ph->core->dynamic_addr += exec_php->p_vaddr - exec_ehdr->e_entry; ++ } + print_debug("address of _DYNAMIC is 0x%lx\n", ph->core->dynamic_addr); + break; + } +@@ -1024,8 +1042,9 @@ + goto err; + } + +- if (read_elf_header(ph->core->exec_fd, &exec_ehdr) != true || exec_ehdr.e_type != ET_EXEC) { +- print_debug("executable file is not a valid ELF ET_EXEC file\n"); ++ if (read_elf_header(ph->core->exec_fd, &exec_ehdr) != true || ++ ((exec_ehdr.e_type != ET_EXEC) && (exec_ehdr.e_type != ET_DYN))) { ++ print_debug("executable file is not a valid ELF file\n"); + goto err; + } + diff --git a/8174164-pr3334-rh1417266.patch b/8174164-pr3334-rh1417266.patch new file mode 100644 index 0000000..494883f --- /dev/null +++ b/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/8174729-pr3336-rh1420518.patch b/8174729-pr3336-rh1420518.patch new file mode 100644 index 0000000..3d67850 --- /dev/null +++ b/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<V> 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/8175097-pr3334-rh1417266.patch b/8175097-pr3334-rh1417266.patch new file mode 100644 index 0000000..e80dd11 --- /dev/null +++ b/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/java-1.8.0-openjdk-aarch32.spec b/java-1.8.0-openjdk-aarch32.spec index f93c0a3..0dc47f5 100644 --- a/java-1.8.0-openjdk-aarch32.spec +++ b/java-1.8.0-openjdk-aarch32.spec @@ -35,6 +35,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 @@ -50,7 +57,7 @@ %ifarch %{jit_arches} %global bootstrap_build 1 %else -%global bootstrap_build 0 +%global bootstrap_build 1 %endif %if %{bootstrap_build} @@ -108,55 +115,70 @@ %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 +%ifarch %{jit_arches} +%global with_systemtap 0 +%else %global with_systemtap 0 -#%endif +%endif # Convert an absolute path to a relative path. Each symbolic link is # specified relative to the directory in which it is installed so that @@ -170,7 +192,7 @@ # note, following three variables are sedded from update_sources if used correctly. Hardcode them rather there. %global project aarch32-port %global repo jdk8u -%global revision jdk8u121-b13-aarch32-170210 +%global revision jdk8u131-b12-aarch32-170420 # 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 @@ -214,18 +236,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 || : @@ -235,38 +251,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}" = '059d61cfbb47e337b011ecda9350db9b' -o \\ - "${sum}" = '0dd41ddb4d1fb25975f7faab2c23e151' -o \\ - "${sum}" = '59dafb237e5def3ccf8a3ad589fb2777' -o \\ - "${sum}" = '84d16306cd4c2ae76ba81a3775e92cee' -o \\ - "${sum}" = '5ab4c77cf14fbd7f7ee6f51a7a73d88c' -o \\ - "${sum}" = 'b727442b4ac0e3b8a26ec9741ad463e5' -o \\ - "${sum}" = 'a59c6d96aeae1303fb8ba85e97588e9d' ]; 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 @@ -334,6 +318,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 } @@ -546,7 +539,6 @@ exit 0 %{_jvmprivdir}/* %{jvmjardir %%1} %dir %{_jvmdir}/%{jredir %%1}/lib/security -%{_jvmdir}/%{jredir %%1}/lib/security/cacerts %config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/US_export_policy.jar %config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/local_policy.jar %config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/java.policy @@ -663,8 +655,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. @@ -696,7 +688,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 @@ -735,8 +727,8 @@ Obsoletes: java-1.7.0-openjdk-headless%1 %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 @@ -761,14 +753,14 @@ Obsoletes: java-1.5.0-gcj-devel%1 %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} 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 @@ -787,15 +779,15 @@ 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} 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} Obsoletes: java-1.7.0-openjdk-accessibility%1 } @@ -805,7 +797,7 @@ Obsoletes: java-1.7.0-openjdk-accessibility%1 Name: java-%{javaver}-%{origin}-aarch32 Version: %{javaver}.%{updatever} -Release: 3.%{buildver}%{?dist} +Release: 1.%{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 @@ -834,14 +826,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: java-1.8.0-openjdk-remove-intree-libraries.sh @@ -895,7 +887,25 @@ 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 +#Patch100: %{name}-s390-java-opts.patch +# Type fixing for s390 +#Patch102: %{name}-size_t.patch +# Use "%z" for size_t on s390 as size_t != intptr_t +#Patch103: s390-size_t_format_flags.patch + +# Patches which need backporting to 8u +# S8073139, RH1191652; fix name of ppc64le architecture +#Patch601: %{name}-rh1191652-root.patch +#Patch602: %{name}-rh1191652-jdk.patch +#Patch603: %{name}-rh1191652-hotspot-aarch64.patch # Include all sources in src.zip Patch7: include-all-srcs.patch # 8035341: Allow using a system installed libpng @@ -912,14 +922,37 @@ Patch507: pr2842-02.patch Patch400: 8154313.patch # S6260348, PR3066: GTK+ L&F JTextComponent not respecting desktop caret blink rate Patch526: 6260348-pr3066.patch +# 8061305, PR3335, RH1423421: Javadoc crashes when method name ends with "Property" +Patch538: 8061305-pr3335-rh1423421.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 +# 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 Patch201: system-libjpeg.patch -# Pathces 204-206 are serving for better check of debug symbols in native liraries -Patch204: hotspot-remove-debuglink.patch -Patch205: dont-add-unnecessary-debug-links.patch -Patch206: hotspot-assembler-debuginfo.patch +# custom securities Patch207: PR3183.patch # Local fixes @@ -927,12 +960,13 @@ Patch207: PR3183.patch Patch525: pr1834-rh1022017.patch # RH1367357: lcms2: Out-of-bounds read in Type_MLU_Read() 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 -# AArch32 upstream changes - - BuildRequires: autoconf BuildRequires: automake BuildRequires: alsa-lib-devel @@ -971,8 +1005,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 @@ -1197,6 +1229,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 %{SOURCE999} +rm -rf hotspot +mv openjdk/hotspot . +rm -rf openjdk +popd +%endif cp %{SOURCE2} . @@ -1212,9 +1254,12 @@ cp %{SOURCE101} openjdk/common/autoconf/build-aux/ # Remove libraries that are linked sh %{SOURCE12} +# System library fixes %patch201 %patch202 %patch203 + +# Debugging fixes %patch204 %patch205 %patch206 @@ -1225,6 +1270,20 @@ sh %{SOURCE12} %patch5 %patch7 +# s390 build fixes +#%patch100 +#%patch102 +#%patch103 + +# ppc64le fixes + +#%patch603 +#%patch601 +#%patch602 + +# Zero fixes. + +# Upstreamable fixes %patch502 %patch504 %patch506 @@ -1241,12 +1300,29 @@ sh %{SOURCE12} %patch518 %patch400 %patch523 -%patch525 +%patch526 %patch528 +%patch532 +%patch535 +%patch537 +%patch538 +#%patch542 +%patch544 +%patch545 +%patch546 +%patch547 +%patch548 +%patch549 + +# RPM-only fixes +%patch525 %patch533 +%patch539 -# AArch32 upstream patches - +# RHEL-only patches +%if 0%{?rhel} +%patch534 +%endif # Extract systemtap tapsets %if %{with_systemtap} @@ -1287,8 +1363,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 @@ -1391,7 +1467,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 @@ -1407,9 +1483,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 @@ -1429,7 +1502,7 @@ do # 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" | egrep "\]\ .debug_(info|abbrev)" | wc --lines) == 2 + 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 @@ -1440,14 +1513,14 @@ do do # We expect to see .cpp files, except for architectures like aarch64 and # s390 where we expect .o and .oS files - echo "$line" | egrep "ABS ((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx|o|oS))?$" + 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" | \ - egrep "00000000 0 FILE LOCAL DEFAULT ABS javaCalls.(cpp|o)$" + grep -E "00000000 0 FILE LOCAL DEFAULT ABS javaCalls.(cpp|o)$" fi # Test that there are no .gnu_debuglink sections pointing to another @@ -1491,7 +1564,6 @@ $JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LocalVariableTable done %install -rm -rf $RPM_BUILD_ROOT STRIP_KEEP_SYMTAB=libjvm* for suffix in %{build_loop} ; do @@ -1570,13 +1642,8 @@ popd popd %endif - # Install cacerts symlink. + # Remove empty cacerts database. rm -f $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}/lib/security/cacerts - pushd $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}/lib/security - RELATIVE=$(%{abs2rel} %{_sysconfdir}/pki/java \ - %{_jvmdir}/%{jredir $suffix}/lib/security) - ln -sf $RELATIVE/cacerts . - popd # Install extension symlinks. install -d -m 755 $RPM_BUILD_ROOT%{jvmjardir $suffix} @@ -1788,7 +1855,7 @@ else end end -- run contetn of included file with fake args -arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}"} +arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}", "--temp", "%{rpm_state_dir}/%{name}.%{_arch}"} require "copy_jdk_configs.lua" %post @@ -1928,6 +1995,14 @@ require "copy_jdk_configs.lua" %endif %changelog +* Sat Apr 29 2017 Alex Kashchenko <akashche(a)redhat.com> - 1:1.8.0.131-1.170420 +- update sources to 8u131 +- sync with mainline package + +* Wed Apr 12 2017 Alex Kashchenko <akashche(a)redhat.com> - 1:1.8.0.121-4.170210 +- sync with mainline package +- add 8175234-aarch32 upstream patch + * Tue Feb 28 2017 Alex Kashchenko <akashche(a)redhat.com> - 1:1.8.0.121-3.170210 - rebuild because of NSS diff --git a/nss.cfg b/nss.cfg deleted file mode 100644 index 377a39c..0000000 --- a/nss.cfg +++ /dev/null @@ -1,5 +0,0 @@ -name = NSS -nssLibraryDirectory = @NSS_LIBDIR@ -nssDbMode = noDb -attributes = compatibility -handleStartupErrors = ignoreMultipleInitialisation diff --git a/nss.cfg.in b/nss.cfg.in new file mode 100644 index 0000000..377a39c --- /dev/null +++ b/nss.cfg.in @@ -0,0 +1,5 @@ +name = NSS +nssLibraryDirectory = @NSS_LIBDIR@ +nssDbMode = noDb +attributes = compatibility +handleStartupErrors = ignoreMultipleInitialisation diff --git a/pr1834-rh1022017.patch b/pr1834-rh1022017.patch index 3585029..4983884 100644 --- a/pr1834-rh1022017.patch +++ b/pr1834-rh1022017.patch @@ -1,8 +1,8 @@ diff --git a/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java b/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java --- openjdk/jdk/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java +++ openjdk/jdk/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java -@@ -160,20 +160,10 @@ - } +@@ -168,20 +168,10 @@ + "contains no supported elliptic curves"); } } else { // default curves - int[] ids; diff --git a/pr2888.patch b/pr2888.patch new file mode 100644 index 0000000..fc8f981 --- /dev/null +++ b/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 b/sources index fa92507..92a8fc8 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (systemtap-tapset-3.1.0.tar.xz) = e3558dc9d56dff5125a869807135e84ca73a2640d8d8fff2f45dc0dd7d153b81b48c08480e09a75667eba62362f74091465fac622aa0d9b104bfb18b4eba80e1 -SHA512 (aarch32-port-jdk8u-jdk8u121-b13-aarch32-170210.tar.xz) = 2ea4732cd9c90aedbe27cf6cc35df5777c75d668e15daca7911004d93f5b68fc4231df1eabd8739f1afb1afd9ea8574c8bfbe11322cde7664aba0cd8091e584b +SHA512 (systemtap-tapset-3.4.0pre01.tar.xz) = 4446fa20f88bbce53b583484bf06cb2b476c9372beb898dc2b7739eaa5c98b9979fbd72e12474fb344833d831a19366b82216ee03b452411745e6cd3527faa4e +SHA512 (aarch32-port-jdk8u-jdk8u131-b12-aarch32-170420.tar.xz) = 8cfca4b5f9d58fc22ea9011182dbb58f5614e23281d781c335ed9ae069e0e6587fb82f3b733e3f38e258e802342e679a6177ea59ec45f7bb9253c2b88bfe73e7 -- cgit v1.1
https://src.fedoraproject.org/cgit/java-1.8.0-openjdk-aarch32.git/commit/?h…
1
0
0
0
akasko pushed to java-1.8.0-openjdk-aarch32 (f24). "8u131 update"
by notificationsï¼ fedoraproject.org
30 Apr '17
30 Apr '17
From f7e4c1a5736d2776cdd4a8f3f93ca340c2de868a Mon Sep 17 00:00:00 2001 From: Alex Kashchenko <akashche(a)redhat.com> Date: Sun, 30 Apr 2017 18:18:49 +0000 Subject: 8u131 update --- .gitignore | 2 + 8061305-pr3335-rh1423421.patch | 33 ++ 8144566-pr3352.patch | 911 ++++++++++++++++++++++++++++++++++++++++ 8153711-pr3313-rh1284948.patch | 669 +++++++++++++++++++++++++++++ 8155049-pr3352.patch | 41 ++ 8162384-pr3122-rh1358661.patch | 54 +++ 8165231-rh1437545.patch | 48 +++ 8173941-pr3326.patch | 77 ++++ 8174164-pr3334-rh1417266.patch | 79 ++++ 8174729-pr3336-rh1420518.patch | 122 ++++++ 8175097-pr3334-rh1417266.patch | 100 +++++ java-1.8.0-openjdk-aarch32.spec | 257 ++++++++---- nss.cfg | 5 - nss.cfg.in | 5 + pr1834-rh1022017.patch | 4 +- pr2888.patch | 60 +++ sources | 4 +- 17 files changed, 2371 insertions(+), 100 deletions(-) create mode 100644 8061305-pr3335-rh1423421.patch create mode 100644 8144566-pr3352.patch create mode 100644 8153711-pr3313-rh1284948.patch create mode 100644 8155049-pr3352.patch create mode 100644 8162384-pr3122-rh1358661.patch create mode 100644 8165231-rh1437545.patch create mode 100644 8173941-pr3326.patch create mode 100644 8174164-pr3334-rh1417266.patch create mode 100644 8174729-pr3336-rh1420518.patch create mode 100644 8175097-pr3334-rh1417266.patch delete mode 100644 nss.cfg create mode 100644 nss.cfg.in create mode 100644 pr2888.patch diff --git a/.gitignore b/.gitignore index 6c608c3..70f7217 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ /systemtap-tapset-3.1.0.tar.xz /aarch32-port-jdk8u-jdk8u112-b16-aarch32-161109.tar.xz /aarch32-port-jdk8u-jdk8u121-b13-aarch32-170210.tar.xz +/aarch32-port-jdk8u-jdk8u131-b12-aarch32-170420.tar.xz +/systemtap-tapset-3.4.0pre01.tar.xz diff --git a/8061305-pr3335-rh1423421.patch b/8061305-pr3335-rh1423421.patch new file mode 100644 index 0000000..384c52a --- /dev/null +++ b/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/8144566-pr3352.patch b/8144566-pr3352.patch new file mode 100644 index 0000000..9a2a294 --- /dev/null +++ b/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.<SNIServerName>emptyList(); + Collection<SNIMatcher> sniMatchers = + Collections.<SNIMatcher>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<SNIServerName> sniNames = params.getServerNames(); + if (sniNames != null) { ++ noSniExtension = sniNames.isEmpty(); + serverNames = sniNames; + } + + Collection<SNIMatcher> 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/8153711-pr3313-rh1284948.patch b/8153711-pr3313-rh1284948.patch new file mode 100644 index 0000000..b93fa06 --- /dev/null +++ b/8153711-pr3313-rh1284948.patch @@ -0,0 +1,669 @@ +# HG changeset patch +# User sgehwolf +# Date 1458555849 -3600 +# Mon Mar 21 11:24:09 2016 +0100 +# Node ID 9f6a0864a734ae3fd0eb198768db7cdee53ba0ed +# Parent 1179be40f1e3b59a890e96a5a9d3ff6fc18a2846 +8153711, PR3313: [REDO] JDWP: Memory Leak: GlobalRefs never deleted when processing invokeMethod command +Summary: Delete global references in invoker_completeInvokeRequest() +Reviewed-by: sspitsyn, dsamersoff + +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 +@@ -211,6 +211,62 @@ + return error; + } + ++/* ++ * 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(). ++ */ ++static void ++deleteGlobalArgumentRefs(JNIEnv *env, InvokeRequest *request) ++{ ++ void *cursor; ++ jint argIndex = 0; ++ jvalue *argument = request->arguments; ++ jbyte argumentTag = firstArgumentTypeTag(request->methodSignature, &cursor); ++ ++ if (request->clazz != NULL) { ++ tossGlobalRef(env, &(request->clazz)); ++ } ++ if (request->instance != NULL) { ++ tossGlobalRef(env, &(request->instance)); ++ } ++ /* Delete global argument references */ ++ while (argIndex < request->argumentCount) { ++ if ((argumentTag == JDWP_TAG(OBJECT)) || ++ (argumentTag == JDWP_TAG(ARRAY))) { ++ if (argument->l != NULL) { ++ tossGlobalRef(env, &(argument->l)); ++ } ++ } ++ argument++; ++ argIndex++; ++ argumentTag = nextArgumentTypeTag(&cursor); ++ } ++} ++ + static jvmtiError + fillInvokeRequest(JNIEnv *env, InvokeRequest *request, + jbyte invokeType, jbyte options, jint id, +@@ -320,6 +376,8 @@ + invokeConstructor(JNIEnv *env, InvokeRequest *request) + { + jobject object; ++ ++ JDI_ASSERT_MSG(request->clazz, "Request clazz null"); + object = JNI_FUNC_PTR(env,NewObjectA)(env, request->clazz, + request->method, + request->arguments); +@@ -336,6 +394,7 @@ + case JDWP_TAG(OBJECT): + case JDWP_TAG(ARRAY): { + jobject object; ++ JDI_ASSERT_MSG(request->clazz, "Request clazz null"); + object = JNI_FUNC_PTR(env,CallStaticObjectMethodA)(env, + request->clazz, + request->method, +@@ -424,6 +483,7 @@ + case JDWP_TAG(OBJECT): + case JDWP_TAG(ARRAY): { + jobject object; ++ JDI_ASSERT_MSG(request->instance, "Request instance null"); + object = JNI_FUNC_PTR(env,CallObjectMethodA)(env, + request->instance, + request->method, +@@ -511,6 +571,8 @@ + case JDWP_TAG(OBJECT): + case JDWP_TAG(ARRAY): { + jobject object; ++ JDI_ASSERT_MSG(request->clazz, "Request clazz null"); ++ JDI_ASSERT_MSG(request->instance, "Request instance null"); + object = JNI_FUNC_PTR(env,CallNonvirtualObjectMethodA)(env, + request->instance, + request->clazz, +@@ -607,6 +669,8 @@ + JNIEnv *env; + jboolean startNow; + InvokeRequest *request; ++ jbyte options; ++ jbyte invokeType; + + JDI_ASSERT(thread); + +@@ -623,6 +687,9 @@ + if (startNow) { + request->started = JNI_TRUE; + } ++ options = request->options; ++ invokeType = request->invokeType; ++ + debugMonitorExit(invokerLock); + + if (!startNow) { +@@ -637,7 +704,7 @@ + + JNI_FUNC_PTR(env,ExceptionClear)(env); + +- switch (request->invokeType) { ++ switch (invokeType) { + case INVOKE_CONSTRUCTOR: + invokeConstructor(env, request); + break; +@@ -645,7 +712,7 @@ + invokeStatic(env, request); + break; + case INVOKE_INSTANCE: +- if (request->options & JDWP_INVOKE_OPTIONS(NONVIRTUAL) ) { ++ if (options & JDWP_INVOKE_OPTIONS(NONVIRTUAL) ) { + invokeNonvirtual(env, request); + } else { + invokeVirtual(env, request); +@@ -723,12 +790,23 @@ + } + + /* ++ * At this time, there's no need to retain global references on ++ * arguments since the reply is processed. No one will deal with ++ * this request ID anymore, so we must call deleteGlobalArgumentRefs(). ++ * ++ * We cannot delete saved exception or return value references ++ * since otherwise a deleted handle would escape when writing ++ * the response to the stream. Instead, we clean those refs up ++ * after writing the respone. ++ */ ++ deleteGlobalArgumentRefs(env, request); ++ ++ /* + * Give up the lock before I/O operation + */ + debugMonitorExit(invokerLock); + eventHandler_unlock(); + +- + if (!detached) { + outStream_initReply(&out, id); + (void)outStream_writeValue(env, &out, tag, returnValue); +@@ -736,6 +814,16 @@ + (void)outStream_writeObjectRef(env, &out, exc); + outStream_sendReply(&out); + } ++ ++ /* ++ * Delete potentially saved global references of return value ++ * and exception ++ */ ++ eventHandler_lock(); // for proper lock order ++ debugMonitorEnter(invokerLock); ++ deletePotentiallySavedGlobalRefs(env, request); ++ debugMonitorExit(invokerLock); ++ eventHandler_unlock(); + } + + jboolean +diff --git a/test/com/sun/jdi/oom/@debuggeeVMOptions b/test/com/sun/jdi/oom/@debuggeeVMOptions +new file mode 100644 +--- /dev/null ++++ openjdk/jdk/test/com/sun/jdi/oom/@debuggeeVMOptions +@@ -0,0 +1,1 @@ ++-Xmx40m +\ No newline at end of file +diff --git a/test/com/sun/jdi/oom/OomDebugTest.java b/test/com/sun/jdi/oom/OomDebugTest.java +new file mode 100644 +--- /dev/null ++++ openjdk/jdk/test/com/sun/jdi/oom/OomDebugTest.java +@@ -0,0 +1,417 @@ ++/* ++ * Copyright (c) 2016 Red Hat Inc. ++ * ++ * 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 8153711 ++ * @summary JDWP: Memory Leak (global references not deleted after invokeMethod). ++ * ++ * @author Severin Gehwolf <sgehwolf(a)redhat.com> ++ * ++ * @library .. ++ * @run build TestScaffold VMConnection TargetListener TargetAdapter ++ * @run compile -g OomDebugTest.java ++ * @run shell OomDebugTestSetup.sh ++ * @run main OomDebugTest OomDebugTestTarget test1 ++ * @run main OomDebugTest OomDebugTestTarget test2 ++ * @run main OomDebugTest OomDebugTestTarget test3 ++ * @run main OomDebugTest OomDebugTestTarget test4 ++ * @run main OomDebugTest OomDebugTestTarget test5 ++ */ ++import java.io.File; ++import java.io.FileInputStream; ++import java.io.FileNotFoundException; ++import java.io.FileOutputStream; ++import java.io.IOException; ++import java.util.ArrayList; ++import java.util.Arrays; ++import java.util.Collections; ++import java.util.HashSet; ++import java.util.List; ++import java.util.Properties; ++import java.util.Set; ++ ++import com.sun.jdi.ArrayReference; ++import com.sun.jdi.ArrayType; ++import com.sun.jdi.ClassType; ++import com.sun.jdi.Field; ++import com.sun.jdi.InvocationException; ++import com.sun.jdi.Method; ++import com.sun.jdi.ObjectReference; ++import com.sun.jdi.ReferenceType; ++import com.sun.jdi.StackFrame; ++import com.sun.jdi.VMOutOfMemoryException; ++import com.sun.jdi.Value; ++import com.sun.jdi.event.BreakpointEvent; ++import com.sun.jdi.event.ExceptionEvent; ++ ++/***************** Target program **********************/ ++ ++class OomDebugTestTarget { ++ ++ OomDebugTestTarget() { ++ System.out.println("DEBUG: invoked constructor"); ++ } ++ static class FooCls { ++ @SuppressWarnings("unused") ++ private byte[] bytes = new byte[3000000]; ++ }; ++ ++ FooCls fooCls = new FooCls(); ++ byte[] byteArray = new byte[0]; ++ ++ void testMethod(FooCls foo) { ++ System.out.println("DEBUG: invoked 'void testMethod(FooCls)', foo == " + foo); ++ } ++ ++ void testPrimitive(byte[] foo) { ++ System.out.println("DEBUG: invoked 'void testPrimitive(byte[])', foo == " + foo); ++ } ++ ++ byte[] testPrimitiveArrRetval() { ++ System.out.println("DEBUG: invoked 'byte[] testPrimitiveArrRetval()'"); ++ return new byte[3000000]; ++ } ++ ++ FooCls testFooClsRetval() { ++ System.out.println("DEBUG: invoked 'FooCls testFooClsRetval()'"); ++ return new FooCls(); ++ } ++ ++ public void entry() {} ++ ++ public static void main(String[] args){ ++ System.out.println("DEBUG: OomDebugTestTarget.main"); ++ new OomDebugTestTarget().entry(); ++ } ++} ++ ++/***************** Test program ************************/ ++ ++public class OomDebugTest extends TestScaffold { ++ ++ private static final String[] ALL_TESTS = new String[] { ++ "test1", "test2", "test3", "test4", "test5" ++ }; ++ private static final Set<String> ALL_TESTS_SET = new HashSet<String>(); ++ static { ++ ALL_TESTS_SET.addAll(Arrays.asList(ALL_TESTS)); ++ } ++ private static final String TEST_CLASSES = System.getProperty("test.classes", "."); ++ private static final File RESULT_FILE = new File(TEST_CLASSES, "results.properties"); ++ private static final String LAST_TEST = ALL_TESTS[ALL_TESTS.length - 1]; ++ private ReferenceType targetClass; ++ private ObjectReference thisObject; ++ private int failedTests; ++ private final String testMethod; ++ ++ public OomDebugTest(String[] args) { ++ super(args); ++ if (args.length != 2) { ++ throw new RuntimeException("Wrong number of command-line arguments specified."); ++ } ++ this.testMethod = args[1]; ++ } ++ ++ @Override ++ protected void runTests() throws Exception { ++ try { ++ addListener(new TargetAdapter() { ++ ++ @Override ++ public void exceptionThrown(ExceptionEvent event) { ++ String name = event.exception().referenceType().name(); ++ System.err.println("DEBUG: Exception thrown in debuggee was: " + name); ++ } ++ }); ++ /* ++ * Get to the top of entry() ++ * to determine targetClass and mainThread ++ */ ++ BreakpointEvent bpe = startTo("OomDebugTestTarget", "entry", "()V"); ++ targetClass = bpe.location().declaringType(); ++ ++ mainThread = bpe.thread(); ++ ++ StackFrame frame = mainThread.frame(0); ++ thisObject = frame.thisObject(); ++ java.lang.reflect.Method m = findTestMethod(); ++ m.invoke(this); ++ } catch (NoSuchMethodException e) { ++ e.printStackTrace(); ++ failure(); ++ } catch (SecurityException e) { ++ e.printStackTrace(); ++ failure(); ++ } ++ /* ++ * resume the target, listening for events ++ */ ++ listenUntilVMDisconnect(); ++ } ++ ++ private java.lang.reflect.Method findTestMethod() ++ throws NoSuchMethodException, SecurityException { ++ return OomDebugTest.class.getDeclaredMethod(testMethod); ++ } ++ ++ private void failure() { ++ failedTests++; ++ } ++ ++ /* ++ * Test case: Object reference as method parameter. ++ */ ++ @SuppressWarnings("unused") // called via reflection ++ private void test1() throws Exception { ++ System.out.println("DEBUG: ------------> Running test1"); ++ try { ++ Field field = targetClass.fieldByName("fooCls"); ++ ClassType clsType = (ClassType)field.type(); ++ Method constructor = getConstructorForClass(clsType); ++ for (int i = 0; i < 15; i++) { ++ @SuppressWarnings({ "rawtypes", "unchecked" }) ++ ObjectReference objRef = clsType.newInstance(mainThread, ++ constructor, ++ new ArrayList(0), ++ ObjectReference.INVOKE_NONVIRTUAL); ++ if (objRef.isCollected()) { ++ System.out.println("DEBUG: Object got GC'ed before we can use it. NO-OP."); ++ continue; ++ } ++ invoke("testMethod", "(LOomDebugTestTarget$FooCls;)V", objRef); ++ } ++ } catch (InvocationException e) { ++ handleFailure(e); ++ } ++ } ++ ++ /* ++ * Test case: Array reference as method parameter. ++ */ ++ @SuppressWarnings("unused") // called via reflection ++ private void test2() throws Exception { ++ System.out.println("DEBUG: ------------> Running test2"); ++ try { ++ Field field = targetClass.fieldByName("byteArray"); ++ ArrayType arrType = (ArrayType)field.type(); ++ ++ for (int i = 0; i < 15; i++) { ++ ArrayReference byteArrayVal = arrType.newInstance(3000000); ++ if (byteArrayVal.isCollected()) { ++ System.out.println("DEBUG: Object got GC'ed before we can use it. NO-OP."); ++ continue; ++ } ++ invoke("testPrimitive", "([B)V", byteArrayVal); ++ } ++ } catch (VMOutOfMemoryException e) { ++ defaultHandleOOMFailure(e); ++ } ++ } ++ ++ /* ++ * Test case: Array reference as return value. ++ */ ++ @SuppressWarnings("unused") // called via reflection ++ private void test3() throws Exception { ++ System.out.println("DEBUG: ------------> Running test3"); ++ try { ++ for (int i = 0; i < 15; i++) { ++ invoke("testPrimitiveArrRetval", ++ "()[B", ++ Collections.EMPTY_LIST, ++ vm().mirrorOfVoid()); ++ } ++ } catch (InvocationException e) { ++ handleFailure(e); ++ } ++ } ++ ++ /* ++ * Test case: Object reference as return value. ++ */ ++ @SuppressWarnings("unused") // called via reflection ++ private void test4() throws Exception { ++ System.out.println("DEBUG: ------------> Running test4"); ++ try { ++ for (int i = 0; i < 15; i++) { ++ invoke("testFooClsRetval", ++ "()LOomDebugTestTarget$FooCls;", ++ Collections.EMPTY_LIST, ++ vm().mirrorOfVoid()); ++ } ++ } catch (InvocationException e) { ++ handleFailure(e); ++ } ++ } ++ ++ /* ++ * Test case: Constructor ++ */ ++ @SuppressWarnings({ "unused", "unchecked", "rawtypes" }) // called via reflection ++ private void test5() throws Exception { ++ System.out.println("DEBUG: ------------> Running test5"); ++ try { ++ ClassType type = (ClassType)thisObject.type(); ++ for (int i = 0; i < 15; i++) { ++ type.newInstance(mainThread, ++ findMethod(targetClass, "<init>", "()V"), ++ new ArrayList(0), ++ ObjectReference.INVOKE_NONVIRTUAL); ++ } ++ } catch (InvocationException e) { ++ handleFailure(e); ++ } ++ } ++ ++ private Method getConstructorForClass(ClassType clsType) { ++ List<Method> methods = clsType.methodsByName("<init>"); ++ if (methods.size() != 1) { ++ throw new RuntimeException("FAIL. Expected only one, the default, constructor"); ++ } ++ return methods.get(0); ++ } ++ ++ private void handleFailure(InvocationException e) { ++ // There is no good way to see the OOME diagnostic message in the target since the ++ // TestScaffold might throw an exception while trying to print the stack trace. I.e ++ // it might get a a VMDisconnectedException before the stack trace printing finishes. ++ System.err.println("FAILURE: InvocationException thrown. Trying to determine cause..."); ++ defaultHandleOOMFailure(e); ++ } ++ ++ private void defaultHandleOOMFailure(Exception e) { ++ e.printStackTrace(); ++ failure(); ++ } ++ ++ @SuppressWarnings({ "rawtypes", "unchecked" }) ++ void invoke(String methodName, String methodSig, Value value) ++ throws Exception { ++ List args = new ArrayList(1); ++ args.add(value); ++ invoke(methodName, methodSig, args, value); ++ } ++ ++ void invoke(String methodName, ++ String methodSig, ++ @SuppressWarnings("rawtypes") List args, ++ Value value) throws Exception { ++ Method method = findMethod(targetClass, methodName, methodSig); ++ if ( method == null) { ++ failure("FAILED: Can't find method: " ++ + methodName + " for class = " + targetClass); ++ return; ++ } ++ invoke(method, args, value); ++ } ++ ++ @SuppressWarnings({ "rawtypes", "unchecked" }) ++ void invoke(Method method, List args, Value value) throws Exception { ++ thisObject.invokeMethod(mainThread, method, args, 0); ++ System.out.println("DEBUG: Done invoking method via debugger."); ++ } ++ ++ Value fieldValue(String fieldName) { ++ Field field = targetClass.fieldByName(fieldName); ++ return thisObject.getValue(field); ++ } ++ ++ // Determine the pass/fail status on some heuristic and don't fail the ++ // test if < 3 of the total number of tests (currently 5) fail. This also ++ // has the nice side effect that all tests are first attempted and only ++ // all tests ran an overall pass/fail status is determined. ++ private static void determineOverallTestStatus(OomDebugTest oomTest) ++ throws IOException, FileNotFoundException { ++ Properties resultProps = new Properties(); ++ if (!RESULT_FILE.exists()) { ++ RESULT_FILE.createNewFile(); ++ } ++ FileInputStream fin = null; ++ try { ++ fin = new FileInputStream(RESULT_FILE); ++ resultProps.load(fin); ++ resultProps.put(oomTest.testMethod, ++ Integer.toString(oomTest.failedTests)); ++ } finally { ++ if (fin != null) { ++ fin.close(); ++ } ++ } ++ System.out.println("DEBUG: Finished running test '" ++ + oomTest.testMethod + "'."); ++ if (LAST_TEST.equals(oomTest.testMethod)) { ++ System.out.println("DEBUG: Determining overall test status."); ++ Set<String> actualTestsRun = new HashSet<String>(); ++ int totalTests = ALL_TESTS.length; ++ int failedTests = 0; ++ for (Object key: resultProps.keySet()) { ++ actualTestsRun.add((String)key); ++ Object propVal = resultProps.get(key); ++ int value = Integer.parseInt((String)propVal); ++ failedTests += value; ++ } ++ if (!ALL_TESTS_SET.equals(actualTestsRun)) { ++ String errorMsg = "Test failed! Expected to run tests '" ++ + ALL_TESTS_SET + "', but only these were run '" ++ + actualTestsRun + "'"; ++ throw new RuntimeException(errorMsg); ++ } ++ if (failedTests >= 3) { ++ String errorMsg = "Test failed. Expected < 3 sub-tests to fail " ++ + "for a pass. Got " + failedTests ++ + " failed tests out of " + totalTests + "."; ++ throw new RuntimeException(errorMsg); ++ } ++ RESULT_FILE.delete(); ++ System.out.println("All " + totalTests + " tests passed."); ++ } else { ++ System.out.println("DEBUG: More tests to run. Continuing."); ++ FileOutputStream fout = null; ++ try { ++ fout = new FileOutputStream(RESULT_FILE); ++ resultProps.store(fout, "Storing results after test " ++ + oomTest.testMethod); ++ } finally { ++ if (fout != null) { ++ fout.close(); ++ } ++ } ++ } ++ } ++ ++ public static void main(String[] args) throws Exception { ++ System.setProperty("test.vm.opts", "-Xmx40m"); // Set debuggee VM option ++ OomDebugTest oomTest = new OomDebugTest(args); ++ try { ++ oomTest.startTests(); ++ } catch (Throwable e) { ++ System.out.println("DEBUG: Got exception for test run. " + e); ++ e.printStackTrace(); ++ oomTest.failure(); ++ } ++ determineOverallTestStatus(oomTest); ++ } ++ ++} +diff --git a/test/com/sun/jdi/oom/OomDebugTestSetup.sh b/test/com/sun/jdi/oom/OomDebugTestSetup.sh +new file mode 100644 +--- /dev/null ++++ openjdk/jdk/test/com/sun/jdi/oom/OomDebugTestSetup.sh +@@ -0,0 +1,46 @@ ++#!/bin/sh ++# ++# Copyright (c) 2016 Red Hat Inc. ++# 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. ++# ++ ++ ++if [ "${TESTSRC}" = "" ] ++then ++ echo "TESTSRC not set. Test cannot execute. Failed." ++ exit 1 ++fi ++echo "TESTSRC=${TESTSRC}" ++ ++if [ "${TESTJAVA}" = "" ] ++then ++ echo "TESTJAVA not set. Test cannot execute. Failed." ++ exit 1 ++fi ++echo "TESTJAVA=${TESTJAVA}" ++ ++if [ "${TESTCLASSES}" = "" ] ++then ++ echo "TESTCLASSES not set. Test cannot execute. Failed." ++ exit 1 ++fi ++ ++cp ${TESTSRC}/@debuggeeVMOptions ${TESTCLASSES}/ diff --git a/8155049-pr3352.patch b/8155049-pr3352.patch new file mode 100644 index 0000000..68cf02f --- /dev/null +++ b/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/8162384-pr3122-rh1358661.patch b/8162384-pr3122-rh1358661.patch new file mode 100644 index 0000000..ff38413 --- /dev/null +++ b/8162384-pr3122-rh1358661.patch @@ -0,0 +1,54 @@ +# HG changeset patch +# User roland +# Date 1469615613 -7200 +# Wed Jul 27 12:33:33 2016 +0200 +# Node ID fd29eff8b797daa41a68394ced7fe80c9e8c96e9 +# Parent ee9bffb3bd390b2ad805c7b59d7d2ab8a68a4367 +8162384, PR3122: Performance regression: bimorphic inlining may be bypassed by type speculation +Summary: when speculation fails at a call fallback to profile data at the call site +Reviewed-by: kvn + +diff -r ee9bffb3bd39 -r fd29eff8b797 src/share/vm/opto/doCall.cpp +--- openjdk/hotspot/src/share/vm/opto/doCall.cpp Mon Aug 01 16:33:54 2016 +0100 ++++ openjdk/hotspot/src/share/vm/opto/doCall.cpp Wed Jul 27 12:33:33 2016 +0200 +@@ -205,16 +205,22 @@ + + int morphism = profile.morphism(); + if (speculative_receiver_type != NULL) { +- // We have a speculative type, we should be able to resolve +- // the call. We do that before looking at the profiling at +- // this invoke because it may lead to bimorphic inlining which +- // a speculative type should help us avoid. +- receiver_method = callee->resolve_invoke(jvms->method()->holder(), +- speculative_receiver_type); +- if (receiver_method == NULL) { ++ if (!too_many_traps(caller, bci, Deoptimization::Reason_speculate_class_check)) { ++ // We have a speculative type, we should be able to resolve ++ // the call. We do that before looking at the profiling at ++ // this invoke because it may lead to bimorphic inlining which ++ // a speculative type should help us avoid. ++ receiver_method = callee->resolve_invoke(jvms->method()->holder(), ++ speculative_receiver_type); ++ if (receiver_method == NULL) { ++ speculative_receiver_type = NULL; ++ } else { ++ morphism = 1; ++ } ++ } else { ++ // speculation failed before. Use profiling at the call ++ // (could allow bimorphic inlining for instance). + speculative_receiver_type = NULL; +- } else { +- morphism = 1; + } + } + if (receiver_method == NULL && +@@ -252,7 +258,7 @@ + Deoptimization::Reason_bimorphic : + (speculative_receiver_type == NULL ? Deoptimization::Reason_class_check : Deoptimization::Reason_speculate_class_check); + if ((morphism == 1 || (morphism == 2 && next_hit_cg != NULL)) && +- !too_many_traps(jvms->method(), jvms->bci(), reason) ++ !too_many_traps(caller, bci, reason) + ) { + // Generate uncommon trap for class check failure path + // in case of monomorphic or bimorphic virtual call site. diff --git a/8165231-rh1437545.patch b/8165231-rh1437545.patch new file mode 100644 index 0000000..e0d5be7 --- /dev/null +++ b/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/8173941-pr3326.patch b/8173941-pr3326.patch new file mode 100644 index 0000000..50e74f6 --- /dev/null +++ b/8173941-pr3326.patch @@ -0,0 +1,77 @@ +# HG changeset patch +# User ysuenaga +# Date 1487123491 18000 +# Tue Feb 14 20:51:31 2017 -0500 +# Node ID 15922b2f31db4857ec84efdf533c41b19e68030b +# Parent 652fe741b8f2bfdacba66d772cc89fe7ec6dea66 +8173941, PR3326: SA does not work if executable is DSO +Reviewed-by: aph, dsamersoff + +diff --git a/agent/src/os/linux/elfmacros.h b/agent/src/os/linux/elfmacros.h +--- openjdk/hotspot/agent/src/os/linux/elfmacros.h ++++ openjdk/hotspot/agent/src/os/linux/elfmacros.h +@@ -33,6 +33,7 @@ + #define ELF_NHDR Elf64_Nhdr + #define ELF_DYN Elf64_Dyn + #define ELF_ADDR Elf64_Addr ++#define ELF_AUXV Elf64_auxv_t + + #define ELF_ST_TYPE ELF64_ST_TYPE + +@@ -45,6 +46,7 @@ + #define ELF_NHDR Elf32_Nhdr + #define ELF_DYN Elf32_Dyn + #define ELF_ADDR Elf32_Addr ++#define ELF_AUXV Elf32_auxv_t + + #define ELF_ST_TYPE ELF32_ST_TYPE + +diff --git a/agent/src/os/linux/ps_core.c b/agent/src/os/linux/ps_core.c +--- openjdk/hotspot/agent/src/os/linux/ps_core.c ++++ openjdk/hotspot/agent/src/os/linux/ps_core.c +@@ -642,6 +642,18 @@ + if (core_handle_prstatus(ph, descdata, notep->n_descsz) != true) { + return false; + } ++ } else if (notep->n_type == NT_AUXV) { ++ // Get first segment from entry point ++ ELF_AUXV *auxv = (ELF_AUXV *)descdata; ++ while (auxv->a_type != AT_NULL) { ++ if (auxv->a_type == AT_ENTRY) { ++ // Set entry point address to address of dynamic section. ++ // We will adjust it in read_exec_segments(). ++ ph->core->dynamic_addr = auxv->a_un.a_val; ++ break; ++ } ++ auxv++; ++ } + } + p = descdata + ROUNDUP(notep->n_descsz, 4); + } +@@ -826,7 +838,13 @@ + + // from PT_DYNAMIC we want to read address of first link_map addr + case PT_DYNAMIC: { +- ph->core->dynamic_addr = exec_php->p_vaddr; ++ if (exec_ehdr->e_type == ET_EXEC) { ++ ph->core->dynamic_addr = exec_php->p_vaddr; ++ } else { // ET_DYN ++ // dynamic_addr has entry point of executable. ++ // Thus we should substract it. ++ ph->core->dynamic_addr += exec_php->p_vaddr - exec_ehdr->e_entry; ++ } + print_debug("address of _DYNAMIC is 0x%lx\n", ph->core->dynamic_addr); + break; + } +@@ -1024,8 +1042,9 @@ + goto err; + } + +- if (read_elf_header(ph->core->exec_fd, &exec_ehdr) != true || exec_ehdr.e_type != ET_EXEC) { +- print_debug("executable file is not a valid ELF ET_EXEC file\n"); ++ if (read_elf_header(ph->core->exec_fd, &exec_ehdr) != true || ++ ((exec_ehdr.e_type != ET_EXEC) && (exec_ehdr.e_type != ET_DYN))) { ++ print_debug("executable file is not a valid ELF file\n"); + goto err; + } + diff --git a/8174164-pr3334-rh1417266.patch b/8174164-pr3334-rh1417266.patch new file mode 100644 index 0000000..494883f --- /dev/null +++ b/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/8174729-pr3336-rh1420518.patch b/8174729-pr3336-rh1420518.patch new file mode 100644 index 0000000..3d67850 --- /dev/null +++ b/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<V> 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/8175097-pr3334-rh1417266.patch b/8175097-pr3334-rh1417266.patch new file mode 100644 index 0000000..e80dd11 --- /dev/null +++ b/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/java-1.8.0-openjdk-aarch32.spec b/java-1.8.0-openjdk-aarch32.spec index f93c0a3..0dc47f5 100644 --- a/java-1.8.0-openjdk-aarch32.spec +++ b/java-1.8.0-openjdk-aarch32.spec @@ -35,6 +35,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 @@ -50,7 +57,7 @@ %ifarch %{jit_arches} %global bootstrap_build 1 %else -%global bootstrap_build 0 +%global bootstrap_build 1 %endif %if %{bootstrap_build} @@ -108,55 +115,70 @@ %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 +%ifarch %{jit_arches} +%global with_systemtap 0 +%else %global with_systemtap 0 -#%endif +%endif # Convert an absolute path to a relative path. Each symbolic link is # specified relative to the directory in which it is installed so that @@ -170,7 +192,7 @@ # note, following three variables are sedded from update_sources if used correctly. Hardcode them rather there. %global project aarch32-port %global repo jdk8u -%global revision jdk8u121-b13-aarch32-170210 +%global revision jdk8u131-b12-aarch32-170420 # 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 @@ -214,18 +236,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 || : @@ -235,38 +251,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}" = '059d61cfbb47e337b011ecda9350db9b' -o \\ - "${sum}" = '0dd41ddb4d1fb25975f7faab2c23e151' -o \\ - "${sum}" = '59dafb237e5def3ccf8a3ad589fb2777' -o \\ - "${sum}" = '84d16306cd4c2ae76ba81a3775e92cee' -o \\ - "${sum}" = '5ab4c77cf14fbd7f7ee6f51a7a73d88c' -o \\ - "${sum}" = 'b727442b4ac0e3b8a26ec9741ad463e5' -o \\ - "${sum}" = 'a59c6d96aeae1303fb8ba85e97588e9d' ]; 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 @@ -334,6 +318,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 } @@ -546,7 +539,6 @@ exit 0 %{_jvmprivdir}/* %{jvmjardir %%1} %dir %{_jvmdir}/%{jredir %%1}/lib/security -%{_jvmdir}/%{jredir %%1}/lib/security/cacerts %config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/US_export_policy.jar %config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/local_policy.jar %config(noreplace) %{_jvmdir}/%{jredir %%1}/lib/security/java.policy @@ -663,8 +655,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. @@ -696,7 +688,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 @@ -735,8 +727,8 @@ Obsoletes: java-1.7.0-openjdk-headless%1 %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 @@ -761,14 +753,14 @@ Obsoletes: java-1.5.0-gcj-devel%1 %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} 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 @@ -787,15 +779,15 @@ 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} 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} Obsoletes: java-1.7.0-openjdk-accessibility%1 } @@ -805,7 +797,7 @@ Obsoletes: java-1.7.0-openjdk-accessibility%1 Name: java-%{javaver}-%{origin}-aarch32 Version: %{javaver}.%{updatever} -Release: 3.%{buildver}%{?dist} +Release: 1.%{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 @@ -834,14 +826,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: java-1.8.0-openjdk-remove-intree-libraries.sh @@ -895,7 +887,25 @@ 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 +#Patch100: %{name}-s390-java-opts.patch +# Type fixing for s390 +#Patch102: %{name}-size_t.patch +# Use "%z" for size_t on s390 as size_t != intptr_t +#Patch103: s390-size_t_format_flags.patch + +# Patches which need backporting to 8u +# S8073139, RH1191652; fix name of ppc64le architecture +#Patch601: %{name}-rh1191652-root.patch +#Patch602: %{name}-rh1191652-jdk.patch +#Patch603: %{name}-rh1191652-hotspot-aarch64.patch # Include all sources in src.zip Patch7: include-all-srcs.patch # 8035341: Allow using a system installed libpng @@ -912,14 +922,37 @@ Patch507: pr2842-02.patch Patch400: 8154313.patch # S6260348, PR3066: GTK+ L&F JTextComponent not respecting desktop caret blink rate Patch526: 6260348-pr3066.patch +# 8061305, PR3335, RH1423421: Javadoc crashes when method name ends with "Property" +Patch538: 8061305-pr3335-rh1423421.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 +# 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 Patch201: system-libjpeg.patch -# Pathces 204-206 are serving for better check of debug symbols in native liraries -Patch204: hotspot-remove-debuglink.patch -Patch205: dont-add-unnecessary-debug-links.patch -Patch206: hotspot-assembler-debuginfo.patch +# custom securities Patch207: PR3183.patch # Local fixes @@ -927,12 +960,13 @@ Patch207: PR3183.patch Patch525: pr1834-rh1022017.patch # RH1367357: lcms2: Out-of-bounds read in Type_MLU_Read() 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 -# AArch32 upstream changes - - BuildRequires: autoconf BuildRequires: automake BuildRequires: alsa-lib-devel @@ -971,8 +1005,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 @@ -1197,6 +1229,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 %{SOURCE999} +rm -rf hotspot +mv openjdk/hotspot . +rm -rf openjdk +popd +%endif cp %{SOURCE2} . @@ -1212,9 +1254,12 @@ cp %{SOURCE101} openjdk/common/autoconf/build-aux/ # Remove libraries that are linked sh %{SOURCE12} +# System library fixes %patch201 %patch202 %patch203 + +# Debugging fixes %patch204 %patch205 %patch206 @@ -1225,6 +1270,20 @@ sh %{SOURCE12} %patch5 %patch7 +# s390 build fixes +#%patch100 +#%patch102 +#%patch103 + +# ppc64le fixes + +#%patch603 +#%patch601 +#%patch602 + +# Zero fixes. + +# Upstreamable fixes %patch502 %patch504 %patch506 @@ -1241,12 +1300,29 @@ sh %{SOURCE12} %patch518 %patch400 %patch523 -%patch525 +%patch526 %patch528 +%patch532 +%patch535 +%patch537 +%patch538 +#%patch542 +%patch544 +%patch545 +%patch546 +%patch547 +%patch548 +%patch549 + +# RPM-only fixes +%patch525 %patch533 +%patch539 -# AArch32 upstream patches - +# RHEL-only patches +%if 0%{?rhel} +%patch534 +%endif # Extract systemtap tapsets %if %{with_systemtap} @@ -1287,8 +1363,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 @@ -1391,7 +1467,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 @@ -1407,9 +1483,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 @@ -1429,7 +1502,7 @@ do # 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" | egrep "\]\ .debug_(info|abbrev)" | wc --lines) == 2 + 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 @@ -1440,14 +1513,14 @@ do do # We expect to see .cpp files, except for architectures like aarch64 and # s390 where we expect .o and .oS files - echo "$line" | egrep "ABS ((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx|o|oS))?$" + 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" | \ - egrep "00000000 0 FILE LOCAL DEFAULT ABS javaCalls.(cpp|o)$" + grep -E "00000000 0 FILE LOCAL DEFAULT ABS javaCalls.(cpp|o)$" fi # Test that there are no .gnu_debuglink sections pointing to another @@ -1491,7 +1564,6 @@ $JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LocalVariableTable done %install -rm -rf $RPM_BUILD_ROOT STRIP_KEEP_SYMTAB=libjvm* for suffix in %{build_loop} ; do @@ -1570,13 +1642,8 @@ popd popd %endif - # Install cacerts symlink. + # Remove empty cacerts database. rm -f $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}/lib/security/cacerts - pushd $RPM_BUILD_ROOT%{_jvmdir}/%{jredir $suffix}/lib/security - RELATIVE=$(%{abs2rel} %{_sysconfdir}/pki/java \ - %{_jvmdir}/%{jredir $suffix}/lib/security) - ln -sf $RELATIVE/cacerts . - popd # Install extension symlinks. install -d -m 755 $RPM_BUILD_ROOT%{jvmjardir $suffix} @@ -1788,7 +1855,7 @@ else end end -- run contetn of included file with fake args -arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}"} +arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}", "--temp", "%{rpm_state_dir}/%{name}.%{_arch}"} require "copy_jdk_configs.lua" %post @@ -1928,6 +1995,14 @@ require "copy_jdk_configs.lua" %endif %changelog +* Sat Apr 29 2017 Alex Kashchenko <akashche(a)redhat.com> - 1:1.8.0.131-1.170420 +- update sources to 8u131 +- sync with mainline package + +* Wed Apr 12 2017 Alex Kashchenko <akashche(a)redhat.com> - 1:1.8.0.121-4.170210 +- sync with mainline package +- add 8175234-aarch32 upstream patch + * Tue Feb 28 2017 Alex Kashchenko <akashche(a)redhat.com> - 1:1.8.0.121-3.170210 - rebuild because of NSS diff --git a/nss.cfg b/nss.cfg deleted file mode 100644 index 377a39c..0000000 --- a/nss.cfg +++ /dev/null @@ -1,5 +0,0 @@ -name = NSS -nssLibraryDirectory = @NSS_LIBDIR@ -nssDbMode = noDb -attributes = compatibility -handleStartupErrors = ignoreMultipleInitialisation diff --git a/nss.cfg.in b/nss.cfg.in new file mode 100644 index 0000000..377a39c --- /dev/null +++ b/nss.cfg.in @@ -0,0 +1,5 @@ +name = NSS +nssLibraryDirectory = @NSS_LIBDIR@ +nssDbMode = noDb +attributes = compatibility +handleStartupErrors = ignoreMultipleInitialisation diff --git a/pr1834-rh1022017.patch b/pr1834-rh1022017.patch index 3585029..4983884 100644 --- a/pr1834-rh1022017.patch +++ b/pr1834-rh1022017.patch @@ -1,8 +1,8 @@ diff --git a/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java b/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java --- openjdk/jdk/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java +++ openjdk/jdk/src/share/classes/sun/security/ssl/SupportedEllipticCurvesExtension.java -@@ -160,20 +160,10 @@ - } +@@ -168,20 +168,10 @@ + "contains no supported elliptic curves"); } } else { // default curves - int[] ids; diff --git a/pr2888.patch b/pr2888.patch new file mode 100644 index 0000000..fc8f981 --- /dev/null +++ b/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 b/sources index fa92507..92a8fc8 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (systemtap-tapset-3.1.0.tar.xz) = e3558dc9d56dff5125a869807135e84ca73a2640d8d8fff2f45dc0dd7d153b81b48c08480e09a75667eba62362f74091465fac622aa0d9b104bfb18b4eba80e1 -SHA512 (aarch32-port-jdk8u-jdk8u121-b13-aarch32-170210.tar.xz) = 2ea4732cd9c90aedbe27cf6cc35df5777c75d668e15daca7911004d93f5b68fc4231df1eabd8739f1afb1afd9ea8574c8bfbe11322cde7664aba0cd8091e584b +SHA512 (systemtap-tapset-3.4.0pre01.tar.xz) = 4446fa20f88bbce53b583484bf06cb2b476c9372beb898dc2b7739eaa5c98b9979fbd72e12474fb344833d831a19366b82216ee03b452411745e6cd3527faa4e +SHA512 (aarch32-port-jdk8u-jdk8u131-b12-aarch32-170420.tar.xz) = 8cfca4b5f9d58fc22ea9011182dbb58f5614e23281d781c335ed9ae069e0e6587fb82f3b733e3f38e258e802342e679a6177ea59ec45f7bb9253c2b88bfe73e7 -- cgit v1.1
https://src.fedoraproject.org/cgit/java-1.8.0-openjdk-aarch32.git/commit/?h…
1
0
0
0
akasko uploaded aarch32-port-jdk8u-jdk8u131-b12-aarch32-170420.tar.xz for java-1.8.0-openjdk-aarch32
by notificationsï¼ fedoraproject.org
30 Apr '17
30 Apr '17
8cfca4b5f9d58fc22ea9011182dbb58f5614e23281d781c335ed9ae069e0e6587fb82f3b733e3f38e258e802342e679a6177ea59ec45f7bb9253c2b88bfe73e7 aarch32-port-jdk8u-jdk8u131-b12-aarch32-170420.tar.xz
https://src.fedoraproject.org/lookaside/pkgs/java-1.8.0-openjdk-aarch32/aar…
1
0
0
0
akasko uploaded systemtap-tapset-3.4.0pre01.tar.xz for java-1.8.0-openjdk-aarch32
by notificationsï¼ fedoraproject.org
30 Apr '17
30 Apr '17
4446fa20f88bbce53b583484bf06cb2b476c9372beb898dc2b7739eaa5c98b9979fbd72e12474fb344833d831a19366b82216ee03b452411745e6cd3527faa4e systemtap-tapset-3.4.0pre01.tar.xz
https://src.fedoraproject.org/lookaside/pkgs/java-1.8.0-openjdk-aarch32/sys…
1
0
0
0
decathorpe pushed to screenshot-tool (f25). "R1: update to version 0.1.3.1"
by notificationsï¼ fedoraproject.org
30 Apr '17
30 Apr '17
From 28c3205f91439e25620b7d6f187e5baec4292425 Mon Sep 17 00:00:00 2001 From: Fabio Valentini <decathorpe(a)gmail.com> Date: Sun, 30 Apr 2017 15:21:42 +0200 Subject: R1: update to version 0.1.3.1 --- .gitignore | 1 + screenshot-tool.spec | 17 ++++++++++++----- sources | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 374506e..085305d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /screenshot-tool-0.1.1.tar.xz /screenshot-tool-0.1.2.tar.xz +/screenshot-tool-0.1.3.1.tar.gz diff --git a/screenshot-tool.spec b/screenshot-tool.spec index b927598..89ea6c7 100644 --- a/screenshot-tool.spec +++ b/screenshot-tool.spec @@ -1,11 +1,11 @@ Name: screenshot-tool Summary: Simple screen capture tool -Version: 0.1.2 +Version: 0.1.3.1 Release: 1%{?dist} License: LGPLv3 -URL:
https://launchpad.net/screenshot-tool
-Source0:
https://launchpad.net/%{name}/0.1.x/%{version}/+download/%{name}-%{version}…
+URL:
https://github.com/elementary/%{name}
+Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz BuildRequires: cmake BuildRequires: desktop-file-utils @@ -19,6 +19,7 @@ BuildRequires: pkgconfig(gdk-pixbuf-2.0) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(granite) BuildRequires: pkgconfig(gtk+-3.0) >= 3.12 +BuildRequires: pkgconfig(libcanberra) Requires: hicolor-icon-theme @@ -33,7 +34,7 @@ A simple screen capture tool made for elementary OS. %build mkdir build && pushd build -%cmake .. +%cmake -DICON_UPDATE:BOOL=OFF .. %make_build popd @@ -48,7 +49,7 @@ popd %check desktop-file-validate %{buildroot}/%{_datadir}/applications/screenshot-tool.desktop -appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/screenshot-tool.appdata.xml || : +appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/screenshot-tool.appdata.xml %post @@ -76,6 +77,12 @@ fi %changelog +* Sun Apr 30 2017 Fabio Valentini <decathorpe(a)gmail.com> - 0.1.3.1-1 +- Update to version 0.1.3.1. + +* Sat Apr 22 2017 Fabio Valentini <decathorpe(a)gmail.com> - 0.1.3-1 +- Update to version 0.1.3. + * Fri Feb 17 2017 Fabio Valentini <decathorpe(a)gmail.com> - 0.1.2-1 - Update to version 0.1.2. - Remove patch and bundled icon. Upstream now ships an icon. diff --git a/sources b/sources index 1b08eaf..fc70c75 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (screenshot-tool-0.1.2.tar.xz) = 55740986891cc019304e18a3a0c1e6a50fb66612b2e0ccfa52942a2a84db5c65b011916c60a24c6fc9d7d3b86d0691d8a53ed3f50027646cfa07175777d5da12 +SHA512 (screenshot-tool-0.1.3.1.tar.gz) = 4176986790e920d36fed201810dbe440e4402293e603d275c7b0518ad07f8c13cf4d108360e2fe78d492991c85e1be1a63d1024befdd539d0c6e8510400b1b71 -- cgit v1.1
https://src.fedoraproject.org/cgit/screenshot-tool.git/commit/?h=f25&id=28c…
1
0
0
0
pbrobinson pushed to pyjokes (f26). "Initial import"
by notificationsï¼ fedoraproject.org
30 Apr '17
30 Apr '17
From 2cef3e5b88074d3cab1c6c949648d7de38b22855 Mon Sep 17 00:00:00 2001 From: Paul Whalen <pwhalen(a)redhat.com> Date: Tue, 25 Apr 2017 15:07:09 -0400 Subject: Initial import --- .gitignore | 1 + pyjokes.spec | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 84 insertions(+) create mode 100644 pyjokes.spec diff --git a/.gitignore b/.gitignore index e69de29..b5ed1ae 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/v0.5.0.tar.gz diff --git a/pyjokes.spec b/pyjokes.spec new file mode 100644 index 0000000..f9932e9 --- /dev/null +++ b/pyjokes.spec @@ -0,0 +1,82 @@ +%global pypi_name pyjokes +%global with_tests 0 +%global global_desc One line jokes for programmers (jokes as a service) + +Name: %{pypi_name} +Version: 0.5.0 +Release: 2%{?dist} +Summary: %{global_desc} + +License: BSD +URL:
http://pyjok.es/
+Source0:
https://github.com/%{pypi_name}/%{pypi_name}/archive/v%{version}.tar.gz
+ +BuildArch: noarch +BuildRequires: python3-devel +BuildRequires: python2-devel +%if 0%{?with_tests} +BuildRequires: python2-pytest +BuildRequires: python3-pytest +%endif + + +%description +%{global_desc}. + +%package -n python2-%{pypi_name} +Summary: %{global_desc} + +%{?python_provide:%python_provide python2-%{pypi_name}} + +%description -n python2-%{pypi_name} +%{global_desc}. + +%package -n python3-%{pypi_name} +Summary: %{global_desc} + +%{?python_provide:%python_provide python3-%{pypi_name}} + +%description -n python3-%{pypi_name} +%{global_desc}. + +%prep +%setup -q -n %{pypi_name}-%{version} + +%build +%py2_build +%py3_build + +%install +%py2_install +%py3_install + +%check +%if %{with_tests} +%{__python2} setup.py test +%{__python3} setup.py test +%endif + +%files -n python2-%{pypi_name} +%license LICENCE.txt +%doc docs/* +# For noarch packages: sitelib +%{_bindir}/pyjoke* +%{python2_sitelib}/pyjokes-* +%{python2_sitelib}/pyjokes/* + +%files -n python3-%{pypi_name} +%license LICENCE.txt +%doc docs/* +# For noarch packages: sitelib +%{_bindir}/pyjoke* +%{python3_sitelib}/pyjokes-* +%{python3_sitelib}/pyjokes/* + +%changelog +* Fri Mar 03 2017 Paul Whalen <pwhalen(a)redhat.com> - 0.5.0-2 +- Add %python_provide macro. +- Consistently use %pypi_name macro. +- Add global decription macro. + +* Fri Feb 24 2017 Paul Whalen <pwhalen(a)redhat.com> 0.5.0-1 +- Initial packaging. diff --git a/sources b/sources index e69de29..44eafd8 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +SHA512 (v0.5.0.tar.gz) = 6c68d9bd08c84b29898b03c5252e9034303be259888f4c771c254726252a7581caa5b38a1342f66598ed4d20b3e8d90d071ab9bb8419247fdfe83211f84626b7 -- cgit v1.1
https://src.fedoraproject.org/cgit/pyjokes.git/commit/?h=f26&id=2cef3e5b880…
1
0
0
0
besser82 pushed to shogun (f26). "Add patch fixing race-condition when generating examples"
by notificationsï¼ fedoraproject.org
30 Apr '17
30 Apr '17
This commit already existed in another branch.
https://src.fedoraproject.org/cgit/shogun.git/commit/?h=f26&id=de3537026fc2…
1
0
0
0
besser82 pushed to shogun (f25). "Add patch fixing race-condition when generating examples"
by notificationsï¼ fedoraproject.org
30 Apr '17
30 Apr '17
From de3537026fc2b955bd187c8f784d1a3b2fb8d8ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82(a)fedoraproject.org> Date: Sun, 30 Apr 2017 18:32:50 +0200 Subject: Add patch fixing race-condition when generating examples --- shogun-6.0.0-do_not_fail_if_dir_exists.patch | 45 ++++++++++++++++++++++++++++ shogun.spec | 1 + 2 files changed, 46 insertions(+) create mode 100644 shogun-6.0.0-do_not_fail_if_dir_exists.patch diff --git a/shogun-6.0.0-do_not_fail_if_dir_exists.patch b/shogun-6.0.0-do_not_fail_if_dir_exists.patch new file mode 100644 index 0000000..e040f79 --- /dev/null +++ b/shogun-6.0.0-do_not_fail_if_dir_exists.patch @@ -0,0 +1,45 @@ +From c819a9b76bb64667c32e0f3b70e1cbba2234922d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82(a)fedoraproject.org> +Date: Sun, 30 Apr 2017 18:20:12 +0200 +Subject: [PATCH] Do not fail if dir exists + +--- + examples/meta/generator/generate.py | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +diff --git a/examples/meta/generator/generate.py b/examples/meta/generator/generate.py +index 908667b..4e30588 100755 +--- a/examples/meta/generator/generate.py ++++ b/examples/meta/generator/generate.py +@@ -88,8 +88,13 @@ def translateExamples(inputDir, outputDir, targetsDir, ctagsFile, + extension = target["FileExtension"] + + # Create directory if it does not exist +- if not os.path.exists(directory): +- os.makedirs(directory) ++ try: ++ os.makedirs(name=directory, exist_ok=True) ++ except: ++ try: ++ os.makedirs(directory) ++ except OSError: ++ pass + + # Write translation + outputFile = os.path.join(directory, +@@ -98,9 +103,12 @@ def translateExamples(inputDir, outputDir, targetsDir, ctagsFile, + + # create subdirectories if they don't exist yet + try: +- os.makedirs(os.path.dirname(outputFile)) +- except OSError: +- pass ++ os.makedirs(name=os.path.dirname(outputFile), exist_ok=True) ++ except: ++ try: ++ os.makedirs(os.path.dirname(outputFile)) ++ except OSError: ++ pass + + with open(outputFile, "w") as nf: + nf.write(translation) diff --git a/shogun.spec b/shogun.spec index 4b815e9..48817a6 100644 --- a/shogun.spec +++ b/shogun.spec @@ -159,6 +159,7 @@ Patch0: %{?giturl}/commit/ffb80ca135ff5686e102d285df47ce0fc92f53b6.patch#/shogu Patch1: %{?giturl}/commit/6d960649921e65dea4d988448579564175a4ca59.patch#/shogun-6.0.0-fix_python_modular_tests.patch Patch2: %{?giturl}/commit/3e9e98e508285d989b21629e7c8f872a00e34e4a.patch#/shogun-6.0.0-fix_python_modular_examples.patch Patch3: %{?giturl}/commit/308f9245ad81999a8e046b9ad8c3167ffa904f2e.patch#/shogun-6.0.0-fix_find_Scala.patch +Patch4: %{?giturl}/pull/3806.patch#/shogun-6.0.0-do_not_fail_if_dir_exists.patch BuildRequires: arpack-devel BuildRequires: arprec-devel -- cgit v1.1
https://src.fedoraproject.org/cgit/shogun.git/commit/?h=f25&id=de3537026fc2…
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
1405
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
Results per page:
10
25
50
100
200