Backport JDK-8241296 to fix segfaults when active_handles is NULL

Resolves: rhbz#1813550
This commit is contained in:
Andrew John Hughes 2020-03-20 14:22:42 +00:00
parent c374350ed3
commit 1b81e9374a
2 changed files with 31 additions and 1 deletions

View File

@ -234,7 +234,7 @@
%global updatever %(VERSION=%{whole_update}; echo ${VERSION##*u}) %global updatever %(VERSION=%{whole_update}; echo ${VERSION##*u})
# eg jdk8u60-b27 -> b27 # eg jdk8u60-b27 -> b27
%global buildver %(VERSION=%{version_tag}; echo ${VERSION##*-}) %global buildver %(VERSION=%{version_tag}; echo ${VERSION##*-})
%global rpmrelease 1 %global rpmrelease 2
# Define milestone (EA for pre-releases, GA ("fcs") for releases) # Define milestone (EA for pre-releases, GA ("fcs") for releases)
# Release will be (where N is usually a number starting at 1): # Release will be (where N is usually a number starting at 1):
# - 0.N%%{?extraver}%%{?dist} for EA releases, # - 0.N%%{?extraver}%%{?dist} for EA releases,
@ -1123,6 +1123,8 @@ Patch110: jdk8219772-extra_c_cxx_flags_not_picked_for_assembler_source.patch
# JDK-8218811: replace open by os::open in hotspot coding # JDK-8218811: replace open by os::open in hotspot coding
# This fixes a GCC 10 build issue # This fixes a GCC 10 build issue
Patch111: jdk8218811-perfMemory_linux.patch Patch111: jdk8218811-perfMemory_linux.patch
# JDK-8241296: Segfault in JNIHandleBlock::oops_do()
Patch112: jdk8241296-jnihandleblock_segfault.patch
############################################# #############################################
# #
@ -1548,6 +1550,7 @@ sh %{SOURCE12}
%patch577 %patch577
%patch110 %patch110
%patch111 %patch111
%patch112
# RPM-only fixes # RPM-only fixes
%patch539 %patch539
@ -2191,6 +2194,10 @@ require "copy_jdk_configs.lua"
%endif %endif
%changelog %changelog
* Fri Mar 20 2020 Andrew John Hughes <gnu.andrew@redhat.com> - 1:1.8.0.242.b08-2
- Backport JDK-8241296 to fix segfaults when active_handles is NULL
- Resolves: rhbz#1813550
* Fri Mar 13 2020 Andrew John Hughes <gnu.andrew@redhat.com> - 1:1.8.0.242.b08-1 * Fri Mar 13 2020 Andrew John Hughes <gnu.andrew@redhat.com> - 1:1.8.0.242.b08-1
- Sync SystemTap & desktop files with upstream IcedTea release 3.15.0, removing previous workarounds - Sync SystemTap & desktop files with upstream IcedTea release 3.15.0, removing previous workarounds

View File

@ -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 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
@@ -836,7 +836,9 @@
}
void Thread::oops_do(OopClosure* f, CLDClosure* cld_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);