From 755d163e911bae96065298d0abddabf5b0eb3000 Mon Sep 17 00:00:00 2001 From: Kishor Kharbas Date: Tue, 22 Jan 2019 11:42:13 -0800 Subject: [PATCH 1/6] 8213695: gc/TestAllocateHeapAtMultiple.java is slow in some configs Reviewed-by: sangheki, kbarrett --- test/hotspot/jtreg/gc/TestAllocateHeapAtMultiple.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/hotspot/jtreg/gc/TestAllocateHeapAtMultiple.java b/test/hotspot/jtreg/gc/TestAllocateHeapAtMultiple.java index 9ba626c875c..8298bcf4ba7 100644 --- a/test/hotspot/jtreg/gc/TestAllocateHeapAtMultiple.java +++ b/test/hotspot/jtreg/gc/TestAllocateHeapAtMultiple.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2019, 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 @@ -53,9 +53,8 @@ public class TestAllocateHeapAtMultiple { "-Xmx32m -Xms32m -XX:+UseCompressedOops", // 1. With compressedoops enabled. "-Xmx32m -Xms32m -XX:-UseCompressedOops", // 2. With compressedoops disabled. "-Xmx32m -Xms32m -XX:HeapBaseMinAddress=3g", // 3. With user specified HeapBaseMinAddress. - "-Xmx4g -Xms4g", // 4. With larger heap size (UnscaledNarrowOop not possible). - "-Xmx4g -Xms4g -XX:+UseLargePages", // 5. Set UseLargePages. - "-Xmx4g -Xms4g -XX:+UseNUMA" // 6. Set UseNUMA. + "-Xmx32m -Xms32m -XX:+UseLargePages", // 4. Set UseLargePages. + "-Xmx32m -Xms32m -XX:+UseNUMA" // 5. Set UseNUMA. }; for(String extraOpts : extraOptsList) { From 17341dad94b2f36c0202ff0706ba5d2b9438ffed Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 22 Jan 2019 21:18:25 +0100 Subject: [PATCH 2/6] 8217467: Access barriers are missing in C2 intrinsic for Base64 Reviewed-by: thartmann, roland, rkennke, kvn --- src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp | 3 +++ src/hotspot/share/opto/library_call.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp index cbb35d36788..b32db7a8f35 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp @@ -1023,6 +1023,9 @@ void ShenandoahBarrierNode::verify(RootNode* root) { "sha512_implCompressMB", { { TypeFunc::Parms, ShenandoahLoad }, { TypeFunc::Parms+1, ShenandoahStore }, { -1, ShenandoahNone }, { -1, ShenandoahNone}, { -1, ShenandoahNone}, { -1, ShenandoahNone} }, + "encodeBlock", + { { TypeFunc::Parms, ShenandoahLoad }, { TypeFunc::Parms+3, ShenandoahStore }, { -1, ShenandoahNone }, + { -1, ShenandoahNone}, { -1, ShenandoahNone}, { -1, ShenandoahNone} }, }; if (call->is_call_to_arraycopystub()) { diff --git a/src/hotspot/share/opto/library_call.cpp b/src/hotspot/share/opto/library_call.cpp index 60d97657b00..afc0a622c3d 100644 --- a/src/hotspot/share/opto/library_call.cpp +++ b/src/hotspot/share/opto/library_call.cpp @@ -6260,6 +6260,11 @@ bool LibraryCallKit::inline_base64_encodeBlock() { Node* dp = argument(5); Node* isURL = argument(6); + src = must_be_not_null(src, true); + src = access_resolve(src, ACCESS_READ); + dest = must_be_not_null(dest, true); + dest = access_resolve(dest, ACCESS_WRITE); + Node* src_start = array_element_address(src, intcon(0), T_BYTE); assert(src_start, "source array is NULL"); Node* dest_start = array_element_address(dest, intcon(0), T_BYTE); From df5c74e9f6dae793a9b400eac9b01a6d7d02ca29 Mon Sep 17 00:00:00 2001 From: Mikael Vidstedt Date: Tue, 22 Jan 2019 16:35:57 -0800 Subject: [PATCH 3/6] 8217349: Problem list java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java Reviewed-by: iignatyev, mchung --- test/jdk/ProblemList.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 9acc0b8c6a0..3e34b3e089a 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -516,6 +516,7 @@ java/beans/XMLEncoder/Test6570354.java 8015593 macosx-all java/lang/StringCoding/CheckEncodings.sh 7008363 generic-all java/lang/ProcessHandle/InfoTest.java 8211847 aix-ppc64 +java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java 8151492 generic-all ############################################################################ From 0b3979f8feaa12030a617606eb66edf7ca6b7af1 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Tue, 22 Jan 2019 17:31:19 -0800 Subject: [PATCH 4/6] 8216965: crash in freetypeScaler.c CopyBW2Grey8 Reviewed-by: serb, mbaesken --- .../native/libfontmanager/freetypeScaler.c | 5 +- .../jdk/java/awt/FontClass/FontSize1Test.java | 56 +++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 test/jdk/java/awt/FontClass/FontSize1Test.java diff --git a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c index eb7766934d9..58a3df13f22 100644 --- a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c +++ b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c @@ -754,7 +754,10 @@ Java_sun_font_FreetypeFontScaler_getGlyphImageNative( /* generate bitmap if it is not done yet e.g. if algorithmic styling is performed and style was added to outline */ if (ftglyph->format == FT_GLYPH_FORMAT_OUTLINE) { - FT_Render_Glyph(ftglyph, FT_LOAD_TARGET_MODE(target)); + error = FT_Render_Glyph(ftglyph, FT_LOAD_TARGET_MODE(target)); + if (error != 0) { + return ptr_to_jlong(getNullGlyphImage()); + } } width = (UInt16) ftglyph->bitmap.width; diff --git a/test/jdk/java/awt/FontClass/FontSize1Test.java b/test/jdk/java/awt/FontClass/FontSize1Test.java new file mode 100644 index 00000000000..f0676b7221f --- /dev/null +++ b/test/jdk/java/awt/FontClass/FontSize1Test.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2019, 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 8216965 + * @summary verify no crash when rendering size 1 fonts + */ + +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.GraphicsEnvironment; +import java.awt.image.BufferedImage; + +public class FontSize1Test { + + static final String text = "abcdefghijklmnopqrstuvwxyz"; + + public static void main(String[] args) { + + BufferedImage bi = + new BufferedImage(100, 20, BufferedImage.TYPE_INT_RGB); + Graphics2D g2d = bi.createGraphics(); + Font af[] = + GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); + + for (Font f : af) { + System.out.println("Looking at font " + f); + g2d.setFont(f); + g2d.getFontMetrics().getWidths(); + g2d.drawString(text, 50, 10); + } + g2d.dispose(); + } + +} From 05a8750ec7090d116837eda05d3dd133697f2412 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 21 Jan 2019 10:17:28 +0100 Subject: [PATCH 5/6] 8217438: Adapt tools/launcher/Test7029048.java for Aix Reviewed-by: clanger, azeller --- test/jdk/tools/launcher/Test7029048.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/jdk/tools/launcher/Test7029048.java b/test/jdk/tools/launcher/Test7029048.java index f87eb9e702a..0e28584b320 100644 --- a/test/jdk/tools/launcher/Test7029048.java +++ b/test/jdk/tools/launcher/Test7029048.java @@ -154,12 +154,22 @@ public class Test7029048 extends TestHelper { } desc = "LD_LIBRARY_PATH should not be set (no libjvm.so)"; + if (TestHelper.isAIX) { + System.out.println("Skipping test case \"" + desc + + "\" because the Aix launcher adds the paths in any case."); + continue; + } break; case NO_DIR: if (dstLibDir.exists()) { recursiveDelete(dstLibDir); } desc = "LD_LIBRARY_PATH should not be set (no directory)"; + if (TestHelper.isAIX) { + System.out.println("Skipping test case \"" + desc + + "\" because the Aix launcher adds the paths in any case."); + continue; + } break; default: throw new RuntimeException("unknown case"); From cf554816d1952f722143e9d03ec669e80f955adf Mon Sep 17 00:00:00 2001 From: Tao Ji Date: Mon, 21 Jan 2019 13:31:42 +0800 Subject: [PATCH 6/6] 8217359: C2 compiler triggers SIGSEGV after transformation in ConvI2LNode::Ideal Reviewed-by: thartmann --- src/hotspot/share/opto/convertnode.cpp | 6 +- .../jtreg/compiler/c2/Test8217359.java | 74 +++++++++++++++++++ 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 test/hotspot/jtreg/compiler/c2/Test8217359.java diff --git a/src/hotspot/share/opto/convertnode.cpp b/src/hotspot/share/opto/convertnode.cpp index aaf0cc2fc61..dab3cfbac71 100644 --- a/src/hotspot/share/opto/convertnode.cpp +++ b/src/hotspot/share/opto/convertnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2019, 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 @@ -393,7 +393,11 @@ Node *ConvI2LNode::Ideal(PhaseGVN *phase, bool can_reshape) { assert(rxlo == (int)rxlo && rxhi == (int)rxhi, "x should not overflow"); assert(rylo == (int)rylo && ryhi == (int)ryhi, "y should not overflow"); Node* cx = phase->C->constrained_convI2L(phase, x, TypeInt::make(rxlo, rxhi, widen), NULL); + Node *hook = new Node(1); + hook->init_req(0, cx); // Add a use to cx to prevent him from dying Node* cy = phase->C->constrained_convI2L(phase, y, TypeInt::make(rylo, ryhi, widen), NULL); + hook->del_req(0); // Just yank bogus edge + hook->destruct(); switch (op) { case Op_AddI: return new AddLNode(cx, cy); case Op_SubI: return new SubLNode(cx, cy); diff --git a/test/hotspot/jtreg/compiler/c2/Test8217359.java b/test/hotspot/jtreg/compiler/c2/Test8217359.java new file mode 100644 index 00000000000..ca0d2cc7544 --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/Test8217359.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2019, Huawei Technologies Co. Ltd. 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 8217359 + * @summary C2 compiler triggers SIGSEGV after transformation in ConvI2LNode::Ideal + * + * @run main/othervm -XX:-TieredCompilation + * -XX:CompileCommand=compileonly,compiler.c2.Test8217359::test + * compiler.c2.Test8217359 + */ + +package compiler.c2; + +public class Test8217359 { + + public static int ival = 0; + public static long lsum = 0; + public static long lval = 0; + + public static void test() { + short s = -25632; + float f = 0.512F, f1 = 2.556F; + int i6 = 32547, i7 = 9, i8 = -9, i9 = 36, i10 = -223; + + for (i6 = 4; i6 < 182; i6++) { + i8 = 1; + while (++i8 < 17) { + f1 = 1; + do { + i7 += (182 + (f1 * f1)); + } while (++f1 < 1); + + Test8217359.ival += (i8 | Test8217359.ival); + } + } + + for (i9 = 9; i9 < 100; ++i9) { + i10 -= i6; + i10 >>= s; + i7 += (((i9 * i10) + i6) - Test8217359.lval); + } + + lsum += i6 + i7 + i8; + } + + public static void main(String[] args) { + for (int i = 0; i < 16000; i++) { + test(); + } + } + +}