diff --git a/.gitignore b/.gitignore index 7e468c1..5ed2f0e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -SOURCES/aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u191-b12.tar.xz +SOURCES/aarch64-port-jdk8u-aarch64-jdk8u181-b13.tar.xz +SOURCES/aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u181-b13.tar.xz SOURCES/systemtap-tapset-3.6.0pre02.tar.xz diff --git a/.java-1.8.0-openjdk.metadata b/.java-1.8.0-openjdk.metadata index 535140f..02f3ed9 100644 --- a/.java-1.8.0-openjdk.metadata +++ b/.java-1.8.0-openjdk.metadata @@ -1,2 +1,3 @@ -e197cf1d4caa32e21c54e5d625d642b12909ee2c SOURCES/aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u191-b12.tar.xz +68194807c61d6b6a6bfbda6a9b5cd56a8e63ad8b SOURCES/aarch64-port-jdk8u-aarch64-jdk8u181-b13.tar.xz +174fc5d1c647f3846ca6e1e0ab08e287db5c47cc SOURCES/aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u181-b13.tar.xz 93bca27ce5eeeb2bc1f6f3cd4ffe34c3567a3c73 SOURCES/systemtap-tapset-3.6.0pre02.tar.xz diff --git a/SOURCES/8062808-pr3548.patch b/SOURCES/8062808-pr3548.patch new file mode 100644 index 0000000..e91abd3 --- /dev/null +++ b/SOURCES/8062808-pr3548.patch @@ -0,0 +1,191 @@ +# HG changeset patch +# User stefank +# Date 1525453613 -3600 +# Fri May 04 18:06:53 2018 +0100 +# Node ID 07a1135a327362f157955d470fad5df07cc35164 +# Parent de79964656fc652f2085dac4fe99bcc128b5a3b1 +8062808, PR3548: Turn on the -Wreturn-type warning +Reviewed-by: mgerdin, tschatzl, coleenp, jrose, kbarrett + +diff --git openjdk.orig/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make +--- openjdk.orig/hotspot/make/linux/makefiles/gcc.make ++++ openjdk/hotspot/make/linux/makefiles/gcc.make +@@ -210,7 +210,7 @@ + WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body + endif + +-WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value ++WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wreturn-type + + ifeq ($(USE_CLANG),) + # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit +diff --git openjdk.orig/hotspot/src/cpu/x86/vm/x86_32.ad openjdk/hotspot/src/cpu/x86/vm/x86_32.ad +--- openjdk.orig/hotspot/src/cpu/x86/vm/x86_32.ad ++++ openjdk/hotspot/src/cpu/x86/vm/x86_32.ad +@@ -1250,6 +1250,7 @@ + + + Unimplemented(); ++ return 0; // Mute compiler + } + + #ifndef PRODUCT +diff --git openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp +--- openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp ++++ openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp +@@ -541,6 +541,7 @@ + err.report_and_die(); + + ShouldNotReachHere(); ++ return true; // Mute compiler + } + + void os::Linux::init_thread_fpu_state(void) { +diff --git openjdk.orig/hotspot/src/share/vm/classfile/defaultMethods.cpp openjdk/hotspot/src/share/vm/classfile/defaultMethods.cpp +--- openjdk.orig/hotspot/src/share/vm/classfile/defaultMethods.cpp ++++ openjdk/hotspot/src/share/vm/classfile/defaultMethods.cpp +@@ -506,7 +506,7 @@ + ss.write((const char*)name->bytes(), name->utf8_length()); + ss.write((const char*)signature->bytes(), signature->utf8_length()); + ss.print(" is abstract"); +- return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL); ++ return SymbolTable::new_symbol(ss.base(), (int)ss.size(), THREAD); + } + + Symbol* MethodFamily::generate_conflicts_message(GrowableArray* methods, TRAPS) const { +@@ -521,7 +521,7 @@ + ss.print("."); + ss.write((const char*)name->bytes(), name->utf8_length()); + } +- return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL); ++ return SymbolTable::new_symbol(ss.base(), (int)ss.size(), THREAD); + } + + +diff --git openjdk.orig/hotspot/src/share/vm/classfile/symbolTable.cpp openjdk/hotspot/src/share/vm/classfile/symbolTable.cpp +--- openjdk.orig/hotspot/src/share/vm/classfile/symbolTable.cpp ++++ openjdk/hotspot/src/share/vm/classfile/symbolTable.cpp +@@ -249,7 +249,7 @@ + MutexLocker ml(SymbolTable_lock, THREAD); + + // Otherwise, add to symbol to table +- return the_table()->basic_add(index, (u1*)name, len, hashValue, true, CHECK_NULL); ++ return the_table()->basic_add(index, (u1*)name, len, hashValue, true, THREAD); + } + + Symbol* SymbolTable::lookup(const Symbol* sym, int begin, int end, TRAPS) { +@@ -288,7 +288,7 @@ + // Grab SymbolTable_lock first. + MutexLocker ml(SymbolTable_lock, THREAD); + +- return the_table()->basic_add(index, (u1*)buffer, len, hashValue, true, CHECK_NULL); ++ return the_table()->basic_add(index, (u1*)buffer, len, hashValue, true, THREAD); + } + + Symbol* SymbolTable::lookup_only(const char* name, int len, +diff --git openjdk.orig/hotspot/src/share/vm/classfile/systemDictionary.cpp openjdk/hotspot/src/share/vm/classfile/systemDictionary.cpp +--- openjdk.orig/hotspot/src/share/vm/classfile/systemDictionary.cpp ++++ openjdk/hotspot/src/share/vm/classfile/systemDictionary.cpp +@@ -229,15 +229,15 @@ + class_name->as_C_string(), + class_loader.is_null() ? "null" : class_loader->klass()->name()->as_C_string())); + if (FieldType::is_array(class_name)) { +- return resolve_array_class_or_null(class_name, class_loader, protection_domain, CHECK_NULL); ++ return resolve_array_class_or_null(class_name, class_loader, protection_domain, THREAD); + } else if (FieldType::is_obj(class_name)) { + ResourceMark rm(THREAD); + // Ignore wrapping L and ;. + TempNewSymbol name = SymbolTable::new_symbol(class_name->as_C_string() + 1, + class_name->utf8_length() - 2, CHECK_NULL); +- return resolve_instance_class_or_null(name, class_loader, protection_domain, CHECK_NULL); ++ return resolve_instance_class_or_null(name, class_loader, protection_domain, THREAD); + } else { +- return resolve_instance_class_or_null(class_name, class_loader, protection_domain, CHECK_NULL); ++ return resolve_instance_class_or_null(class_name, class_loader, protection_domain, THREAD); + } + } + +diff --git openjdk.orig/hotspot/src/share/vm/memory/heapInspection.hpp openjdk/hotspot/src/share/vm/memory/heapInspection.hpp +--- openjdk.orig/hotspot/src/share/vm/memory/heapInspection.hpp ++++ openjdk/hotspot/src/share/vm/memory/heapInspection.hpp +@@ -367,7 +367,7 @@ + _csv_format(csv_format), _print_help(print_help), + _print_class_stats(print_class_stats), _columns(columns) {} + void heap_inspection(outputStream* st) NOT_SERVICES_RETURN; +- size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL) NOT_SERVICES_RETURN; ++ size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL) NOT_SERVICES_RETURN_(0); + static void find_instances_at_safepoint(Klass* k, GrowableArray* result) NOT_SERVICES_RETURN; + private: + void iterate_over_heap(KlassInfoTable* cit, BoolObjectClosure* filter = NULL); +diff --git openjdk.orig/hotspot/src/share/vm/memory/metaspaceShared.hpp openjdk/hotspot/src/share/vm/memory/metaspaceShared.hpp +--- openjdk.orig/hotspot/src/share/vm/memory/metaspaceShared.hpp ++++ openjdk/hotspot/src/share/vm/memory/metaspaceShared.hpp +@@ -93,7 +93,7 @@ + static void preload_and_dump(TRAPS) NOT_CDS_RETURN; + static int preload_and_dump(const char * class_list_path, + GrowableArray* class_promote_order, +- TRAPS) NOT_CDS_RETURN; ++ TRAPS) NOT_CDS_RETURN_(0); + + static ReservedSpace* shared_rs() { + CDS_ONLY(return _shared_rs); +diff --git openjdk.orig/hotspot/src/share/vm/oops/constantPool.hpp openjdk/hotspot/src/share/vm/oops/constantPool.hpp +--- openjdk.orig/hotspot/src/share/vm/oops/constantPool.hpp ++++ openjdk/hotspot/src/share/vm/oops/constantPool.hpp +@@ -352,7 +352,7 @@ + + Klass* klass_at(int which, TRAPS) { + constantPoolHandle h_this(THREAD, this); +- return klass_at_impl(h_this, which, CHECK_NULL); ++ return klass_at_impl(h_this, which, THREAD); + } + + Symbol* klass_name_at(int which); // Returns the name, w/o resolving. +diff --git openjdk.orig/hotspot/src/share/vm/prims/jvm.cpp openjdk/hotspot/src/share/vm/prims/jvm.cpp +--- openjdk.orig/hotspot/src/share/vm/prims/jvm.cpp ++++ openjdk/hotspot/src/share/vm/prims/jvm.cpp +@@ -4244,7 +4244,7 @@ + JVM_DTraceProvider* providers)) + JVMWrapper("JVM_DTraceActivate"); + return DTraceJSDT::activate( +- version, module_name, providers_count, providers, CHECK_0); ++ version, module_name, providers_count, providers, THREAD); + JVM_END + + JVM_ENTRY(jboolean,JVM_DTraceIsProbeEnabled(JNIEnv* env, jmethodID method)) +diff --git openjdk.orig/hotspot/src/share/vm/runtime/reflection.cpp openjdk/hotspot/src/share/vm/runtime/reflection.cpp +--- openjdk.orig/hotspot/src/share/vm/runtime/reflection.cpp ++++ openjdk/hotspot/src/share/vm/runtime/reflection.cpp +@@ -1093,7 +1093,7 @@ + } else { + if (rtype == T_BOOLEAN || rtype == T_BYTE || rtype == T_CHAR || rtype == T_SHORT) + narrow((jvalue*) result.get_value_addr(), rtype, CHECK_NULL); +- return box((jvalue*) result.get_value_addr(), rtype, CHECK_NULL); ++ return box((jvalue*) result.get_value_addr(), rtype, THREAD); + } + } + +diff --git openjdk.orig/hotspot/src/share/vm/runtime/sharedRuntime.cpp openjdk/hotspot/src/share/vm/runtime/sharedRuntime.cpp +--- openjdk.orig/hotspot/src/share/vm/runtime/sharedRuntime.cpp ++++ openjdk/hotspot/src/share/vm/runtime/sharedRuntime.cpp +@@ -1046,7 +1046,7 @@ + // last java frame on stack (which includes native call frames) + vframeStream vfst(thread, true); // Do not skip and javaCalls + +- return find_callee_info_helper(thread, vfst, bc, callinfo, CHECK_(Handle())); ++ return find_callee_info_helper(thread, vfst, bc, callinfo, THREAD); + } + + +diff --git openjdk.orig/hotspot/src/share/vm/services/memTracker.hpp openjdk/hotspot/src/share/vm/services/memTracker.hpp +--- openjdk.orig/hotspot/src/share/vm/services/memTracker.hpp ++++ openjdk/hotspot/src/share/vm/services/memTracker.hpp +@@ -64,7 +64,7 @@ + const NativeCallStack& stack, MEMFLAGS flag = mtNone) { } + static inline void record_virtual_memory_commit(void* addr, size_t size, const NativeCallStack& stack) { } + static inline Tracker get_virtual_memory_uncommit_tracker() { return Tracker(); } +- static inline Tracker get_virtual_memory_release_tracker() { } ++ static inline Tracker get_virtual_memory_release_tracker() { return Tracker(); } + static inline void record_virtual_memory_type(void* addr, MEMFLAGS flag) { } + static inline void record_thread_stack(void* addr, size_t size) { } + static inline void release_thread_stack(void* addr, size_t size) { } diff --git a/SOURCES/8064786-pr3599.patch b/SOURCES/8064786-pr3599.patch new file mode 100644 index 0000000..790ee0d --- /dev/null +++ b/SOURCES/8064786-pr3599.patch @@ -0,0 +1,28 @@ +# HG changeset patch +# User goetz +# Date 1415873641 -3600 +# Thu Nov 13 11:14:01 2014 +0100 +# Node ID 1878c4c1d04e1f3c6f67a19d36c35863d6b5f906 +# Parent 533473c67de6ff767710594639033c8e83523fe5 +8064786, PR3599: Fix debug build after 8062808: Turn on the -Wreturn-type warning +Reviewed-by: stefank, tschatzl + +diff --git openjdk.orig/hotspot/src/share/vm/prims/jni.cpp openjdk/hotspot/src/share/vm/prims/jni.cpp +--- openjdk.orig/hotspot/src/share/vm/prims/jni.cpp ++++ openjdk/hotspot/src/share/vm/prims/jni.cpp +@@ -708,6 +708,7 @@ + + THROW_OOP_(JNIHandles::resolve(obj), JNI_OK); + ShouldNotReachHere(); ++ return 0; // Mute compiler. + JNI_END + + #ifndef USDT2 +@@ -734,6 +735,7 @@ + Handle protection_domain (THREAD, k->protection_domain()); + THROW_MSG_LOADER_(name, (char *)message, class_loader, protection_domain, JNI_OK); + ShouldNotReachHere(); ++ return 0; // Mute compiler. + JNI_END + + diff --git a/SOURCES/8075942-pr3602-rh1582032.patch b/SOURCES/8075942-pr3602-rh1582032.patch new file mode 100644 index 0000000..bd2a40e --- /dev/null +++ b/SOURCES/8075942-pr3602-rh1582032.patch @@ -0,0 +1,95 @@ +# HG changeset patch +# User prr +# Date 1429299166 25200 +# Fri Apr 17 12:32:46 2015 -0700 +# Node ID 1f4b038b9550afaf88a70cee4cf9c1422ecd86d6 +# Parent 533117ae5b7587c8d9c0612581682ab984475430 +8075942, PR3602: ArrayIndexOutOfBoundsException in sun.java2d.pisces.Dasher.goTo +Reviewed-by: flar, lbourges + +diff --git openjdk.orig/jdk/src/share/classes/sun/java2d/pisces/Dasher.java openjdk/jdk/src/share/classes/sun/java2d/pisces/Dasher.java +--- openjdk.orig/jdk/src/share/classes/sun/java2d/pisces/Dasher.java ++++ openjdk/jdk/src/share/classes/sun/java2d/pisces/Dasher.java +@@ -146,7 +146,7 @@ + if (dashOn) { + if (starting) { + firstSegmentsBuffer = Helpers.widenArray(firstSegmentsBuffer, +- firstSegidx, type - 2); ++ firstSegidx, type - 2 + 1); + firstSegmentsBuffer[firstSegidx++] = type; + System.arraycopy(pts, off, firstSegmentsBuffer, firstSegidx, type - 2); + firstSegidx += type - 2; +diff --git a/test/javopenjdk.orig/jdk/awt/BasicStroke/DashStrokeTest.java openjdk/jdk/test/java/awt/BasicStroke/DashStrokeTest.java +new file mode 100644 +--- /dev/null ++++ openjdk/jdk/test/java/awt/BasicStroke/DashStrokeTest.java +@@ -0,0 +1,69 @@ ++/* ++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ * @test ++ * @bug 8075942 ++ * @summary test there is no exception rendering a dashed stroke ++ * @run DashStrokeTest ++ * @run -Dsun.java2d.renderer=sun.java2d.pisces.PiscesRenderingEngine ++ */ ++ ++import java.awt.BasicStroke; ++import java.awt.Color; ++import java.awt.Graphics2D; ++import java.awt.Stroke; ++import java.awt.geom.GeneralPath; ++import java.awt.image.BufferedImage; ++ ++ ++public class DashStrokeTest { ++ ++ public static void main(String[] args) { ++ ++ GeneralPath shape = new GeneralPath(); ++ int[] pointTypes = {0, 0, 1, 1, 0, 1, 1, 0}; ++ double[] xpoints = {428, 420, 400, 400, 400, 400, 420, 733}; ++ double[] ypoints = {180, 180, 180, 160, 30, 10, 10, 10}; ++ shape.moveTo(xpoints[0], ypoints[0]); ++ for (int i = 1; i < pointTypes.length; i++) { ++ if (pointTypes[i] == 1 && i < pointTypes.length - 1) { ++ shape.quadTo(xpoints[i], ypoints[i], ++ xpoints[i + 1], ypoints[i + 1]); ++ } else { ++ shape.lineTo(xpoints[i], ypoints[i]); ++ } ++ } ++ ++ BufferedImage image = new ++ BufferedImage(1000, 1000, BufferedImage.TYPE_INT_ARGB); ++ Graphics2D g2 = image.createGraphics(); ++ ++ Color color = new Color(124, 0, 124, 255); ++ g2.setColor(color); ++ Stroke stroke = new BasicStroke(1.0f, ++ BasicStroke.CAP_BUTT, ++ BasicStroke.JOIN_BEVEL, ++ 10.0f, new float[] {9, 6}, 0.0f); ++ g2.setStroke(stroke); ++ g2.draw(shape); ++ } ++} diff --git a/SOURCES/8141570-pr3548.patch b/SOURCES/8141570-pr3548.patch new file mode 100644 index 0000000..f1e3215 --- /dev/null +++ b/SOURCES/8141570-pr3548.patch @@ -0,0 +1,55 @@ +# HG changeset patch +# User coleenp +# Date 1525713256 -3600 +# Mon May 07 18:14:16 2018 +0100 +# Node ID bcbc64dfb629c5f188bbf59b8f986ad95963ed60 +# Parent 07a1135a327362f157955d470fad5df07cc35164 +8141570, PR3548: Fix Zero interpreter build for --disable-precompiled-headers +Summary: change to include atomic.inline.hpp and allocation.inline.hpp only in .cpp files and some build fixes from Kim to build on ubuntu without devkits +Reviewed-by: kbarrett, sgehwolf, erikj + +diff --git openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make openjdk/hotspot/make/linux/makefiles/zeroshark.make +--- openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make ++++ openjdk/hotspot/make/linux/makefiles/zeroshark.make +@@ -1,5 +1,5 @@ + # +-# Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. ++# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + # Copyright 2007, 2008 Red Hat, Inc. + # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + # +@@ -25,8 +25,15 @@ + + # Setup common to Zero (non-Shark) and Shark versions of VM + +-# override this from the main file because some version of llvm do not like -Wundef +-WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wunused-function -Wunused-value ++# Some versions of llvm do not like -Wundef ++ifeq ($(USE_CLANG), true) ++ WARNING_FLAGS += -Wno-undef ++endif ++# Suppress some warning flags that are normally turned on for hotspot, ++# because some of the zero code has not been updated accordingly. ++WARNING_FLAGS += -Wno-return-type \ ++ -Wno-format-nonliteral -Wno-format-security \ ++ -Wno-maybe-uninitialized + + # The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) +@@ -42,5 +49,3 @@ + ifeq ($(ARCH_DATA_MODEL), 64) + CFLAGS += -D_LP64=1 + endif +- +-OPT_CFLAGS/compactingPermGenGen.o = -O1 +diff --git openjdk.orig/hotspot/src/share/vm/runtime/java.cpp openjdk/hotspot/src/share/vm/runtime/java.cpp +--- openjdk.orig/hotspot/src/share/vm/runtime/java.cpp ++++ openjdk/hotspot/src/share/vm/runtime/java.cpp +@@ -45,6 +45,7 @@ + #include "runtime/arguments.hpp" + #include "runtime/biasedLocking.hpp" + #include "runtime/compilationPolicy.hpp" ++#include "runtime/deoptimization.hpp" + #include "runtime/fprofiler.hpp" + #include "runtime/init.hpp" + #include "runtime/interfaceSupport.hpp" diff --git a/SOURCES/8143245-pr3548.patch b/SOURCES/8143245-pr3548.patch new file mode 100644 index 0000000..eccb110 --- /dev/null +++ b/SOURCES/8143245-pr3548.patch @@ -0,0 +1,154 @@ +# HG changeset patch +# User sgehwolf +# Date 1525714161 -3600 +# Mon May 07 18:29:21 2018 +0100 +# Node ID afb31413c73cbc06420fdb447aa90a7a38258904 +# Parent bcbc64dfb629c5f188bbf59b8f986ad95963ed60 +8143245, PR3548: Zero build requires disabled warnings +Reviewed-by: dholmes, coleenp + +diff --git openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make openjdk/hotspot/make/linux/makefiles/zeroshark.make +--- openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make ++++ openjdk/hotspot/make/linux/makefiles/zeroshark.make +@@ -1,5 +1,5 @@ + # +-# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. ++# Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + # Copyright 2007, 2008 Red Hat, Inc. + # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + # +@@ -29,11 +29,6 @@ + ifeq ($(USE_CLANG), true) + WARNING_FLAGS += -Wno-undef + endif +-# Suppress some warning flags that are normally turned on for hotspot, +-# because some of the zero code has not been updated accordingly. +-WARNING_FLAGS += -Wno-return-type \ +- -Wno-format-nonliteral -Wno-format-security \ +- -Wno-maybe-uninitialized + + # The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized + OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) +diff --git openjdk.orig/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp openjdk/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp +--- openjdk.orig/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp ++++ openjdk/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp +@@ -100,7 +100,7 @@ + case T_DOUBLE: + case T_VOID: + return result; +- default : ShouldNotReachHere(); ++ default : ShouldNotReachHere(); return NULL_WORD; + } + } + +diff --git openjdk.orig/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp openjdk/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp +--- openjdk.orig/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp ++++ openjdk/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright 2007, 2008, 2010 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * +@@ -62,7 +62,7 @@ + } + + void InterpreterRuntime::SignatureHandlerGeneratorBase::push(BasicType type) { +- ffi_type *ftype; ++ ffi_type *ftype = NULL; + switch (type) { + case T_VOID: + ftype = &ffi_type_void; +diff --git openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp +--- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp ++++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp +@@ -1,6 +1,6 @@ + /* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. +- * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. ++ * Copyright 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 +@@ -61,6 +61,7 @@ + + frame os::get_sender_for_C_frame(frame* fr) { + ShouldNotCallThis(); ++ return frame(NULL, NULL); // silence compile warning. + } + + frame os::current_frame() { +@@ -98,16 +99,19 @@ + + address os::Linux::ucontext_get_pc(ucontext_t* uc) { + ShouldNotCallThis(); ++ return NULL; // silence compile warnings + } + + ExtendedPC os::fetch_frame_from_context(void* ucVoid, + intptr_t** ret_sp, + intptr_t** ret_fp) { + ShouldNotCallThis(); ++ return NULL; // silence compile warnings + } + + frame os::fetch_frame_from_context(void* ucVoid) { + ShouldNotCallThis(); ++ return frame(NULL, NULL); // silence compile warnings + } + + extern "C" JNIEXPORT int +@@ -247,11 +251,16 @@ + } + #endif // !PRODUCT + +- const char *fmt = "caught unhandled signal %d"; + char buf[64]; + +- sprintf(buf, fmt, sig); ++ sprintf(buf, "caught unhandled signal %d", sig); ++ ++// Silence -Wformat-security warning for fatal() ++PRAGMA_DIAG_PUSH ++PRAGMA_FORMAT_NONLITERAL_IGNORED + fatal(buf); ++PRAGMA_DIAG_POP ++ return true; // silence compiler warnings + } + + void os::Linux::init_thread_fpu_state(void) { +@@ -260,6 +269,7 @@ + + int os::Linux::get_fpu_control_word() { + ShouldNotCallThis(); ++ return -1; // silence compile warnings + } + + void os::Linux::set_fpu_control_word(int fpu) { +@@ -408,6 +418,7 @@ + + extern "C" { + int SpinPause() { ++ return -1; // silence compile warnings + } + + +diff --git openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp openjdk/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp +--- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp ++++ openjdk/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * +@@ -110,6 +110,7 @@ + void* ucontext, + bool isInJava) { + ShouldNotCallThis(); ++ return false; // silence compile warning + } + + // These routines are only used on cpu architectures that diff --git a/SOURCES/8146115-pr3508-rh1463098.patch b/SOURCES/8146115-pr3508-rh1463098.patch new file mode 100644 index 0000000..a04728b --- /dev/null +++ b/SOURCES/8146115-pr3508-rh1463098.patch @@ -0,0 +1,1494 @@ +# HG changeset patch +# User poonam +# Date 1530903013 0 +# Fri Jul 06 18:50:13 2018 +0000 +# Node ID 2f2d2af6fa5c44e67e0a9987f56392315a1e4b64 +# Parent 95b72537801cc9946c27ad27f07e3f0790a21b08 +8146115, PR3508, RH1463098: Improve docker container detection and resource configuration usage +Reviewed-by: bobv, dbuck + +diff --git openjdk.orig/hotspot/src/os/aix/vm/os_aix.cpp openjdk/hotspot/src/os/aix/vm/os_aix.cpp +--- openjdk.orig/hotspot/src/os/aix/vm/os_aix.cpp ++++ openjdk/hotspot/src/os/aix/vm/os_aix.cpp +@@ -4008,6 +4008,16 @@ + }; + + int os::active_processor_count() { ++ // User has overridden the number of active processors ++ if (ActiveProcessorCount > 0) { ++ if (PrintActiveCpus) { ++ tty->print_cr("active_processor_count: " ++ "active processor count set by user : %d", ++ ActiveProcessorCount); ++ } ++ return ActiveProcessorCount; ++ } ++ + int online_cpus = ::sysconf(_SC_NPROCESSORS_ONLN); + assert(online_cpus > 0 && online_cpus <= processor_count(), "sanity check"); + return online_cpus; +diff --git openjdk.orig/hotspot/src/os/bsd/vm/os_bsd.cpp openjdk/hotspot/src/os/bsd/vm/os_bsd.cpp +--- openjdk.orig/hotspot/src/os/bsd/vm/os_bsd.cpp ++++ openjdk/hotspot/src/os/bsd/vm/os_bsd.cpp +@@ -3770,6 +3770,16 @@ + }; + + int os::active_processor_count() { ++ // User has overridden the number of active processors ++ if (ActiveProcessorCount > 0) { ++ if (PrintActiveCpus) { ++ tty->print_cr("active_processor_count: " ++ "active processor count set by user : %d", ++ ActiveProcessorCount); ++ } ++ return ActiveProcessorCount; ++ } ++ + return _processor_count; + } + +diff --git openjdk.orig/hotspot/src/os/linux/vm/globals_linux.hpp openjdk/hotspot/src/os/linux/vm/globals_linux.hpp +--- openjdk.orig/hotspot/src/os/linux/vm/globals_linux.hpp ++++ openjdk/hotspot/src/os/linux/vm/globals_linux.hpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -49,8 +49,13 @@ + product(bool, UseSHM, false, \ + "Use SYSV shared memory for large pages") \ + \ +- diagnostic(bool, PrintActiveCpus, false, \ +- "Print the number of CPUs detected in os::active_processor_count") ++ product(bool, UseContainerSupport, true, \ ++ "Enable detection and runtime container configuration support") \ ++ \ ++ product(bool, PreferContainerQuotaForCPUCount, true, \ ++ "Calculate the container CPU availability based on the value" \ ++ " of quotas (if set), when true. Otherwise, use the CPU" \ ++ " shares value, provided it is less than quota.") + + // + // Defines Linux-specific default values. The flags are available on all +diff --git openjdk.orig/hotspot/src/os/linux/vm/osContainer_linux.cpp openjdk/hotspot/src/os/linux/vm/osContainer_linux.cpp +new file mode 100644 +--- /dev/null ++++ openjdk/hotspot/src/os/linux/vm/osContainer_linux.cpp +@@ -0,0 +1,680 @@ ++/* ++ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#include ++#include ++#include ++#include "utilities/globalDefinitions.hpp" ++#include "memory/allocation.hpp" ++#include "runtime/os.hpp" ++#include "osContainer_linux.hpp" ++ ++#define PER_CPU_SHARES 1024 ++ ++bool OSContainer::_is_initialized = false; ++bool OSContainer::_is_containerized = false; ++julong _unlimited_memory; ++ ++class CgroupSubsystem: CHeapObj { ++ friend class OSContainer; ++ ++ private: ++ /* mountinfo contents */ ++ char *_root; ++ char *_mount_point; ++ ++ /* Constructed subsystem directory */ ++ char *_path; ++ ++ public: ++ CgroupSubsystem(char *root, char *mountpoint) { ++ _root = os::strdup(root); ++ _mount_point = os::strdup(mountpoint); ++ _path = NULL; ++ } ++ ++ /* ++ * Set directory to subsystem specific files based ++ * on the contents of the mountinfo and cgroup files. ++ */ ++ void set_subsystem_path(char *cgroup_path) { ++ char buf[MAXPATHLEN+1]; ++ if (_root != NULL && cgroup_path != NULL) { ++ if (strcmp(_root, "/") == 0) { ++ int buflen; ++ strncpy(buf, _mount_point, MAXPATHLEN); ++ buf[MAXPATHLEN-1] = '\0'; ++ if (strcmp(cgroup_path,"/") != 0) { ++ buflen = strlen(buf); ++ if ((buflen + strlen(cgroup_path)) > (MAXPATHLEN-1)) { ++ return; ++ } ++ strncat(buf, cgroup_path, MAXPATHLEN-buflen); ++ buf[MAXPATHLEN-1] = '\0'; ++ } ++ _path = os::strdup(buf); ++ } else { ++ if (strcmp(_root, cgroup_path) == 0) { ++ strncpy(buf, _mount_point, MAXPATHLEN); ++ buf[MAXPATHLEN-1] = '\0'; ++ _path = os::strdup(buf); ++ } else { ++ char *p = strstr(_root, cgroup_path); ++ if (p != NULL && p == _root) { ++ if (strlen(cgroup_path) > strlen(_root)) { ++ int buflen; ++ strncpy(buf, _mount_point, MAXPATHLEN); ++ buf[MAXPATHLEN-1] = '\0'; ++ buflen = strlen(buf); ++ if ((buflen + strlen(cgroup_path)) > (MAXPATHLEN-1)) { ++ return; ++ } ++ strncat(buf, cgroup_path + strlen(_root), MAXPATHLEN-buflen); ++ buf[MAXPATHLEN-1] = '\0'; ++ _path = os::strdup(buf); ++ } ++ } ++ } ++ } ++ } ++ } ++ ++ char *subsystem_path() { return _path; } ++}; ++ ++CgroupSubsystem* memory = NULL; ++CgroupSubsystem* cpuset = NULL; ++CgroupSubsystem* cpu = NULL; ++CgroupSubsystem* cpuacct = NULL; ++ ++typedef char * cptr; ++ ++PRAGMA_DIAG_PUSH ++PRAGMA_FORMAT_NONLITERAL_IGNORED ++template int subsystem_file_contents(CgroupSubsystem* c, ++ const char *filename, ++ const char *scan_fmt, ++ T returnval) { ++ FILE *fp = NULL; ++ char *p; ++ char file[MAXPATHLEN+1]; ++ char buf[MAXPATHLEN+1]; ++ ++ if (c == NULL) { ++ if (PrintContainerInfo) { ++ tty->print_cr("subsystem_file_contents: CgroupSubsytem* is NULL"); ++ } ++ return OSCONTAINER_ERROR; ++ } ++ if (c->subsystem_path() == NULL) { ++ if (PrintContainerInfo) { ++ tty->print_cr("subsystem_file_contents: subsystem path is NULL"); ++ } ++ return OSCONTAINER_ERROR; ++ } ++ ++ strncpy(file, c->subsystem_path(), MAXPATHLEN); ++ file[MAXPATHLEN-1] = '\0'; ++ int filelen = strlen(file); ++ if ((filelen + strlen(filename)) > (MAXPATHLEN-1)) { ++ if (PrintContainerInfo) { ++ tty->print_cr("File path too long %s, %s", file, filename); ++ } ++ return OSCONTAINER_ERROR; ++ } ++ strncat(file, filename, MAXPATHLEN-filelen); ++ if (PrintContainerInfo) { ++ tty->print_cr("Path to %s is %s", filename, file); ++ } ++ fp = fopen(file, "r"); ++ if (fp != NULL) { ++ p = fgets(buf, MAXPATHLEN, fp); ++ if (p != NULL) { ++ int matched = sscanf(p, scan_fmt, returnval); ++ if (matched == 1) { ++ fclose(fp); ++ return 0; ++ } else { ++ if (PrintContainerInfo) { ++ tty->print_cr("Type %s not found in file %s", scan_fmt, file); ++ } ++ } ++ } else { ++ if (PrintContainerInfo) { ++ tty->print_cr("Empty file %s", file); ++ } ++ } ++ } else { ++ if (PrintContainerInfo) { ++ tty->print_cr("Open of file %s failed, %s", file, strerror(errno)); ++ } ++ } ++ if (fp != NULL) ++ fclose(fp); ++ return OSCONTAINER_ERROR; ++} ++PRAGMA_DIAG_POP ++ ++#define GET_CONTAINER_INFO(return_type, subsystem, filename, \ ++ logstring, scan_fmt, variable) \ ++ return_type variable; \ ++{ \ ++ int err; \ ++ err = subsystem_file_contents(subsystem, \ ++ filename, \ ++ scan_fmt, \ ++ &variable); \ ++ if (err != 0) \ ++ return (return_type) OSCONTAINER_ERROR; \ ++ \ ++ if (PrintContainerInfo) \ ++ tty->print_cr(logstring, variable); \ ++} ++ ++#define GET_CONTAINER_INFO_CPTR(return_type, subsystem, filename, \ ++ logstring, scan_fmt, variable, bufsize) \ ++ char variable[bufsize]; \ ++{ \ ++ int err; \ ++ err = subsystem_file_contents(subsystem, \ ++ filename, \ ++ scan_fmt, \ ++ variable); \ ++ if (err != 0) \ ++ return (return_type) NULL; \ ++ \ ++ if (PrintContainerInfo) \ ++ tty->print_cr(logstring, variable); \ ++} ++ ++/* init ++ * ++ * Initialize the container support and determine if ++ * we are running under cgroup control. ++ */ ++void OSContainer::init() { ++ int mountid; ++ int parentid; ++ int major; ++ int minor; ++ FILE *mntinfo = NULL; ++ FILE *cgroup = NULL; ++ char buf[MAXPATHLEN+1]; ++ char tmproot[MAXPATHLEN+1]; ++ char tmpmount[MAXPATHLEN+1]; ++ char tmpbase[MAXPATHLEN+1]; ++ char *p; ++ jlong mem_limit; ++ ++ assert(!_is_initialized, "Initializing OSContainer more than once"); ++ ++ _is_initialized = true; ++ _is_containerized = false; ++ ++ _unlimited_memory = (LONG_MAX / os::vm_page_size()) * os::vm_page_size(); ++ ++ if (PrintContainerInfo) { ++ tty->print_cr("OSContainer::init: Initializing Container Support"); ++ } ++ if (!UseContainerSupport) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Container Support not enabled"); ++ } ++ return; ++ } ++ ++ /* ++ * Find the cgroup mount point for memory and cpuset ++ * by reading /proc/self/mountinfo ++ * ++ * Example for docker: ++ * 219 214 0:29 /docker/7208cebd00fa5f2e342b1094f7bed87fa25661471a4637118e65f1c995be8a34 /sys/fs/cgroup/memory ro,nosuid,nodev,noexec,relatime - cgroup cgroup rw,memory ++ * ++ * Example for host: ++ * 34 28 0:29 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime shared:16 - cgroup cgroup rw,memory ++ */ ++ mntinfo = fopen("/proc/self/mountinfo", "r"); ++ if (mntinfo == NULL) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Can't open /proc/self/mountinfo, %s", ++ strerror(errno)); ++ } ++ return; ++ } ++ ++ while ( (p = fgets(buf, MAXPATHLEN, mntinfo)) != NULL) { ++ // Look for the filesystem type and see if it's cgroup ++ char fstype[MAXPATHLEN+1]; ++ fstype[0] = '\0'; ++ char *s = strstr(p, " - "); ++ if (s != NULL && ++ sscanf(s, " - %s", fstype) == 1 && ++ strcmp(fstype, "cgroup") == 0) { ++ ++ if (strstr(p, "memory") != NULL) { ++ int matched = sscanf(p, "%d %d %d:%d %s %s", ++ &mountid, ++ &parentid, ++ &major, ++ &minor, ++ tmproot, ++ tmpmount); ++ if (matched == 6) { ++ memory = new CgroupSubsystem(tmproot, tmpmount); ++ } ++ else ++ if (PrintContainerInfo) { ++ tty->print_cr("Incompatible str containing cgroup and memory: %s", p); ++ } ++ } else if (strstr(p, "cpuset") != NULL) { ++ int matched = sscanf(p, "%d %d %d:%d %s %s", ++ &mountid, ++ &parentid, ++ &major, ++ &minor, ++ tmproot, ++ tmpmount); ++ if (matched == 6) { ++ cpuset = new CgroupSubsystem(tmproot, tmpmount); ++ } ++ else { ++ if (PrintContainerInfo) { ++ tty->print_cr("Incompatible str containing cgroup and cpuset: %s", p); ++ } ++ } ++ } else if (strstr(p, "cpu,cpuacct") != NULL || strstr(p, "cpuacct,cpu") != NULL) { ++ int matched = sscanf(p, "%d %d %d:%d %s %s", ++ &mountid, ++ &parentid, ++ &major, ++ &minor, ++ tmproot, ++ tmpmount); ++ if (matched == 6) { ++ cpu = new CgroupSubsystem(tmproot, tmpmount); ++ cpuacct = new CgroupSubsystem(tmproot, tmpmount); ++ } ++ else { ++ if (PrintContainerInfo) { ++ tty->print_cr("Incompatible str containing cgroup and cpu,cpuacct: %s", p); ++ } ++ } ++ } else if (strstr(p, "cpuacct") != NULL) { ++ int matched = sscanf(p, "%d %d %d:%d %s %s", ++ &mountid, ++ &parentid, ++ &major, ++ &minor, ++ tmproot, ++ tmpmount); ++ if (matched == 6) { ++ cpuacct = new CgroupSubsystem(tmproot, tmpmount); ++ } ++ else { ++ if (PrintContainerInfo) { ++ tty->print_cr("Incompatible str containing cgroup and cpuacct: %s", p); ++ } ++ } ++ } else if (strstr(p, "cpu") != NULL) { ++ int matched = sscanf(p, "%d %d %d:%d %s %s", ++ &mountid, ++ &parentid, ++ &major, ++ &minor, ++ tmproot, ++ tmpmount); ++ if (matched == 6) { ++ cpu = new CgroupSubsystem(tmproot, tmpmount); ++ } ++ else { ++ if (PrintContainerInfo) { ++ tty->print_cr("Incompatible str containing cgroup and cpu: %s", p); ++ } ++ } ++ } ++ } ++ } ++ ++ fclose(mntinfo); ++ ++ if (memory == NULL) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Required cgroup memory subsystem not found"); ++ } ++ return; ++ } ++ if (cpuset == NULL) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Required cgroup cpuset subsystem not found"); ++ } ++ return; ++ } ++ if (cpu == NULL) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Required cgroup cpu subsystem not found"); ++ } ++ return; ++ } ++ if (cpuacct == NULL) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Required cgroup cpuacct subsystem not found"); ++ } ++ return; ++ } ++ ++ /* ++ * Read /proc/self/cgroup and map host mount point to ++ * local one via /proc/self/mountinfo content above ++ * ++ * Docker example: ++ * 5:memory:/docker/6558aed8fc662b194323ceab5b964f69cf36b3e8af877a14b80256e93aecb044 ++ * ++ * Host example: ++ * 5:memory:/user.slice ++ * ++ * Construct a path to the process specific memory and cpuset ++ * cgroup directory. ++ * ++ * For a container running under Docker from memory example above ++ * the paths would be: ++ * ++ * /sys/fs/cgroup/memory ++ * ++ * For a Host from memory example above the path would be: ++ * ++ * /sys/fs/cgroup/memory/user.slice ++ * ++ */ ++ cgroup = fopen("/proc/self/cgroup", "r"); ++ if (cgroup == NULL) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Can't open /proc/self/cgroup, %s", ++ strerror(errno)); ++ } ++ return; ++ } ++ ++ while ( (p = fgets(buf, MAXPATHLEN, cgroup)) != NULL) { ++ int cgno; ++ int matched; ++ char *controller; ++ char *base; ++ ++ /* Skip cgroup number */ ++ strsep(&p, ":"); ++ /* Get controller and base */ ++ controller = strsep(&p, ":"); ++ base = strsep(&p, "\n"); ++ ++ if (controller != NULL) { ++ if (strstr(controller, "memory") != NULL) { ++ memory->set_subsystem_path(base); ++ } else if (strstr(controller, "cpuset") != NULL) { ++ cpuset->set_subsystem_path(base); ++ } else if (strstr(controller, "cpu,cpuacct") != NULL || strstr(controller, "cpuacct,cpu") != NULL) { ++ cpu->set_subsystem_path(base); ++ cpuacct->set_subsystem_path(base); ++ } else if (strstr(controller, "cpuacct") != NULL) { ++ cpuacct->set_subsystem_path(base); ++ } else if (strstr(controller, "cpu") != NULL) { ++ cpu->set_subsystem_path(base); ++ } ++ } ++ } ++ ++ fclose(cgroup); ++ ++ // We need to update the amount of physical memory now that ++ // command line arguments have been processed. ++ if ((mem_limit = memory_limit_in_bytes()) > 0) { ++ os::Linux::set_physical_memory(mem_limit); ++ } ++ ++ _is_containerized = true; ++ ++} ++ ++const char * OSContainer::container_type() { ++ if (is_containerized()) { ++ return "cgroupv1"; ++ } else { ++ return NULL; ++ } ++} ++ ++ ++/* memory_limit_in_bytes ++ * ++ * Return the limit of available memory for this process. ++ * ++ * return: ++ * memory limit in bytes or ++ * -1 for unlimited ++ * OSCONTAINER_ERROR for not supported ++ */ ++jlong OSContainer::memory_limit_in_bytes() { ++ GET_CONTAINER_INFO(julong, memory, "/memory.limit_in_bytes", ++ "Memory Limit is: " JULONG_FORMAT, JULONG_FORMAT, memlimit); ++ ++ if (memlimit >= _unlimited_memory) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Memory Limit is: Unlimited"); ++ } ++ return (jlong)-1; ++ } ++ else { ++ return (jlong)memlimit; ++ } ++} ++ ++jlong OSContainer::memory_and_swap_limit_in_bytes() { ++ GET_CONTAINER_INFO(julong, memory, "/memory.memsw.limit_in_bytes", ++ "Memory and Swap Limit is: " JULONG_FORMAT, JULONG_FORMAT, memswlimit); ++ if (memswlimit >= _unlimited_memory) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Memory and Swap Limit is: Unlimited"); ++ } ++ return (jlong)-1; ++ } else { ++ return (jlong)memswlimit; ++ } ++} ++ ++jlong OSContainer::memory_soft_limit_in_bytes() { ++ GET_CONTAINER_INFO(julong, memory, "/memory.soft_limit_in_bytes", ++ "Memory Soft Limit is: " JULONG_FORMAT, JULONG_FORMAT, memsoftlimit); ++ if (memsoftlimit >= _unlimited_memory) { ++ if (PrintContainerInfo) { ++ tty->print_cr("Memory Soft Limit is: Unlimited"); ++ } ++ return (jlong)-1; ++ } else { ++ return (jlong)memsoftlimit; ++ } ++} ++ ++/* memory_usage_in_bytes ++ * ++ * Return the amount of used memory for this process. ++ * ++ * return: ++ * memory usage in bytes or ++ * -1 for unlimited ++ * OSCONTAINER_ERROR for not supported ++ */ ++jlong OSContainer::memory_usage_in_bytes() { ++ GET_CONTAINER_INFO(jlong, memory, "/memory.usage_in_bytes", ++ "Memory Usage is: " JLONG_FORMAT, JLONG_FORMAT, memusage); ++ return memusage; ++} ++ ++/* memory_max_usage_in_bytes ++ * ++ * Return the maximum amount of used memory for this process. ++ * ++ * return: ++ * max memory usage in bytes or ++ * OSCONTAINER_ERROR for not supported ++ */ ++jlong OSContainer::memory_max_usage_in_bytes() { ++ GET_CONTAINER_INFO(jlong, memory, "/memory.max_usage_in_bytes", ++ "Maximum Memory Usage is: " JLONG_FORMAT, JLONG_FORMAT, memmaxusage); ++ return memmaxusage; ++} ++ ++/* active_processor_count ++ * ++ * Calculate an appropriate number of active processors for the ++ * VM to use based on these three inputs. ++ * ++ * cpu affinity ++ * cgroup cpu quota & cpu period ++ * cgroup cpu shares ++ * ++ * Algorithm: ++ * ++ * Determine the number of available CPUs from sched_getaffinity ++ * ++ * If user specified a quota (quota != -1), calculate the number of ++ * required CPUs by dividing quota by period. ++ * ++ * If shares are in effect (shares != -1), calculate the number ++ * of CPUs required for the shares by dividing the share value ++ * by PER_CPU_SHARES. ++ * ++ * All results of division are rounded up to the next whole number. ++ * ++ * If neither shares or quotas have been specified, return the ++ * number of active processors in the system. ++ * ++ * If both shares and quotas have been specified, the results are ++ * based on the flag PreferContainerQuotaForCPUCount. If true, ++ * return the quota value. If false return the smallest value ++ * between shares or quotas. ++ * ++ * If shares and/or quotas have been specified, the resulting number ++ * returned will never exceed the number of active processors. ++ * ++ * return: ++ * number of CPUs ++ */ ++int OSContainer::active_processor_count() { ++ int quota_count = 0, share_count = 0; ++ int cpu_count, limit_count; ++ int result; ++ ++ cpu_count = limit_count = os::Linux::active_processor_count(); ++ int quota = cpu_quota(); ++ int period = cpu_period(); ++ int share = cpu_shares(); ++ ++ if (quota > -1 && period > 0) { ++ quota_count = ceilf((float)quota / (float)period); ++ if (PrintContainerInfo) { ++ tty->print_cr("CPU Quota count based on quota/period: %d", quota_count); ++ } ++ } ++ if (share > -1) { ++ share_count = ceilf((float)share / (float)PER_CPU_SHARES); ++ if (PrintContainerInfo) { ++ tty->print_cr("CPU Share count based on shares: %d", share_count); ++ } ++ } ++ ++ // If both shares and quotas are setup results depend ++ // on flag PreferContainerQuotaForCPUCount. ++ // If true, limit CPU count to quota ++ // If false, use minimum of shares and quotas ++ if (quota_count !=0 && share_count != 0) { ++ if (PreferContainerQuotaForCPUCount) { ++ limit_count = quota_count; ++ } else { ++ limit_count = MIN2(quota_count, share_count); ++ } ++ } else if (quota_count != 0) { ++ limit_count = quota_count; ++ } else if (share_count != 0) { ++ limit_count = share_count; ++ } ++ ++ result = MIN2(cpu_count, limit_count); ++ if (PrintContainerInfo) { ++ tty->print_cr("OSContainer::active_processor_count: %d", result); ++ } ++ return result; ++} ++ ++char * OSContainer::cpu_cpuset_cpus() { ++ GET_CONTAINER_INFO_CPTR(cptr, cpuset, "/cpuset.cpus", ++ "cpuset.cpus is: %s", "%1023s", cpus, 1024); ++ return os::strdup(cpus); ++} ++ ++char * OSContainer::cpu_cpuset_memory_nodes() { ++ GET_CONTAINER_INFO_CPTR(cptr, cpuset, "/cpuset.mems", ++ "cpuset.mems is: %s", "%1023s", mems, 1024); ++ return os::strdup(mems); ++} ++ ++/* cpu_quota ++ * ++ * Return the number of milliseconds per period ++ * process is guaranteed to run. ++ * ++ * return: ++ * quota time in milliseconds ++ * -1 for no quota ++ * OSCONTAINER_ERROR for not supported ++ */ ++int OSContainer::cpu_quota() { ++ GET_CONTAINER_INFO(int, cpu, "/cpu.cfs_quota_us", ++ "CPU Quota is: %d", "%d", quota); ++ return quota; ++} ++ ++int OSContainer::cpu_period() { ++ GET_CONTAINER_INFO(int, cpu, "/cpu.cfs_period_us", ++ "CPU Period is: %d", "%d", period); ++ return period; ++} ++ ++/* cpu_shares ++ * ++ * Return the amount of cpu shares available to the process ++ * ++ * return: ++ * Share number (typically a number relative to 1024) ++ * (2048 typically expresses 2 CPUs worth of processing) ++ * -1 for no share setup ++ * OSCONTAINER_ERROR for not supported ++ */ ++int OSContainer::cpu_shares() { ++ GET_CONTAINER_INFO(int, cpu, "/cpu.shares", ++ "CPU Shares is: %d", "%d", shares); ++ // Convert 1024 to no shares setup ++ if (shares == 1024) return -1; ++ ++ return shares; ++} ++ +diff --git openjdk.orig/hotspot/src/os/linux/vm/osContainer_linux.hpp openjdk/hotspot/src/os/linux/vm/osContainer_linux.hpp +new file mode 100644 +--- /dev/null ++++ openjdk/hotspot/src/os/linux/vm/osContainer_linux.hpp +@@ -0,0 +1,68 @@ ++/* ++ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef OS_LINUX_VM_OSCONTAINER_LINUX_HPP ++#define OS_LINUX_VM_OSCONTAINER_LINUX_HPP ++ ++#include "utilities/globalDefinitions.hpp" ++#include "utilities/macros.hpp" ++#include "memory/allocation.hpp" ++ ++#define OSCONTAINER_ERROR (-2) ++ ++class OSContainer: AllStatic { ++ ++ private: ++ static bool _is_initialized; ++ static bool _is_containerized; ++ ++ public: ++ static void init(); ++ static inline bool is_containerized(); ++ static const char * container_type(); ++ ++ static jlong memory_limit_in_bytes(); ++ static jlong memory_and_swap_limit_in_bytes(); ++ static jlong memory_soft_limit_in_bytes(); ++ static jlong memory_usage_in_bytes(); ++ static jlong memory_max_usage_in_bytes(); ++ ++ static int active_processor_count(); ++ ++ static char * cpu_cpuset_cpus(); ++ static char * cpu_cpuset_memory_nodes(); ++ ++ static int cpu_quota(); ++ static int cpu_period(); ++ ++ static int cpu_shares(); ++ ++}; ++ ++inline bool OSContainer::is_containerized() { ++ assert(_is_initialized, "OSContainer not initialized"); ++ return _is_containerized; ++} ++ ++#endif // OS_LINUX_VM_OSCONTAINER_LINUX_HPP +diff --git openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp +--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp ++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp +@@ -37,6 +37,7 @@ + #include "mutex_linux.inline.hpp" + #include "oops/oop.inline.hpp" + #include "os_share_linux.hpp" ++#include "osContainer_linux.hpp" + #include "prims/jniFastGetField.hpp" + #include "prims/jvm.h" + #include "prims/jvm_misc.hpp" +@@ -179,13 +180,62 @@ + julong os::Linux::available_memory() { + // values in struct sysinfo are "unsigned long" + struct sysinfo si; ++ julong avail_mem; ++ ++ if (OSContainer::is_containerized()) { ++ jlong mem_limit, mem_usage; ++ if ((mem_limit = OSContainer::memory_limit_in_bytes()) < 1) { ++ if (PrintContainerInfo) { ++ tty->print_cr("container memory limit %s: " JLONG_FORMAT ", using host value", ++ mem_limit == OSCONTAINER_ERROR ? "failed" : "unlimited", mem_limit); ++ } ++ } ++ ++ if (mem_limit > 0 && (mem_usage = OSContainer::memory_usage_in_bytes()) < 1) { ++ if (PrintContainerInfo) { ++ tty->print_cr("container memory usage failed: " JLONG_FORMAT ", using host value", mem_usage); ++ } ++ } ++ ++ if (mem_limit > 0 && mem_usage > 0 ) { ++ avail_mem = mem_limit > mem_usage ? (julong)mem_limit - (julong)mem_usage : 0; ++ if (PrintContainerInfo) { ++ tty->print_cr("available container memory: " JULONG_FORMAT, avail_mem); ++ } ++ return avail_mem; ++ } ++ } ++ + sysinfo(&si); +- +- return (julong)si.freeram * si.mem_unit; ++ avail_mem = (julong)si.freeram * si.mem_unit; ++ if (Verbose) { ++ tty->print_cr("available memory: " JULONG_FORMAT, avail_mem); ++ } ++ return avail_mem; + } + + julong os::physical_memory() { +- return Linux::physical_memory(); ++ jlong phys_mem = 0; ++ if (OSContainer::is_containerized()) { ++ jlong mem_limit; ++ if ((mem_limit = OSContainer::memory_limit_in_bytes()) > 0) { ++ if (PrintContainerInfo) { ++ tty->print_cr("total container memory: " JLONG_FORMAT, mem_limit); ++ } ++ return mem_limit; ++ } ++ ++ if (PrintContainerInfo) { ++ tty->print_cr("container memory limit %s: " JLONG_FORMAT ", using host value", ++ mem_limit == OSCONTAINER_ERROR ? "failed" : "unlimited", mem_limit); ++ } ++ } ++ ++ phys_mem = Linux::physical_memory(); ++ if (Verbose) { ++ tty->print_cr("total system memory: " JLONG_FORMAT, phys_mem); ++ } ++ return phys_mem; + } + + //////////////////////////////////////////////////////////////////////////////// +@@ -2129,6 +2179,8 @@ + os::Posix::print_load_average(st); + + os::Linux::print_full_memory_info(st); ++ ++ os::Linux::print_container_info(st); + } + + // Try to identify popular distros. +@@ -2194,6 +2246,57 @@ + st->cr(); + } + ++void os::Linux::print_container_info(outputStream* st) { ++if (!OSContainer::is_containerized()) { ++ return; ++ } ++ ++ st->print("container (cgroup) information:\n"); ++ ++ const char *p_ct = OSContainer::container_type(); ++ st->print("container_type: %s\n", p_ct != NULL ? p_ct : "failed"); ++ ++ char *p = OSContainer::cpu_cpuset_cpus(); ++ st->print("cpu_cpuset_cpus: %s\n", p != NULL ? p : "failed"); ++ free(p); ++ ++ p = OSContainer::cpu_cpuset_memory_nodes(); ++ st->print("cpu_memory_nodes: %s\n", p != NULL ? p : "failed"); ++ free(p); ++ ++ int i = OSContainer::active_processor_count(); ++ if (i > 0) { ++ st->print("active_processor_count: %d\n", i); ++ } else { ++ st->print("active_processor_count: failed\n"); ++ } ++ ++ i = OSContainer::cpu_quota(); ++ st->print("cpu_quota: %d\n", i); ++ ++ i = OSContainer::cpu_period(); ++ st->print("cpu_period: %d\n", i); ++ ++ i = OSContainer::cpu_shares(); ++ st->print("cpu_shares: %d\n", i); ++ ++ jlong j = OSContainer::memory_limit_in_bytes(); ++ st->print("memory_limit_in_bytes: " JLONG_FORMAT "\n", j); ++ ++ j = OSContainer::memory_and_swap_limit_in_bytes(); ++ st->print("memory_and_swap_limit_in_bytes: " JLONG_FORMAT "\n", j); ++ ++ j = OSContainer::memory_soft_limit_in_bytes(); ++ st->print("memory_soft_limit_in_bytes: " JLONG_FORMAT "\n", j); ++ ++ j = OSContainer::OSContainer::memory_usage_in_bytes(); ++ st->print("memory_usage_in_bytes: " JLONG_FORMAT "\n", j); ++ ++ j = OSContainer::OSContainer::memory_max_usage_in_bytes(); ++ st->print("memory_max_usage_in_bytes: " JLONG_FORMAT "\n", j); ++ st->cr(); ++} ++ + void os::print_memory_info(outputStream* st) { + + st->print("Memory:"); +@@ -4966,6 +5069,10 @@ + } + } + ++void os::pd_init_container_support() { ++ OSContainer::init(); ++} ++ + // this is called _after_ the global arguments have been parsed + jint os::init_2(void) + { +@@ -5146,7 +5253,7 @@ + // sched_getaffinity gives an accurate answer as it accounts for cpusets. + // If anything goes wrong we fallback to returning the number of online + // processors - which can be greater than the number available to the process. +-int os::active_processor_count() { ++int os::Linux::active_processor_count() { + cpu_set_t cpus; // can represent at most 1024 (CPU_SETSIZE) processors + int cpus_size = sizeof(cpu_set_t); + int cpu_count = 0; +@@ -5164,10 +5271,48 @@ + "which may exceed available processors", strerror(errno), cpu_count); + } + +- assert(cpu_count > 0 && cpu_count <= processor_count(), "sanity check"); ++ assert(cpu_count > 0 && cpu_count <= os::processor_count(), "sanity check"); + return cpu_count; + } + ++// Determine the active processor count from one of ++// three different sources: ++// ++// 1. User option -XX:ActiveProcessorCount ++// 2. kernel os calls (sched_getaffinity or sysconf(_SC_NPROCESSORS_ONLN) ++// 3. extracted from cgroup cpu subsystem (shares and quotas) ++// ++// Option 1, if specified, will always override. ++// If the cgroup subsystem is active and configured, we ++// will return the min of the cgroup and option 2 results. ++// This is required since tools, such as numactl, that ++// alter cpu affinity do not update cgroup subsystem ++// cpuset configuration files. ++int os::active_processor_count() { ++ // User has overridden the number of active processors ++ if (ActiveProcessorCount > 0) { ++ if (PrintActiveCpus) { ++ tty->print_cr("active_processor_count: " ++ "active processor count set by user : %d", ++ ActiveProcessorCount); ++ } ++ return ActiveProcessorCount; ++ } ++ ++ int active_cpus; ++ if (OSContainer::is_containerized()) { ++ active_cpus = OSContainer::active_processor_count(); ++ if (PrintActiveCpus) { ++ tty->print_cr("active_processor_count: determined by OSContainer: %d", ++ active_cpus); ++ } ++ } else { ++ active_cpus = os::Linux::active_processor_count(); ++ } ++ ++ return active_cpus; ++} ++ + void os::set_native_thread_name(const char *name) { + // Not yet implemented. + return; +diff --git openjdk.orig/hotspot/src/os/linux/vm/os_linux.hpp openjdk/hotspot/src/os/linux/vm/os_linux.hpp +--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.hpp ++++ openjdk/hotspot/src/os/linux/vm/os_linux.hpp +@@ -35,6 +35,7 @@ + + class Linux { + friend class os; ++ friend class OSContainer; + friend class TestReserveMemorySpecial; + + // For signal-chaining +@@ -79,6 +80,9 @@ + + static julong available_memory(); + static julong physical_memory() { return _physical_memory; } ++ static void set_physical_memory(julong phys_mem) { _physical_memory = phys_mem; } ++ static int active_processor_count(); ++ + static void initialize_system_info(); + + static int commit_memory_impl(char* addr, size_t bytes, bool exec); +@@ -116,6 +120,7 @@ + static bool release_memory_special_huge_tlbfs(char* base, size_t bytes); + + static void print_full_memory_info(outputStream* st); ++ static void print_container_info(outputStream* st); + static void print_distro_info(outputStream* st); + static void print_libversion_info(outputStream* st); + +diff --git openjdk.orig/hotspot/src/os/solaris/vm/os_solaris.cpp openjdk/hotspot/src/os/solaris/vm/os_solaris.cpp +--- openjdk.orig/hotspot/src/os/solaris/vm/os_solaris.cpp ++++ openjdk/hotspot/src/os/solaris/vm/os_solaris.cpp +@@ -357,6 +357,16 @@ + } + + int os::active_processor_count() { ++ // User has overridden the number of active processors ++ if (ActiveProcessorCount > 0) { ++ if (Verbose) { ++ tty->print_cr("active_processor_count: " ++ "active processor count set by user : %d", ++ ActiveProcessorCount); ++ } ++ return ActiveProcessorCount; ++ } ++ + int online_cpus = sysconf(_SC_NPROCESSORS_ONLN); + pid_t pid = getpid(); + psetid_t pset = PS_NONE; +diff --git openjdk.orig/hotspot/src/os/windows/vm/os_windows.cpp openjdk/hotspot/src/os/windows/vm/os_windows.cpp +--- openjdk.orig/hotspot/src/os/windows/vm/os_windows.cpp ++++ openjdk/hotspot/src/os/windows/vm/os_windows.cpp +@@ -716,6 +716,16 @@ + #endif + + int os::active_processor_count() { ++ // User has overridden the number of active processors ++ if (ActiveProcessorCount > 0) { ++ if (PrintActiveCpus) { ++ tty->print_cr("active_processor_count: " ++ "active processor count set by user : %d", ++ ActiveProcessorCount); ++ } ++ return ActiveProcessorCount; ++ } ++ + DWORD_PTR lpProcessAffinityMask = 0; + DWORD_PTR lpSystemAffinityMask = 0; + int proc_count = processor_count(); +diff --git openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp openjdk/hotspot/src/share/vm/runtime/arguments.cpp +--- openjdk.orig/hotspot/src/share/vm/runtime/arguments.cpp ++++ openjdk/hotspot/src/share/vm/runtime/arguments.cpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -1801,20 +1801,34 @@ + } + } + ++ // Convert Fraction to Precentage values ++ if (FLAG_IS_DEFAULT(MaxRAMPercentage) && ++ !FLAG_IS_DEFAULT(MaxRAMFraction)) ++ MaxRAMPercentage = 100.0 / MaxRAMFraction; ++ ++ if (FLAG_IS_DEFAULT(MinRAMPercentage) && ++ !FLAG_IS_DEFAULT(MinRAMFraction)) ++ MinRAMPercentage = 100.0 / MinRAMFraction; ++ ++ if (FLAG_IS_DEFAULT(InitialRAMPercentage) && ++ !FLAG_IS_DEFAULT(InitialRAMFraction)) ++ InitialRAMPercentage = 100.0 / InitialRAMFraction; ++ + // If the maximum heap size has not been set with -Xmx, + // then set it as fraction of the size of physical memory, + // respecting the maximum and minimum sizes of the heap. + if (FLAG_IS_DEFAULT(MaxHeapSize)) { +- julong reasonable_max = phys_mem / MaxRAMFraction; +- +- if (phys_mem <= MaxHeapSize * MinRAMFraction) { ++ julong reasonable_max = (julong)((phys_mem * MaxRAMPercentage) / 100); ++ const julong reasonable_min = (julong)((phys_mem * MinRAMPercentage) / 100); ++ if (reasonable_min < MaxHeapSize) { + // Small physical memory, so use a minimum fraction of it for the heap +- reasonable_max = phys_mem / MinRAMFraction; ++ reasonable_max = reasonable_min; + } else { + // Not-small physical memory, so require a heap at least + // as large as MaxHeapSize + reasonable_max = MAX2(reasonable_max, (julong)MaxHeapSize); + } ++ + if (!FLAG_IS_DEFAULT(ErgoHeapSizeLimit) && ErgoHeapSizeLimit != 0) { + // Limit the heap size to ErgoHeapSizeLimit + reasonable_max = MIN2(reasonable_max, (julong)ErgoHeapSizeLimit); +@@ -1856,7 +1870,7 @@ + reasonable_minimum = limit_by_allocatable_memory(reasonable_minimum); + + if (InitialHeapSize == 0) { +- julong reasonable_initial = phys_mem / InitialRAMFraction; ++ julong reasonable_initial = (julong)((phys_mem * InitialRAMPercentage) / 100); + + reasonable_initial = MAX3(reasonable_initial, reasonable_minimum, (julong)min_heap_size()); + reasonable_initial = MIN2(reasonable_initial, (julong)MaxHeapSize); +@@ -1881,6 +1895,94 @@ + } + } + ++// This option inspects the machine and attempts to set various ++// parameters to be optimal for long-running, memory allocation ++// intensive jobs. It is intended for machines with large ++// amounts of cpu and memory. ++jint Arguments::set_aggressive_heap_flags() { ++ // initHeapSize is needed since _initial_heap_size is 4 bytes on a 32 bit ++ // VM, but we may not be able to represent the total physical memory ++ // available (like having 8gb of memory on a box but using a 32bit VM). ++ // Thus, we need to make sure we're using a julong for intermediate ++ // calculations. ++ julong initHeapSize; ++ julong total_memory = os::physical_memory(); ++ ++ if (total_memory < (julong) 256 * M) { ++ jio_fprintf(defaultStream::error_stream(), ++ "You need at least 256mb of memory to use -XX:+AggressiveHeap\n"); ++ vm_exit(1); ++ } ++ ++ // The heap size is half of available memory, or (at most) ++ // all of possible memory less 160mb (leaving room for the OS ++ // when using ISM). This is the maximum; because adaptive sizing ++ // is turned on below, the actual space used may be smaller. ++ ++ initHeapSize = MIN2(total_memory / (julong) 2, ++ total_memory - (julong) 160 * M); ++ ++ initHeapSize = limit_by_allocatable_memory(initHeapSize); ++ ++ if (FLAG_IS_DEFAULT(MaxHeapSize)) { ++ FLAG_SET_CMDLINE(uintx, MaxHeapSize, initHeapSize); ++ FLAG_SET_CMDLINE(uintx, InitialHeapSize, initHeapSize); ++ // Currently the minimum size and the initial heap sizes are the same. ++ set_min_heap_size(initHeapSize); ++ } ++ if (FLAG_IS_DEFAULT(NewSize)) { ++ // Make the young generation 3/8ths of the total heap. ++ FLAG_SET_CMDLINE(uintx, NewSize, ++ ((julong) MaxHeapSize / (julong) 8) * (julong) 3); ++ FLAG_SET_CMDLINE(uintx, MaxNewSize, NewSize); ++ } ++ ++#ifndef _ALLBSD_SOURCE // UseLargePages is not yet supported on BSD. ++ FLAG_SET_DEFAULT(UseLargePages, true); ++#endif ++ ++ // Increase some data structure sizes for efficiency ++ FLAG_SET_CMDLINE(uintx, BaseFootPrintEstimate, MaxHeapSize); ++ FLAG_SET_CMDLINE(bool, ResizeTLAB, false); ++ FLAG_SET_CMDLINE(uintx, TLABSize, 256 * K); ++ ++ // See the OldPLABSize comment below, but replace 'after promotion' ++ // with 'after copying'. YoungPLABSize is the size of the survivor ++ // space per-gc-thread buffers. The default is 4kw. ++ FLAG_SET_CMDLINE(uintx, YoungPLABSize, 256 * K); // Note: this is in words ++ ++ // OldPLABSize is the size of the buffers in the old gen that ++ // UseParallelGC uses to promote live data that doesn't fit in the ++ // survivor spaces. At any given time, there's one for each gc thread. ++ // The default size is 1kw. These buffers are rarely used, since the ++ // survivor spaces are usually big enough. For specjbb, however, there ++ // are occasions when there's lots of live data in the young gen ++ // and we end up promoting some of it. We don't have a definite ++ // explanation for why bumping OldPLABSize helps, but the theory ++ // is that a bigger PLAB results in retaining something like the ++ // original allocation order after promotion, which improves mutator ++ // locality. A minor effect may be that larger PLABs reduce the ++ // number of PLAB allocation events during gc. The value of 8kw ++ // was arrived at by experimenting with specjbb. ++ FLAG_SET_CMDLINE(uintx, OldPLABSize, 8 * K); // Note: this is in words ++ ++ // Enable parallel GC and adaptive generation sizing ++ FLAG_SET_CMDLINE(bool, UseParallelGC, true); ++ ++ // Encourage steady state memory management ++ FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100); ++ ++ // This appears to improve mutator locality ++ FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false); ++ ++ // Get around early Solaris scheduling bug ++ // (affinity vs other jobs on system) ++ // but disallow DR and offlining (5008695). ++ FLAG_SET_CMDLINE(bool, BindGCTaskThreadsToCPUs, true); ++ ++ return JNI_OK; ++} ++ + // This must be called after ergonomics because we want bytecode rewriting + // if the server compiler is used, or if UseSharedSpaces is disabled. + void Arguments::set_bytecode_flags() { +@@ -2644,6 +2746,14 @@ + return result; + } + ++ // We need to ensure processor and memory resources have been properly ++ // configured - which may rely on arguments we just processed - before ++ // doing the final argument processing. Any argument processing that ++ // needs to know about processor and memory resources must occur after ++ // this point. ++ ++ os::init_container_support(); ++ + // Do final processing now that all arguments have been parsed + result = finalize_vm_init_args(&scp, scp_assembly_required); + if (result != JNI_OK) { +@@ -3117,94 +3227,6 @@ + _exit_hook = CAST_TO_FN_PTR(exit_hook_t, option->extraInfo); + } else if (match_option(option, "abort", &tail)) { + _abort_hook = CAST_TO_FN_PTR(abort_hook_t, option->extraInfo); +- // -XX:+AggressiveHeap +- } else if (match_option(option, "-XX:+AggressiveHeap", &tail)) { +- +- // This option inspects the machine and attempts to set various +- // parameters to be optimal for long-running, memory allocation +- // intensive jobs. It is intended for machines with large +- // amounts of cpu and memory. +- +- // initHeapSize is needed since _initial_heap_size is 4 bytes on a 32 bit +- // VM, but we may not be able to represent the total physical memory +- // available (like having 8gb of memory on a box but using a 32bit VM). +- // Thus, we need to make sure we're using a julong for intermediate +- // calculations. +- julong initHeapSize; +- julong total_memory = os::physical_memory(); +- +- if (total_memory < (julong)256*M) { +- jio_fprintf(defaultStream::error_stream(), +- "You need at least 256mb of memory to use -XX:+AggressiveHeap\n"); +- vm_exit(1); +- } +- +- // The heap size is half of available memory, or (at most) +- // all of possible memory less 160mb (leaving room for the OS +- // when using ISM). This is the maximum; because adaptive sizing +- // is turned on below, the actual space used may be smaller. +- +- initHeapSize = MIN2(total_memory / (julong)2, +- total_memory - (julong)160*M); +- +- initHeapSize = limit_by_allocatable_memory(initHeapSize); +- +- if (FLAG_IS_DEFAULT(MaxHeapSize)) { +- FLAG_SET_CMDLINE(uintx, MaxHeapSize, initHeapSize); +- FLAG_SET_CMDLINE(uintx, InitialHeapSize, initHeapSize); +- // Currently the minimum size and the initial heap sizes are the same. +- set_min_heap_size(initHeapSize); +- } +- if (FLAG_IS_DEFAULT(NewSize)) { +- // Make the young generation 3/8ths of the total heap. +- FLAG_SET_CMDLINE(uintx, NewSize, +- ((julong)MaxHeapSize / (julong)8) * (julong)3); +- FLAG_SET_CMDLINE(uintx, MaxNewSize, NewSize); +- } +- +-#ifndef _ALLBSD_SOURCE // UseLargePages is not yet supported on BSD. +- FLAG_SET_DEFAULT(UseLargePages, true); +-#endif +- +- // Increase some data structure sizes for efficiency +- FLAG_SET_CMDLINE(uintx, BaseFootPrintEstimate, MaxHeapSize); +- FLAG_SET_CMDLINE(bool, ResizeTLAB, false); +- FLAG_SET_CMDLINE(uintx, TLABSize, 256*K); +- +- // See the OldPLABSize comment below, but replace 'after promotion' +- // with 'after copying'. YoungPLABSize is the size of the survivor +- // space per-gc-thread buffers. The default is 4kw. +- FLAG_SET_CMDLINE(uintx, YoungPLABSize, 256*K); // Note: this is in words +- +- // OldPLABSize is the size of the buffers in the old gen that +- // UseParallelGC uses to promote live data that doesn't fit in the +- // survivor spaces. At any given time, there's one for each gc thread. +- // The default size is 1kw. These buffers are rarely used, since the +- // survivor spaces are usually big enough. For specjbb, however, there +- // are occasions when there's lots of live data in the young gen +- // and we end up promoting some of it. We don't have a definite +- // explanation for why bumping OldPLABSize helps, but the theory +- // is that a bigger PLAB results in retaining something like the +- // original allocation order after promotion, which improves mutator +- // locality. A minor effect may be that larger PLABs reduce the +- // number of PLAB allocation events during gc. The value of 8kw +- // was arrived at by experimenting with specjbb. +- FLAG_SET_CMDLINE(uintx, OldPLABSize, 8*K); // Note: this is in words +- +- // Enable parallel GC and adaptive generation sizing +- FLAG_SET_CMDLINE(bool, UseParallelGC, true); +- +- // Encourage steady state memory management +- FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100); +- +- // This appears to improve mutator locality +- FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false); +- +- // Get around early Solaris scheduling bug +- // (affinity vs other jobs on system) +- // but disallow DR and offlining (5008695). +- FLAG_SET_CMDLINE(bool, BindGCTaskThreadsToCPUs, true); +- + } else if (match_option(option, "-XX:+NeverTenure", &tail)) { + // The last option must always win. + FLAG_SET_CMDLINE(bool, AlwaysTenure, false); +@@ -3605,6 +3627,15 @@ + return JNI_ERR; + } + ++ // This must be done after all arguments have been processed ++ // and the container support has been initialized since AggressiveHeap ++ // relies on the amount of total memory available. ++ if (AggressiveHeap) { ++ jint result = set_aggressive_heap_flags(); ++ if (result != JNI_OK) { ++ return result; ++ } ++ } + // This must be done after all arguments have been processed. + // java_compiler() true means set to "NONE" or empty. + if (java_compiler() && !xdebug_mode()) { +diff --git openjdk.orig/hotspot/src/share/vm/runtime/arguments.hpp openjdk/hotspot/src/share/vm/runtime/arguments.hpp +--- openjdk.orig/hotspot/src/share/vm/runtime/arguments.hpp ++++ openjdk/hotspot/src/share/vm/runtime/arguments.hpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -365,6 +365,8 @@ + // Aggressive optimization flags. + static void set_aggressive_opts_flags(); + ++ static jint set_aggressive_heap_flags(); ++ + // Argument parsing + static void do_pd_flag_adjustments(); + static bool parse_argument(const char* arg, Flag::Flags origin); +diff --git openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp openjdk/hotspot/src/share/vm/runtime/globals.hpp +--- openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp ++++ openjdk/hotspot/src/share/vm/runtime/globals.hpp +@@ -2076,13 +2076,23 @@ + product_pd(uint64_t, MaxRAM, \ + "Real memory size (in bytes) used to set maximum heap size") \ + \ ++ product(bool, AggressiveHeap, false, \ ++ "Optimize heap options for long-running memory intensive apps") \ ++ \ + product(uintx, ErgoHeapSizeLimit, 0, \ + "Maximum ergonomically set heap size (in bytes); zero means use " \ +- "MaxRAM / MaxRAMFraction") \ ++ "MaxRAM * MaxRAMPercentage / 100") \ + \ + experimental(bool, UseCGroupMemoryLimitForHeap, false, \ + "Use CGroup memory limit as physical memory limit for heap " \ +- "sizing") \ ++ "sizing" \ ++ "Deprecated, replaced by container support") \ ++ \ ++ diagnostic(bool, PrintContainerInfo, false, \ ++ "Print container related information") \ ++ \ ++ diagnostic(bool, PrintActiveCpus, false, \ ++ "Print the number of CPUs detected in os::active_processor_count") \ + \ + product(uintx, MaxRAMFraction, 4, \ + "Maximum fraction (1/n) of real memory used for maximum heap " \ +@@ -2099,6 +2109,19 @@ + product(uintx, InitialRAMFraction, 64, \ + "Fraction (1/n) of real memory used for initial heap size") \ + \ ++ product(double, MaxRAMPercentage, 25.0, \ ++ "Maximum percentage of real memory used for maximum heap size") \ ++ \ ++ product(double, MinRAMPercentage, 50.0, \ ++ "Minimum percentage of real memory used for maximum heap" \ ++ "size on systems with small physical memory size") \ ++ \ ++ product(double, InitialRAMPercentage, 1.5625, \ ++ "Percentage of real memory used for initial heap size") \ ++ \ ++ product(intx, ActiveProcessorCount, -1, \ ++ "Specify the CPU count the VM should use and report as active") \ ++ \ + develop(uintx, MaxVirtMemFraction, 2, \ + "Maximum fraction (1/n) of virtual memory used for ergonomically "\ + "determining maximum heap size") \ +diff --git openjdk.orig/hotspot/src/share/vm/runtime/os.hpp openjdk/hotspot/src/share/vm/runtime/os.hpp +--- openjdk.orig/hotspot/src/share/vm/runtime/os.hpp ++++ openjdk/hotspot/src/share/vm/runtime/os.hpp +@@ -152,8 +152,16 @@ + static size_t page_size_for_region(size_t region_size, size_t min_pages, bool must_be_aligned); + + static void initialize_initial_active_processor_count(); ++ ++ LINUX_ONLY(static void pd_init_container_support();) ++ + public: + static void init(void); // Called before command line parsing ++ ++ static void init_container_support() { // Called during command line parsing. ++ LINUX_ONLY(pd_init_container_support();) ++ } ++ + static void init_before_ergo(void); // Called after command line parsing + // before VM ergonomics processing. + static jint init_2(void); // Called after command line parsing +diff --git openjdk.orig/hotspot/src/share/vm/runtime/thread.cpp openjdk/hotspot/src/share/vm/runtime/thread.cpp +--- openjdk.orig/hotspot/src/share/vm/runtime/thread.cpp ++++ openjdk/hotspot/src/share/vm/runtime/thread.cpp +@@ -3332,6 +3332,7 @@ + Arguments::init_version_specific_system_properties(); + + // Parse arguments ++ // Note: this internally calls os::init_container_support() + jint parse_result = Arguments::parse(args); + if (parse_result != JNI_OK) return parse_result; + diff --git a/SOURCES/8165489-pr3589.patch b/SOURCES/8165489-pr3589.patch new file mode 100644 index 0000000..1674dec --- /dev/null +++ b/SOURCES/8165489-pr3589.patch @@ -0,0 +1,123 @@ +# HG changeset patch +# User mdoerr +# Date 1473159687 -7200 +# Tue Sep 06 13:01:27 2016 +0200 +# Node ID 7f6e1069a5719c8908b53774d3560ce851c7cd70 +# Parent b8fc1e640c4c7f38ca94131279cb67c4d3de6961 +8165489, PR3589: Missing G1 barrier in Unsafe_GetObjectVolatile +Summary: Add missing barrier, sharing code with Unsafe_GetObject. +Reviewed-by: kbarrett, mgerdin, pliden, tschatzl + +diff --git openjdk.orig/hotspot/src/share/vm/prims/unsafe.cpp openjdk/hotspot/src/share/vm/prims/unsafe.cpp +--- openjdk.orig/hotspot/src/share/vm/prims/unsafe.cpp ++++ openjdk/hotspot/src/share/vm/prims/unsafe.cpp +@@ -199,37 +199,40 @@ + + // Get/SetObject must be special-cased, since it works with handles. + ++// We could be accessing the referent field in a reference ++// object. If G1 is enabled then we need to register non-null ++// referent with the SATB barrier. ++ ++#if INCLUDE_ALL_GCS ++static bool is_java_lang_ref_Reference_access(oop o, jlong offset) { ++ if (offset == java_lang_ref_Reference::referent_offset && o != NULL) { ++ Klass* k = o->klass(); ++ if (InstanceKlass::cast(k)->reference_type() != REF_NONE) { ++ assert(InstanceKlass::cast(k)->is_subclass_of(SystemDictionary::Reference_klass()), "sanity"); ++ return true; ++ } ++ } ++ return false; ++} ++#endif ++ ++static void ensure_satb_referent_alive(oop o, jlong offset, oop v) { ++#if INCLUDE_ALL_GCS ++ if (UseG1GC && v != NULL && is_java_lang_ref_Reference_access(o, offset)) { ++ G1SATBCardTableModRefBS::enqueue(v); ++ } ++#endif ++} ++ + // The xxx140 variants for backward compatibility do not allow a full-width offset. + UNSAFE_ENTRY(jobject, Unsafe_GetObject140(JNIEnv *env, jobject unsafe, jobject obj, jint offset)) + UnsafeWrapper("Unsafe_GetObject"); + if (obj == NULL) THROW_0(vmSymbols::java_lang_NullPointerException()); + GET_OOP_FIELD(obj, offset, v) +- jobject ret = JNIHandles::make_local(env, v); +-#if INCLUDE_ALL_GCS +- // We could be accessing the referent field in a reference +- // object. If G1 is enabled then we need to register a non-null +- // referent with the SATB barrier. +- if (UseG1GC) { +- bool needs_barrier = false; + +- if (ret != NULL) { +- if (offset == java_lang_ref_Reference::referent_offset) { +- oop o = JNIHandles::resolve_non_null(obj); +- Klass* k = o->klass(); +- if (InstanceKlass::cast(k)->reference_type() != REF_NONE) { +- assert(InstanceKlass::cast(k)->is_subclass_of(SystemDictionary::Reference_klass()), "sanity"); +- needs_barrier = true; +- } +- } +- } ++ ensure_satb_referent_alive(p, offset, v); + +- if (needs_barrier) { +- oop referent = JNIHandles::resolve(ret); +- G1SATBCardTableModRefBS::enqueue(referent); +- } +- } +-#endif // INCLUDE_ALL_GCS +- return ret; ++ return JNIHandles::make_local(env, v); + UNSAFE_END + + UNSAFE_ENTRY(void, Unsafe_SetObject140(JNIEnv *env, jobject unsafe, jobject obj, jint offset, jobject x_h)) +@@ -262,32 +265,10 @@ + UNSAFE_ENTRY(jobject, Unsafe_GetObject(JNIEnv *env, jobject unsafe, jobject obj, jlong offset)) + UnsafeWrapper("Unsafe_GetObject"); + GET_OOP_FIELD(obj, offset, v) +- jobject ret = JNIHandles::make_local(env, v); +-#if INCLUDE_ALL_GCS +- // We could be accessing the referent field in a reference +- // object. If G1 is enabled then we need to register non-null +- // referent with the SATB barrier. +- if (UseG1GC) { +- bool needs_barrier = false; + +- if (ret != NULL) { +- if (offset == java_lang_ref_Reference::referent_offset && obj != NULL) { +- oop o = JNIHandles::resolve(obj); +- Klass* k = o->klass(); +- if (InstanceKlass::cast(k)->reference_type() != REF_NONE) { +- assert(InstanceKlass::cast(k)->is_subclass_of(SystemDictionary::Reference_klass()), "sanity"); +- needs_barrier = true; +- } +- } +- } ++ ensure_satb_referent_alive(p, offset, v); + +- if (needs_barrier) { +- oop referent = JNIHandles::resolve(ret); +- G1SATBCardTableModRefBS::enqueue(referent); +- } +- } +-#endif // INCLUDE_ALL_GCS +- return ret; ++ return JNIHandles::make_local(env, v); + UNSAFE_END + + UNSAFE_ENTRY(void, Unsafe_SetObject(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jobject x_h)) +@@ -312,6 +293,9 @@ + } else { + (void)const_cast(v = *(volatile oop*) addr); + } ++ ++ ensure_satb_referent_alive(p, offset, v); ++ + OrderAccess::acquire(); + return JNIHandles::make_local(env, v); + UNSAFE_END diff --git a/SOURCES/8197981-pr3548.patch b/SOURCES/8197981-pr3548.patch new file mode 100644 index 0000000..5f6d9ce --- /dev/null +++ b/SOURCES/8197981-pr3548.patch @@ -0,0 +1,32 @@ +# HG changeset patch +# User andrew +# Date 1518667645 0 +# Thu Feb 15 04:07:25 2018 +0000 +# Node ID 1d35411eb7bdf16191e220ffe3b1dc4d5d0c6041 +# Parent 999983606f5c61b093c6f6316a7b26c4cd4ca79e +8197981, PR3548: Missing return statement in __sync_val_compare_and_swap_8 +Summary: Fix issue discovered by -Wreturn-type on systems without LP64. +Reviewed-by: aph + +diff --git openjdk.orig/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp openjdk/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp +--- openjdk.orig/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp ++++ openjdk/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp +@@ -457,6 +457,7 @@ + long long unsigned int oldval, + long long unsigned int newval) { + ShouldNotCallThis(); ++ return 0; + } + }; + #endif // !_LP64 +diff --git openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp +--- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp ++++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp +@@ -498,6 +498,7 @@ + long long unsigned int oldval, + long long unsigned int newval) { + ShouldNotCallThis(); ++ return 0; + } + }; + #endif // !_LP64 diff --git a/SOURCES/8203182-pr3603-rh1568033.patch b/SOURCES/8203182-pr3603-rh1568033.patch new file mode 100644 index 0000000..031a60c --- /dev/null +++ b/SOURCES/8203182-pr3603-rh1568033.patch @@ -0,0 +1,131 @@ +# HG changeset patch +# User igerasim +# Date 1528992969 25200 +# Thu Jun 14 09:16:09 2018 -0700 +# Node ID d9b0b4bd2526818afa73b60da77403245554caa8 +# Parent 1f4b038b9550afaf88a70cee4cf9c1422ecd86d6 +8203182, PR3603: Release session if initialization of SunPKCS11 Signature fails +Summary: Ensure session is properly released in P11Signature class +Reviewed-by: valeriep +Contributed-by: Martin Balao + +diff --git openjdk.orig/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java openjdk/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java +--- openjdk.orig/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java ++++ openjdk/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java +@@ -309,47 +309,51 @@ + session = token.killSession(session); + return; + } +- // "cancel" operation by finishing it +- // XXX make sure all this always works correctly +- if (mode == M_SIGN) { +- try { +- if (type == T_UPDATE) { +- token.p11.C_SignFinal(session.id(), 0); +- } else { +- byte[] digest; +- if (type == T_DIGEST) { +- digest = md.digest(); +- } else { // T_RAW +- digest = buffer; ++ try { ++ // "cancel" operation by finishing it ++ // XXX make sure all this always works correctly ++ if (mode == M_SIGN) { ++ try { ++ if (type == T_UPDATE) { ++ token.p11.C_SignFinal(session.id(), 0); ++ } else { ++ byte[] digest; ++ if (type == T_DIGEST) { ++ digest = md.digest(); ++ } else { // T_RAW ++ digest = buffer; ++ } ++ token.p11.C_Sign(session.id(), digest); + } +- token.p11.C_Sign(session.id(), digest); ++ } catch (PKCS11Exception e) { ++ throw new ProviderException("cancel failed", e); + } +- } catch (PKCS11Exception e) { +- throw new ProviderException("cancel failed", e); ++ } else { // M_VERIFY ++ try { ++ byte[] signature; ++ if (keyAlgorithm.equals("DSA")) { ++ signature = new byte[40]; ++ } else { ++ signature = new byte[(p11Key.length() + 7) >> 3]; ++ } ++ if (type == T_UPDATE) { ++ token.p11.C_VerifyFinal(session.id(), signature); ++ } else { ++ byte[] digest; ++ if (type == T_DIGEST) { ++ digest = md.digest(); ++ } else { // T_RAW ++ digest = buffer; ++ } ++ token.p11.C_Verify(session.id(), digest, signature); ++ } ++ } catch (PKCS11Exception e) { ++ // will fail since the signature is incorrect ++ // XXX check error code ++ } + } +- } else { // M_VERIFY +- try { +- byte[] signature; +- if (keyAlgorithm.equals("DSA")) { +- signature = new byte[40]; +- } else { +- signature = new byte[(p11Key.length() + 7) >> 3]; +- } +- if (type == T_UPDATE) { +- token.p11.C_VerifyFinal(session.id(), signature); +- } else { +- byte[] digest; +- if (type == T_DIGEST) { +- digest = md.digest(); +- } else { // T_RAW +- digest = buffer; +- } +- token.p11.C_Verify(session.id(), digest, signature); +- } +- } catch (PKCS11Exception e) { +- // will fail since the signature is incorrect +- // XXX check error code +- } ++ } finally { ++ session = token.releaseSession(session); + } + } + +@@ -368,6 +372,8 @@ + } + initialized = true; + } catch (PKCS11Exception e) { ++ // release session when initialization failed ++ session = token.releaseSession(session); + throw new ProviderException("Initialization failed", e); + } + if (bytesProcessed != 0) { +@@ -529,6 +535,8 @@ + } + bytesProcessed += len; + } catch (PKCS11Exception e) { ++ initialized = false; ++ session = token.releaseSession(session); + throw new ProviderException(e); + } + break; +@@ -576,6 +584,8 @@ + bytesProcessed += len; + byteBuffer.position(ofs + len); + } catch (PKCS11Exception e) { ++ initialized = false; ++ session = token.releaseSession(session); + throw new ProviderException("Update failed", e); + } + break; diff --git a/SOURCES/pr3458-rh1540242-zero.patch b/SOURCES/pr3458-rh1540242-zero.patch deleted file mode 100644 index dad435b..0000000 --- a/SOURCES/pr3458-rh1540242-zero.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff --git a/src/os_cpu/linux_zero/vm/os_linux_zero.cpp b/src/os_cpu/linux_zero/vm/os_linux_zero.cpp ---- openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp -+++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp -@@ -408,6 +408,7 @@ - - extern "C" { - int SpinPause() { -+ return 0; - } - - diff --git a/SOURCES/pr3519.patch b/SOURCES/pr3519.patch new file mode 100644 index 0000000..51ca7f1 --- /dev/null +++ b/SOURCES/pr3519.patch @@ -0,0 +1,19 @@ +# HG changeset patch +# User andrew +# Date 1518669922 0 +# Thu Feb 15 04:45:22 2018 +0000 +# Node ID adaf109718c10888cce5b6e73af7f3e15a7ab0db +# Parent 3ade0115344b77e6d00462044e0cf68722685bfe +PR3519: Fix further functions with a missing return value. + +diff --git openjdk.orig/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp openjdk/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp +--- openjdk.orig/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp ++++ openjdk/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp +@@ -205,6 +205,7 @@ + return Address(base, tmp, Address::lsl(addr->scale())); + } + } ++ return Address(); + } + + Address LIR_Assembler::as_Address_hi(LIR_Address* addr) { diff --git a/SOURCES/pr3539-rh1548475.patch b/SOURCES/pr3539-rh1548475.patch index 9b40a7f..492a080 100644 --- a/SOURCES/pr3539-rh1548475.patch +++ b/SOURCES/pr3539-rh1548475.patch @@ -85,8 +85,8 @@ diff --git openjdk.orig/hotspot/make/linux/makefiles/jsig.make openjdk/hotspot/m # cause problems with interposing. See CR: 6466665 # LFLAGS_JSIG += $(MAPFLAG:FILENAME=$(LIBJSIG_MAPFILE)) --LFLAGS_JSIG += -D_GNU_SOURCE -D_REENTRANT $(LDFLAGS_HASH_STYLE) $(LDFLAGS_NO_EXEC_STACK) -+LFLAGS_JSIG += -D_GNU_SOURCE -D_REENTRANT $(LDFLAGS_HASH_STYLE) $(LDFLAGS_NO_EXEC_STACK) $(EXTRA_LDFLAGS) +-LFLAGS_JSIG += -D_GNU_SOURCE -D_REENTRANT $(LDFLAGS_HASH_STYLE) ++LFLAGS_JSIG += -D_GNU_SOURCE -D_REENTRANT $(LDFLAGS_HASH_STYLE) $(EXTRA_LDFLAGS) # DEBUG_BINARIES overrides everything, use full -g debug information ifeq ($(DEBUG_BINARIES), true) @@ -105,7 +105,7 @@ diff --git openjdk.orig/hotspot/make/linux/makefiles/saproc.make openjdk/hotspot diff --git openjdk.orig/hotspot/make/linux/makefiles/vm.make openjdk/hotspot/make/linux/makefiles/vm.make --- openjdk.orig/hotspot/make/linux/makefiles/vm.make +++ openjdk/hotspot/make/linux/makefiles/vm.make -@@ -122,7 +122,7 @@ +@@ -130,7 +130,7 @@ # Extra flags from gnumake's invocation or environment CFLAGS += $(EXTRA_CFLAGS) diff --git a/SOURCES/pr3601.patch b/SOURCES/pr3601.patch new file mode 100644 index 0000000..d1e9576 --- /dev/null +++ b/SOURCES/pr3601.patch @@ -0,0 +1,38 @@ +# HG changeset patch +# User andrew +# Date 1529475043 -3600 +# Wed Jun 20 07:10:43 2018 +0100 +# Node ID f6341f4635dacb56678264d29a88cd052b74036b +# Parent 30520d5018b509b0ae68f5fcc9a5c540e3e5b2de +PR3601: Fix additional -Wreturn-type issues introduced by 8061651 + +diff --git openjdk.orig/hotspot/src/share/vm/prims/jvm.cpp openjdk/hotspot/src/share/vm/prims/jvm.cpp +--- openjdk.orig/hotspot/src/share/vm/prims/jvm.cpp ++++ openjdk/hotspot/src/share/vm/prims/jvm.cpp +@@ -835,7 +835,7 @@ + JVM_ENTRY(jboolean, JVM_KnownToNotExist(JNIEnv *env, jobject loader, const char *classname)) + JVMWrapper("JVM_KnownToNotExist"); + #if INCLUDE_CDS +- return ClassLoaderExt::known_to_not_exist(env, loader, classname, CHECK_(false)); ++ return ClassLoaderExt::known_to_not_exist(env, loader, classname, THREAD); + #else + return false; + #endif +@@ -845,7 +845,7 @@ + JVM_ENTRY(jobjectArray, JVM_GetResourceLookupCacheURLs(JNIEnv *env, jobject loader)) + JVMWrapper("JVM_GetResourceLookupCacheURLs"); + #if INCLUDE_CDS +- return ClassLoaderExt::get_lookup_cache_urls(env, loader, CHECK_NULL); ++ return ClassLoaderExt::get_lookup_cache_urls(env, loader, THREAD); + #else + return NULL; + #endif +@@ -855,7 +855,7 @@ + JVM_ENTRY(jintArray, JVM_GetResourceLookupCache(JNIEnv *env, jobject loader, const char *resource_name)) + JVMWrapper("JVM_GetResourceLookupCache"); + #if INCLUDE_CDS +- return ClassLoaderExt::get_lookup_cache(env, loader, resource_name, CHECK_NULL); ++ return ClassLoaderExt::get_lookup_cache(env, loader, resource_name, THREAD); + #else + return NULL; + #endif diff --git a/SOURCES/pr3634.patch b/SOURCES/pr3634.patch deleted file mode 100644 index caba2ac..0000000 --- a/SOURCES/pr3634.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git openjdk.orig/hotspot/src/share/vm/gc_implementation/shenandoah/shenandoah_globals.hpp openjdk/hotspot/src/share/vm/gc_implementation/shenandoah/shenandoah_globals.hpp ---- openjdk.orig/hotspot/src/share/vm/gc_implementation/shenandoah/shenandoah_globals.hpp -+++ openjdk/hotspot/src/share/vm/gc_implementation/shenandoah/shenandoah_globals.hpp -@@ -55,10 +55,10 @@ - "Size of the Shenandoah regions. " \ - "Determined automatically by default.") \ - \ -- experimental(uintx, ShenandoahMinRegionSize, 256 * K, \ -+ experimental(size_t, ShenandoahMinRegionSize, 256 * K, \ - "Minimum heap region size. ") \ - \ -- experimental(uintx, ShenandoahMaxRegionSize, 32 * M, \ -+ experimental(size_t, ShenandoahMaxRegionSize, 32 * M, \ - "Maximum heap region size. ") \ - \ - experimental(intx, ShenandoahHumongousThreshold, 100, \ diff --git a/SPECS/java-1.8.0-openjdk.spec b/SPECS/java-1.8.0-openjdk.spec index 460dab8..ef73442 100644 --- a/SPECS/java-1.8.0-openjdk.spec +++ b/SPECS/java-1.8.0-openjdk.spec @@ -34,6 +34,13 @@ %global include_debug_build 0 %endif +# On x86_64 and AArch64, we use the Shenandoah HotSpot +%ifarch x86_64 %{aarch64} +%global use_shenandoah_hotspot 1 +%else +%global use_shenandoah_hotspot 0 +%endif + %if %{include_debug_build} %global build_loop2 %{debug_suffix} %else @@ -168,13 +175,12 @@ %global origin openjdk %global top_level_dir_name %{origin} # note, following three variables are sedded from update_sources if used correctly. Hardcode them rather there. +%global project aarch64-port +%global repo jdk8u +%global revision aarch64-jdk8u181-b13 %global shenandoah_project aarch64-port %global shenandoah_repo jdk8u-shenandoah -%global shenandoah_revision aarch64-shenandoah-jdk8u191-b12 -# Define old aarch64/jdk8u tree variables for compatibility -%global project %{shenandoah_project} -%global repo %{shenandoah_repo} -%global revision %{shenandoah_revision} +%global shenandoah_revision aarch64-shenandoah-jdk8u181-b13 # eg # jdk8u60-b27 -> jdk8u60 or # aarch64-jdk8u60-b27 -> aarch64-jdk8u60 (dont forget spec escape % by %%) %global whole_update %(VERSION=%{revision}; echo ${VERSION%%-*}) @@ -789,8 +795,8 @@ Provides: java-%{javaver}-%{origin}-accessibility = %{epoch}:%{version}-%{releas %global __jar_repack 0 Name: java-%{javaver}-%{origin} -Version: %{javaver}.%{updatever}.%{buildver} -Release: 0%{?dist} +Version: %{javaver}.%{updatever} +Release: 7.%{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 @@ -818,15 +824,22 @@ Group: Development/Languages License: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib URL: http://openjdk.java.net/ +# aarch64-port now contains integration forest of both aarch64 and normal jdk +# Source from upstream OpenJDK8 project. To regenerate, use +# VERSION=%%{revision} FILE_NAME_ROOT=%%{project}-%%{repo}-${VERSION} +# REPO_ROOT= generate_source_tarball.sh +# where the source is obtained from http://hg.openjdk.java.net/%%{project}/%%{repo} +Source0: %{project}-%{repo}-%{revision}.tar.xz + # Shenandoah HotSpot # aarch64-port/jdk8u-shenandoah contains an integration forest of # OpenJDK 8u, the aarch64 port and Shenandoah # To regenerate, use: # VERSION=%%{shenandoah_revision} # FILE_NAME_ROOT=%%{shenandoah_project}-%%{shenandoah_repo}-${VERSION} -# REPO_ROOT= generate_source_tarball.sh +# REPO_ROOT= REPOS=hotspot generate_source_tarball.sh # where the source is obtained from http://hg.openjdk.java.net/%%{project}/%%{repo} -Source0: %{shenandoah_project}-%{shenandoah_repo}-%{shenandoah_revision}.tar.xz +Source1: %{shenandoah_project}-%{shenandoah_repo}-%{shenandoah_revision}.tar.xz # Custom README for -src subpackage Source2: README.src @@ -900,6 +913,8 @@ Patch523: pr2974-rh1337583.patch Patch528: pr3083-rh1346460.patch # RH1566890: CVE-2018-3639 Patch529: rh1566890_embargoed20180521.patch +# PR3601: Fix additional -Wreturn-type issues introduced by 8061651 +Patch530: pr3601.patch # Upstreamable debugging patches # Patches 204 and 205 stop the build adding .gnu_debuglink sections to unstripped files @@ -915,8 +930,8 @@ Patch102: %{name}-size_t.patch Patch103: pr3593-s390-size_t_format_flags.patch # x86: S8199936, PR3533: HotSpot generates code with unaligned stack, crashes on SSE operations (-mstackrealign workaround) Patch105: 8199936-pr3533-workaround.patch -# Zero: Fix more cases of missing return statements -Patch106: pr3458-rh1540242-zero.patch +# AArch64: PR3519: Fix further functions with a missing return value (AArch64) +Patch106: pr3519.patch # Patches which need backporting to 8u # S8073139, RH1191652; fix name of ppc64le architecture @@ -929,46 +944,65 @@ Patch7: include-all-srcs.patch Patch202: system-libpng.patch # 8042159: Allow using a system-installed lcms2 Patch203: system-lcms.patch -# PR2462: Backport "8074839: Resolve disabled warnings for libunpack and the unpack200 binary" +# S8074839, PR2462: Resolve disabled warnings for libunpack and the unpack200 binary # This fixes printf warnings that lead to build failure with -Werror=format-security from optflags Patch502: pr2462.patch -# S8148351, PR2842: Only display resolved symlink for compiler, do not change path -Patch506: pr2842-01.patch -Patch507: pr2842-02.patch # S8154313: Generated javadoc scattered all over the place 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 -# 8188030, PR3459, RH1484079: AWT java apps fail to start when some minimal fonts are present -Patch560: 8188030-pr3459-rh1484079.patch # 8197429, PR3546, RH153662{2,3}: 32 bit java app started via JNI crashes with larger stack sizes Patch561: 8197429-pr3546-rh1536622.patch # 8171000, PR3542, RH1402819: Robot.createScreenCapture() crashes in wayland mode Patch563: 8171000-pr3542-rh1402819.patch # 8197546, PR3542, RH1402819: Fix for 8171000 breaks Solaris + Linux builds Patch564: 8197546-pr3542-rh1402819.patch -# 8185723, PR3553: Zero: segfaults on Power PC 32-bit -Patch565: 8185723-pr3553.patch -# 8186461, PR3557: Zero's atomic_copy64() should use SPE instructions on linux-powerpcspe -Patch566: 8186461-pr3557.patch # PR3559: Use ldrexd for atomic reads on ARMv7. Patch567: pr3559.patch -# 8201509, PR3579: Zero: S390 31bit atomic_copy64 inline assembler is wrong -Patch569: 8201509-pr3579.patch # PR3591: Fix for bug 3533 doesn't add -mstackrealign to JDK code Patch571: pr3591.patch # 8184309, PR3596: Build warnings from GCC 7.1 on Fedora 26 Patch572: 8184309-pr3596.patch +# 8141570, PR3548: Fix Zero interpreter build for --disable-precompiled-headers +Patch573: 8141570-pr3548.patch +# 8143245, PR3548: Zero build requires disabled warnings +Patch574: 8143245-pr3548.patch +# 8197981, PR3548: Missing return statement in __sync_val_compare_and_swap_8 +Patch575: 8197981-pr3548.patch +# 8064786, PR3599: Fix debug build after 8062808: Turn on the -Wreturn-type warning +Patch576: 8064786-pr3599.patch +# 8062808, PR3548: Turn on the -Wreturn-type warning +Patch577: 8062808-pr3548.patch # 8207057, PR3613: Enable debug information for assembly code files Patch206: 8207057-pr3613-hotspot-assembler-debuginfo.patch # Patches appearing in 8u192 +# S8031668, PR2842: TOOLCHAIN_FIND_COMPILER unexpectedly resolves symbolic links +Patch506: pr2842-01.patch +# S8148351, PR2842: Only display resolved symlink for compiler, do not change path +Patch507: pr2842-02.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 +# 8188030, PR3459, RH1484079: AWT java apps fail to start when some minimal fonts are present +Patch560: 8188030-pr3459-rh1484079.patch # 8205104, PR3539, RH1548475: Pass EXTRA_LDFLAGS to HotSpot build Patch562: pr3539-rh1548475.patch +# 8185723, PR3553: Zero: segfaults on Power PC 32-bit +Patch565: 8185723-pr3553.patch +# 8186461, PR3557: Zero's atomic_copy64() should use SPE instructions on linux-powerpcspe +Patch566: 8186461-pr3557.patch +# 8201509, PR3579: Zero: S390 31bit atomic_copy64 inline assembler is wrong +Patch569: 8201509-pr3579.patch +# 8165489, PR3589: Missing G1 barrier in Unsafe_GetObjectVolatile +Patch570: 8165489-pr3589.patch +# 8075942, PR3602: ArrayIndexOutOfBoundsException in sun.java2d.pisces.Dasher.goTo +Patch578: 8075942-pr3602-rh1582032.patch +# 8203182, PR3603: Release session if initialization of SunPKCS11 Signature fails +Patch579: 8203182-pr3603-rh1568033.patch # 8206406, PR3610, RH1597825: StubCodeDesc constructor publishes partially-constructed objects on StubCodeDesc::_list Patch580: 8206406-pr3610-rh1597825.patch +# 8146115, PR3508, RH1463098: Improve docker container detection and resource configuration usage +Patch581: 8146115-pr3508-rh1463098.patch # 8206425: .gnu_debuglink sections added unconditionally when no debuginfo is stripped Patch204: 8206425-hotspot-remove-debuglink.patch @@ -987,8 +1021,6 @@ Patch539: pr2888.patch Patch540: pr3575-rh1567204.patch # Shenandoah fixes -# PR3634: Shenandoah still broken on s390 with aarch64-shenandoah-jdk8u181-b16 -Patch582: pr3634.patch # Non-OpenJDK fixes @@ -1256,6 +1288,16 @@ if [ $prioritylength -ne 7 ] ; then fi # For old patches ln -s %{top_level_dir_name} jdk8 +%if %{use_shenandoah_hotspot} +# On Shenandoah-supported architectures, replace HotSpot with +# the Shenandoah version +pushd %{top_level_dir_name} +tar -xf %{SOURCE1} +rm -rf hotspot +mv %{top_level_dir_name}/hotspot . +rm -rf %{top_level_dir_name} +popd +%endif cp %{SOURCE2} . @@ -1292,6 +1334,7 @@ sh %{SOURCE12} %patch103 # AArch64 fixes +%patch106 # x86 fixes %patch105 @@ -1301,9 +1344,6 @@ sh %{SOURCE12} %patch601 %patch602 -# Zero fixes. -%patch106 - # Upstreamable fixes %patch502 %patch504 @@ -1325,6 +1365,7 @@ sh %{SOURCE12} %patch526 %patch528 %patch529 +%patch530 %patch538 %patch560 %patch561 @@ -1337,7 +1378,15 @@ sh %{SOURCE12} %patch569 %patch571 %patch572 +%patch573 +%patch574 +%patch575 +%patch576 +%patch577 +%patch578 +%patch579 %patch580 +%patch581 # RPM-only fixes %patch525 @@ -1349,8 +1398,11 @@ sh %{SOURCE12} %patch534 %endif -# Shenandoah patches -%patch582 +# Shenandoah-only patches +%if %{use_shenandoah_hotspot} +%else +%patch570 +%endif # Extract systemtap tapsets %if %{with_systemtap} @@ -1989,137 +2041,108 @@ require "copy_jdk_configs.lua" %endif %changelog -* Tue Oct 09 2018 Andrew Hughes - 1:1.8.0.191.b12-0 -- Update to aarch64-shenandoah-jdk8u191-b12. -- Resolves: rhbz#1633817 - -* Tue Oct 02 2018 Andrew Hughes - 1:1.8.0.191.b10-0 -- Update to aarch64-shenandoah-jdk8u191-b10. -- Drop 8146115/PR3508/RH1463098 applied upstream. -- Resolves: rhbz#1633817 - -* Mon Oct 01 2018 Andrew Hughes - 1:1.8.0.181.b16-0 -- Add new Shenandoah patch PR3634 as upstream still fails on s390. -- Resolves: rhbz#1633817 - -* Mon Oct 01 2018 Andrew Hughes - 1:1.8.0.181.b16-0 -- Update to aarch64-shenandoah-jdk8u181-b16. -- Drop PR3619 & PR3620 Shenandoah patches which should now be fixed upstream. -- Resolves: rhbz#1633817 - -* Thu Aug 23 2018 Andrew Hughes - 1:1.8.0.181.b15-0 -- Move to single OpenJDK tarball build, based on aarch64/shenandoah-jdk8u. -- Update to aarch64-shenandoah-jdk8u181-b15. -- Drop 8165489-pr3589.patch which was only applied to aarch64/jdk8u builds. -- Move buildver to where it should be in the OpenJDK version. -- Split ppc64 Shenandoah fix into separate patch file with its own bug ID (PR3620). -- Update pr3539-rh1548475.patch to apply after 8187045. -- Resolves: rhbz#1633817 - -* Sat Aug 11 2018 Andrew Hughes - 1:1.8.0.181-4.b13 -- Remove unneeded functions from ppc shenandoahBarrierSet. -- Resolves: rhbz#1633817 - -* Wed Aug 08 2018 Andrew Hughes - 1:1.8.0.181-4.b13 -- Add missing shenandoahBarrierSet implementation for ppc64{be,le}. -- Resolves: rhbz#1633817 - -* Tue Aug 07 2018 Andrew Hughes - 1:1.8.0.181-4.b13 -- Fix wrong format specifiers in Shenandoah code. -- Resolves: rhbz#1633817 - -* Tue Aug 07 2018 Andrew Hughes - 1:1.8.0.181-4.b13 -- Avoid changing variable types to fix size_t, at least for now. -- Resolves: rhbz#1633817 - -* Tue Aug 07 2018 Andrew Hughes - 1:1.8.0.181-4.b13 -- More size_t fixes for Shenandoah. -- Resolves: rhbz#1633817 - -* Fri Aug 03 2018 Andrew Hughes - 1:1.8.0.181-4.b13 -- Add additional s390 size_t case for Shenandoah. -- Resolves: rhbz#1633817 - -* Fri Aug 03 2018 Andrew Hughes - 1:1.8.0.181-4.b13 -- Actually add the patch... -- Resolves: rhbz#1633817 - -* Fri Aug 03 2018 Andrew Hughes - 1:1.8.0.181-4.b13 -- Attempt to fix Shenandoah build issues on s390. -- Resolves: rhbz#1633817 - -* Mon Jul 23 2018 Andrew Hughes - 1:1.8.0.181-4.b13 -- Use the Shenandoah HotSpot on all architectures. -- Resolves: rhbz#1633817 - -* Mon Jul 16 2018 Andrew Hughes - 1:1.8.0.181-3.b13 +* Mon Jul 16 2018 Andrew Hughes - 1:1.8.0.181-7.b13 - Update to aarch64-jdk8u181-b13 and aarch64-shenandoah-jdk8u181-b13. - Remove 8187577/PR3578 now applied upstream. - Resolves: rhbz#1594249 -* Mon Jul 16 2018 Severin Gehwolf - 1:1.8.0.181-3.b04 +* Mon Jul 16 2018 Severin Gehwolf - 1:1.8.0.181-7.b04 - Fix hook to show hs_err*.log files on failures. - Resolves: rhbz#1594249 -* Mon Jul 16 2018 Severin Gehwolf - 1:1.8.0.181-3.b04 +* Mon Jul 16 2018 Severin Gehwolf - 1:1.8.0.181-7.b04 - Fix requires/provides filters for internal libs. See RHBZ#1590796 - Resolves: rhbz#1594249 -* Mon Jul 16 2018 Andrew Hughes - 1:1.8.0.181-3.b04 +* Mon Jul 16 2018 Andrew Hughes - 1:1.8.0.181-7.b04 - Update bug status and add missing bug IDs - Resolves: rhbz#1594249 -* Wed Jul 11 2018 Andrew Hughes - 1:1.8.0.181-2.b04 +* Thu Jul 12 2018 Andrew Hughes - 1:1.8.0.181-6.b04 +- Add "8146115, PR3508, RH1463098: Improve docker container detection and resource configuration usage" +- Resolves: rhbz#1463098 + +* Wed Jul 11 2018 Andrew Hughes - 1:1.8.0.181-5.b04 - Add "8206406, PR3610, RH1597825: StubCodeDesc constructor publishes partially-constructed objects on StubCodeDesc::_list" +- Resolves: rhbz#1597825 + +* Tue Jul 03 2018 Andrew Hughes - 1:1.8.0.181-4.b04 +- Mark bugs now backported to OpenJDK 8u upstream - Resolves: rhbz#1594249 -* Wed Jun 27 2018 Severin Gehwolf - 1:1.8.0.181-1.b04 +* Tue Jul 03 2018 Andrew Hughes - 1:1.8.0.181-4.b04 +- Backport "8203182, PR3603: Release session if initialization of SunPKCS11 Signature fails" +- Resolves: rhbz#1568033 + +* Tue Jul 03 2018 Andrew Hughes - 1:1.8.0.181-4.b04 +- Backport "8075942, PR3602: ArrayIndexOutOfBoundsException in sun.java2d.pisces.Dasher.goTo" +- Resolves: rhbz#1582032 + +* Wed Jun 27 2018 Severin Gehwolf - 1:1.8.0.181-3.b04 - Add hook to show hs_err*.log files on failures. - Resolves: rhbz#1594249 -* Wed Jun 27 2018 Andrew Hughes - 1:1.8.0.181-1.b04 +* Wed Jun 27 2018 Andrew Hughes - 1:1.8.0.181-3.b04 - Mark bugs that have been pushed to 8u upstream and are scheduled for a release. - Resolves: rhbz#1594249 -* Wed Jun 27 2018 Andrew Hughes - 1:1.8.0.181-1.b04 +* Wed Jun 27 2018 Andrew Hughes - 1:1.8.0.181-2.b04 - Update to aarch64-jdk8u181-b04 and aarch64-shenandoah-jdk8u181-b04. - Resolves: rhbz#1594249 -* Sun Jun 24 2018 Andrew Hughes - 1:1.8.0.181-0.b03 +* Sun Jun 24 2018 Andrew Hughes - 1:1.8.0.181-1.b03 - Update to aarch64-jdk8u181-b03 and aarch64-shenandoah-jdk8u181-b03. - Remove AArch64 patch for PR3458/RH1540242 as applied upstream. - Resolves: rhbz#1594249 -* Thu Jun 21 2018 Andrew Hughes - 1:1.8.0.172-4.b11 -- Read jssecacerts file prior to trying either cacerts file (system or local) (PR3575) -- Resolves: rhbz#1593737 - -* Thu Jun 21 2018 Andrew Hughes - 1:1.8.0.172-3.b11 +* Thu Jun 21 2018 Andrew Hughes - 1:1.8.0.172-11.b11 - Update Shenandoah tarball to fix TCK overflow failure. -- Resolves: rhbz#1588364 +- Resolves: rhbz#1573700 -* Wed Jun 20 2018 Jiri Vanek - 11:1.8.0.172-3.b11 +* Wed Jun 20 2018 Jiri Vanek - 11:1.8.0.172-10.b11 - jsa files changed to 444 to pass rpm verification - Fix reg-ex for filtering private libraries' provides/requires. -- Resolves: rhbz#1588364 +- Resolves: rhbz#1573700 + +* Wed Jun 20 2018 Andrew Hughes - 1:1.8.0.172-7.b11 +- Add additional fix (PR3601) to fix -Wreturn-type failures introduced by 8061651 +- Resolves: rhbz#1573700 + +* Tue Jun 19 2018 Andrew Hughes - 1:1.8.0.172-7.b11 +- Backport 8064786 (PR3601) to fix -Wreturn-type failure on debug builds. +- Resolves: rhbz#1573700 + +* Mon Jun 18 2018 Andrew Hughes - 1:1.8.0.172-7.b11 +- Bring in PR3519 from IcedTea 3.7.0 to fix remaining -Wreturn-type failure on AArch64. +- Resolves: rhbz#1573700 -* Wed Jun 13 2018 Andrew Hughes - 1:1.8.0.172-2.b11 +* Sat Jun 16 2018 Andrew Hughes - 1:1.8.0.172-7.b11 +- Sync with IcedTea 3.8.0 patches to use -Wreturn-type. +- Add backports of 8141570, 8143245, 8197981 & 8062808. +- Drop pr3458-rh1540242-zero.patch which is covered by 8143245. +- Resolves: rhbz#1573700 + +* Wed Jun 13 2018 Andrew Hughes - 1:1.8.0.172-6.b11 - Remove build flags exemption for aarch64 now the platform is more mature and can bootstrap OpenJDK with these flags. - Remove duplicate -fstack-protector-strong; it is provided by the RHEL cflags. -- Resolves: rhbz#1588364 +- Resolves: rhbz#1573700 + +* Mon Jun 11 2018 Andrew Hughes - 1:1.8.0.172-5.b11 +- Read jssecacerts file prior to trying either cacerts file (system or local) (PR3575) +- Resolves: rhbz#1567204 -* Mon Jun 11 2018 Andrew Hughes - 1:1.8.0.172-1.b11 +* Mon Jun 11 2018 Andrew Hughes - 1:1.8.0.172-5.b11 - Fix a number of bad bug identifiers (PR3546 should be PR3578, PR3456 should be PR3546) -- Resolves: rhbz#1588364 +- Resolves: rhbz#1573700 -* Mon Jun 11 2018 Andrew Hughes - 1:1.8.0.172-1.b11 +* Thu Jun 07 2018 Andrew Hughes - 1:1.8.0.172-4.b11 - Update Shenandoah tarball to include 2018-05-15 merge. - Split PR3458/RH1540242 fix into AArch64 & Zero sections, so former can be skipped on Shenandoah builds. - Drop PR3573 patch applied upstream. - Restrict 8187577 fix to non-Shenandoah builds, as it's included in the new tarball. -- Resolves: rhbz#1588364 +- Resolves: rhbz#1573700 -* Mon Jun 11 2018 Andrew Hughes - 1:1.8.0.172-1.b11 +* Thu Jun 07 2018 Andrew Hughes - 1:1.8.0.172-3.b11 - Sync with IcedTea 3.8.0. - Label architecture-specific fixes with architecture concerned - x86: S8199936, PR3533: HotSpot generates code with unaligned stack, crashes on SSE operations (-mstackrealign workaround) @@ -2134,50 +2157,52 @@ require "copy_jdk_configs.lua" - 8165489, PR3589: Missing G1 barrier in Unsafe_GetObjectVolatile - PR3591: Fix for bug 3533 doesn't add -mstackrealign to JDK code - 8184309, PR3596: Build warnings from GCC 7.1 on Fedora 26 -- Resolves: rhbz#1588364 +- Resolves: rhbz#1573700 -* Mon Jun 11 2018 Andrew Hughes - 1:1.8.0.172-0.b11 +* Wed May 16 2018 Jiri Vanek - 1:1.8.0.172-2.b11 +- added and applied 1566890_embargoed20180521.patch +- Resolves: rhbz#1578558 + +* Wed May 09 2018 Andrew Hughes - 1:1.8.0.172-1.b11 - Update to aarch64-jdk8u172-b11 and aarch64-shenandoah-jdk8u172-b11. -- Resolves: rhbz#1588364 +- Resolves: rhbz#1573700 -* Mon Jun 11 2018 Andrew Hughes - 1:1.8.0.171-9.b12 +* Thu May 03 2018 Andrew Hughes - 1:1.8.0.171-9.b12 - Update to aarch64-jdk8u171-b12 and aarch64-shenandoah-jdk8u171-b12. - Remove patch for 8200556/PR3566 as applied upstream. -- Resolves: rhbz#1588364 - -* Wed May 16 2018 Jiri Vanek - 1:1.8.0.171-8.b10 -- added and applied 1566890_embargoed20180521.patch -- Resolves: rhbz#1578555 - -* Tue Apr 17 2018 Andrew Hughes - 1:1.8.0.171-7.b10 -- Bump release number to be greater than RHEL 7.6 package to allow build with .el7 suffix -- Resolves: rhbz#1559766 +- Resolves: rhbz#1573700 -* Tue Apr 17 2018 Jiri Vanek - 1:1.8.0.171-4.b10 -- Rebuilding due to bad nss-softokn brew-root build override +* Wed Apr 18 2018 Andrew Hughes - 1:1.8.0.171-8.b10 +- Bump release to 8 so it is again greater than the 7.5.z version. - Resolves: rhbz#1559766 * Thu Apr 12 2018 Andrew Hughes - 1:1.8.0.171-3.b10 - Fix jconsole.desktop.in subcategory, replacing "Monitor" with "Profiling" (PR3550) - Resolves: rhbz#1559766 -* Thu Apr 12 2018 Andrew Hughes - 1:1.8.0.171-3.b10 +* Thu Apr 12 2018 Andrew Hughes - 1:1.8.0.171-6.b10 - Fix invalid license 'LGPL+' (should be LGPLv2+ for ECC code) and add misisng ones - Resolves: rhbz#1559766 -* Thu Apr 12 2018 Andrew Hughes - 1:1.8.0.171-2.b10 +* Thu Apr 12 2018 Andrew Hughes - 1:1.8.0.171-5.b10 - Add fix for TCK crash on Shenandoah. - Resolves: rhbz#1559766 -* Mon Apr 02 2018 Andrew Hughes - 1:1.8.0.171-1.b10 +* Mon Apr 02 2018 Andrew Hughes - 1:1.8.0.171-4.b10 - Cleanup from previous commit. - Remove unused upstream patch 8167200.hotspotAarch64.patch. - Resolves: rhbz#1559766 +- Resolves: rhbz#1536623 -* Thu Mar 29 2018 Jiri Vanek - 1:1.8.0.171-1.b10 +* Thu Mar 29 2018 Jiri Vanek - 1:1.8.0.171-3.b10 - Backported from fedora: aarch64BuildFailure.patch, rhbz_1536622-JDK8197429-jdk8.patch, rhbz_1540242.patch - Resolves: rhbz#1559766 +* Mon Mar 26 2018 Andrew Hughes - 1:1.8.0.171-1.b10 +- Bump release for RHEL 7.6 now branch is available. +- Resolves: rhbz#1538772 +- Resolves: rhbz#1559766 + * Sat Mar 24 2018 Andrew Hughes - 1:1.8.0.171-0.b10 - Update to aarch64-jdk8u171-b10 and aarch64-shenandoah-jdk8u171-b10. - Resolves: rhbz#1559766