From c3c9459f7302f63c9a3bea4c62e2562e50412200 Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Fri, 20 Mar 2020 12:11:01 +0000 Subject: [PATCH] Backport JDK-8241296 to fix segfaults when active_handles is NULL (RH1813550) --- java-11-openjdk.spec | 18 +++++++++++++++++- jdk8241296-jnihandleblock_segfault.patch | 23 +++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 jdk8241296-jnihandleblock_segfault.patch diff --git a/java-11-openjdk.spec b/java-11-openjdk.spec index bd19d05..67497c0 100644 --- a/java-11-openjdk.spec +++ b/java-11-openjdk.spec @@ -223,7 +223,7 @@ %global top_level_dir_name %{origin} %global minorver 0 %global buildver 2 -%global rpmrelease 1 +%global rpmrelease 2 #%%global tagsuffix "" # priority must be 8 digits in total; untill openjdk 1.8 we were using 18..... so when moving to 11 we had to add another digit %if %is_system_jdk @@ -1056,6 +1056,18 @@ Patch6: rh1566890-CVE_2018_3639-speculative_store_bypass.patch Patch7: pr3695-toggle_system_crypto_policy.patch # S390 ambiguous log2_intptr call Patch8: s390-8214206_fix.patch +# JDK-8241296: Segfault in JNIHandleBlock::oops_do() +Patch10: jdk8241296-jnihandleblock_segfault.patch + +############################################# +# +# Patches appearing in 11.0.8 +# +# This section includes patches which are present +# in the listed OpenJDK 11u release and should be +# able to be removed once that release is out +# and used by this RPM. +############################################# # JDK-8237879: make 4.3 breaks build Patch9: jdk8237879-make_4_3_build_fixes.patch @@ -1294,6 +1306,7 @@ pushd %{top_level_dir_name} %patch7 -p1 %patch8 -p1 %patch9 -p1 +%patch10 -p1 popd # openjdk %patch1000 @@ -1842,6 +1855,9 @@ require "copy_jdk_configs.lua" %changelog +* Fri Mar 20 2020 Andrew John Hughes - 1:11.0.7.2-0.2.ea +- Backport JDK-8241296 to fix segfaults when active_handles is NULL (RH1813550) + * Fri Mar 13 2020 Severin Gehwolf - 1:11.0.7.2-0.1.ea - Add patch for make 4.3 (JDK-8237879) diff --git a/jdk8241296-jnihandleblock_segfault.patch b/jdk8241296-jnihandleblock_segfault.patch new file mode 100644 index 0000000..d0920a8 --- /dev/null +++ b/jdk8241296-jnihandleblock_segfault.patch @@ -0,0 +1,23 @@ +# HG changeset patch +# User aph +# Date 1584629637 0 +# Thu Mar 19 14:53:57 2020 +0000 +# Node ID e96597ea4d672793ab205fd67009efed809fae11 +# Parent 0daa6b52ba568246e8f930138fb36f8f04d9fadd +8241296: Segfault in JNIHandleBlock::oops_do() +Reviewed-by: duke + +diff --git a/src/hotspot/share/runtime/thread.cpp b/src/hotspot/share/runtime/thread.cpp +--- a/src/hotspot/share/runtime/thread.cpp ++++ b/src/hotspot/share/runtime/thread.cpp +@@ -867,7 +867,9 @@ + } + + void Thread::oops_do(OopClosure* f, CodeBlobClosure* cf) { +- active_handles()->oops_do(f); ++ if (active_handles() != NULL) { ++ active_handles()->oops_do(f); ++ } + // Do oop for ThreadShadow + f->do_oop((oop*)&_pending_exception); + handle_area()->oops_do(f);