diff --git a/1 b/1 new file mode 100644 index 0000000000000000000000000000000000000000..69083cd8c7608e79817f0d9fdb3e387a68443a83 --- /dev/null +++ b/1 @@ -0,0 +1,1955 @@ +# RPM conditionals so as to be able to dynamically produce + +# slowdebug/release builds. See: +# http://rpm.org/user_doc/conditional_builds.html +# +# Examples: +# +# Produce release *and* slowdebug builds on x86_64 (default): +# $ rpmbuild -ba java-1.8.0-openjdk.spec +# +# Produce only release builds (no slowdebug builds) on x86_64: +# $ rpmbuild -ba java-1.8.0-openjdk.spec --without slowdebug +# +# Only produce a release build on x86_64: +# $ fedpkg mockbuild --without slowdebug +# +# Only produce a debug build on x86_64: +# $ fedpkg local --without release +# +# Enable slowdebug builds by default on relevant arches. +%bcond_without slowdebug +# Enable release builds by default on relevant arches. +%bcond_without release + +# The -g flag says to use strip -g instead of full strip on DSOs or EXEs. +# This fixes detailed NMT and other tools which need minimal debug info. +%global _find_debuginfo_opts -g + +# note: parametrized macros are order-sensitive (unlike not-parametrized) even with normal macros +# also necessary when passing it as parameter to other macros. If not macro, then it is considered a switch +# see the difference between global and define: +# See https://github.com/rpm-software-management/rpm/issues/127 to comments at "pmatilai commented on Aug 18, 2017" +%global debug_suffix_unquoted -slowdebug +# quoted one for shell operations +%global debug_suffix "%{debug_suffix_unquoted}" +%global normal_suffix "" + +# if you want only debug build but providing java build only normal build but set normalbuild_parameter +%global debug_warning This package has full debug on. Install only in need and remove asap. +%global debug_on with full debug on +%global for_debug for packages with debug on + +%if %{with release} +%global include_normal_build 1 +%else +%global include_normal_build 0 +%endif + +%if %{include_normal_build} +%global build_loop1 %{normal_suffix} +%else +%global build_loop1 %{nil} +%endif + +# We have hardcoded list of files, which is appearing in alternatives, and in files +# in alternatives those are slaves and master, very often triplicated by man pages +# in files all masters and slaves are ghosted +# the ghosts are here to allow installation via query like `dnf install /usr/bin/java` +# you can list those files, with appropriate sections: cat *.spec | grep -e --install -e --slave -e post_ +# TODO - fix those hardcoded lists via single list +# those files ,must *NOT* be ghosted for *slowdebug* packages +# FIXME - if you are moving jshell or jlink or simialr, always modify all three sections +# you can check via headless and devels: +# rpm -ql --noghost java-11-openjdk-headless-11.0.1.13-8.fc29.x86_64.rpm | grep bin +# == rpm -ql java-11-openjdk-headless-slowdebug-11.0.1.13-8.fc29.x86_64.rpm | grep bin +# != rpm -ql java-11-openjdk-headless-11.0.1.13-8.fc29.x86_64.rpm | grep bin +# similarly for other %%{_jvmdir}/{jre,java} and %%{_javadocdir}/{java,java-zip} +%define is_release_build() %( if [ "%{?1}" == "%{debug_suffix_unquoted}" ]; then echo "0" ; else echo "1"; fi ) + +# while JDK is a techpreview(is_system_jdk=0), some provides are turned off. Once jdk stops to be an techpreview, move it to 1 +# as sytem JDK, we mean any JDK which can run whole system java stack without issues (like bytecode issues, module issues, dependencies...) +%global is_system_jdk 0 + +%global aarch64 aarch64 arm64 armv8 +%global jit_arches x86_64 %{aarch64} loongarch64 riscv64 +%global aot_arches x86_64 %{aarch64} + +# Set of architectures for which java has short vector math library (libsvml.so) +%global svml_arches x86_64 + +# By default, we build a debug build during main build on JIT architectures +%if %{with slowdebug} +%ifarch %{jit_arches} +%global include_debug_build 1 +%else +%global include_debug_build 0 +%endif +%endif + +%if %{include_debug_build} +%global build_loop2 %{debug_suffix} +%else +%global build_loop2 %{nil} +%endif + +# if you disable both builds, then the build fails +%global build_loop %{build_loop1} %{build_loop2} +# note: that order: normal_suffix debug_suffix, in case of both enabled +# is expected in one single case at the end of the build +%global rev_build_loop %{build_loop2} %{build_loop1} + +%ifarch %{jit_arches} +%global bootstrap_build 0 +%else +%global bootstrap_build 0 +%endif + +%if %{bootstrap_build} +%global release_targets bootcycle-images docs-zip +%else +%global release_targets images docs-zip +%endif +# No docs nor bootcycle for debug builds +%global debug_targets images + + +# Filter out flags from the optflags macro that cause problems with the OpenJDK build +# We filter out -O flags so that the optimization of HotSpot is not lowered from O3 to O2 +# We filter out -Wall which will otherwise cause HotSpot to produce hundreds of thousands of warnings (100+mb logs) +# We replace it with -Wformat (required by -Werror=format-security) and -Wno-cpp to avoid FORTIFY_SOURCE warnings +# We filter out -fexceptions as the HotSpot build explicitly does -fno-exceptions and it's otherwise the default for C++ +%global ourflags %(echo %optflags | sed -e 's|-Wall|-Wformat -Wno-cpp|' | sed -r -e 's|-O[0-9]*||') +%global ourcppflags %(echo %ourflags | sed -e 's|-fexceptions||') +%global ourldflags %{__global_ldflags} + +# With disabled nss is NSS deactivated, so NSS_LIBDIR can contain the wrong path +# the initialization must be here. Later the pkg-config have buggy behavior +# looks like openjdk RPM specific bug +# Always set this so the nss.cfg file is not broken +%global NSS_LIBDIR %(pkg-config --variable=libdir nss) + +# In some cases, the arch used by the JDK does +# not match _arch. +# Also, in some cases, the machine name used by SystemTap +# does not match that given by _build_cpu +%ifarch x86_64 +%global archinstall amd64 +%endif +%ifarch %{aarch64} +%global archinstall aarch64 +%endif +%ifarch loongarch64 +%global archinstall loongarch64 +%endif +%ifarch %{riscv64} +%global archinstall riscv64 +%endif +%ifnarch %{jit_arches} +%global archinstall %{_arch} +%endif + +%ifarch %{jit_arches} +%global with_systemtap 1 +%else +%global with_systemtap 0 +%endif + +# New Version-String scheme-style defines +# If you bump majorver, you must bump also vendor_version_string +%global majorver 17 +# Used via new version scheme. JDK 17 was +# GA'ed in March 2021 => 21.9 +%global vendor_version_string 21.9 +%global securityver 9 +# buildjdkver is usually same as %%{majorver}, +# but in time of bootstrap of next jdk, it is majorver-1, +# and this it is better to change it here, on single place +%global buildjdkver 17 +# We don't add any LTS designator for STS packages (Fedora and EPEL). +# We need to explicitly exclude EPEL as it would have the %%{rhel} macro defined. +%if 0%{?rhel} && !0%{?epel} + %global lts_designator "LTS" + %global lts_designator_zip -%{lts_designator} +%else + %global lts_designator "" + %global lts_designator_zip "" +%endif + +# Standard JPackage naming and versioning defines +%global origin openjdk +%global origin_nice OpenJDK +%global top_level_dir_name %{origin} +%global minorver 0 +%global buildver 8 +# priority must be 8 digits in total; up to openjdk 1.8, we were using 18..... so when we moved to 11, we had to add another digit +%if %is_system_jdk +%global priority %( printf '%02d%02d%02d%02d' %{majorver} %{minorver} %{securityver} %{buildver} ) +%else +# for techpreview, using 1, so slowdebugs can have 0 +%global priority %( printf '%08d' 1 ) +%endif +%global newjavaver %{majorver}.%{minorver}.%{securityver} + +# Strip up to 6 trailing zeros in newjavaver, as the JDK does, to get the correct version used in filenames +%global filever %(svn=%{newjavaver}; for i in 1 2 3 4 5 6 ; do svn=${svn%%.0} ; done; echo ${svn}) + +%global javaver %{majorver} + +# Define milestone (EA for pre-releases, GA for releases) +# Release will be (where N is usually a number starting at 1): +# - 0.N%%{?extraver}%%{?dist} for EA releases, +# - N%%{?extraver}{?dist} for GA releases +%global is_ga 1 +%if %{is_ga} +%global build_type GA +%global expected_ea_designator "" +%global ea_designator_zip "" +%global extraver %{nil} +%global eaprefix %{nil} +%else +%global build_type EA +%global expected_ea_designator ea +%global ea_designator_zip -%{expected_ea_designator} +%global extraver .%{expected_ea_designator} +%global eaprefix 0. +%endif + +# Define what url should JVM offer in case of a crash report +%global bug_url https://gitee.com/src-openeuler/openjdk-17/issues + +# parametrized macros are order-sensitive +%global compatiblename java-%{majorver}-%{origin} +%global fullversion %{compatiblename}-%{version}-%{release} +# images stub +%global jdkimage jdk +# output dir stub +%define buildoutputdir() %{expand:openjdk/build%{?1}} +# we can copy the javadoc to not arched dir, or make it not noarch +%define uniquejavadocdir() %{expand:%{fullversion}.%{_arch}%{?1}} +# main id and dir of this jdk +%define uniquesuffix() %{expand:%{fullversion}.%{_arch}%{?1}} + +%global _privatelibs libsplashscreen[.]so.*|libawt_xawt[.]so.*|libjli[.]so.*|libattach[.]so.*|libawt[.]so.*|libextnet[.]so.*|libawt_headless[.]so.*|libdt_socket[.]so.*|libfontmanager[.]so.*|libinstrument[.]so.*|libj2gss[.]so.*|libj2pcsc[.]so.*|libj2pkcs11[.]so.*|libjaas[.]so.*|libjavajpeg[.]so.*|libjdwp[.]so.*|libjimage[.]so.*|libjsound[.]so.*|liblcms[.]so.*|libmanagement[.]so.*|libmanagement_agent[.]so.*|libmanagement_ext[.]so.*|libmlib_image[.]so.*|libnet[.]so.*|libnio[.]so.*|libprefs[.]so.*|librmi[.]so.*|libsaproc[.]so.*|libsctp[.]so.*|libzip[.]so.* +%global _publiclibs libjawt[.]so.*|libjava[.]so.*|libjvm[.]so.*|libverify[.]so.*|libjsig[.]so.* +%if %is_system_jdk +%global __provides_exclude ^(%{_privatelibs})$ +%global __requires_exclude ^(%{_privatelibs})$ +%global __provides_exclude_from ^.*/%{uniquesuffix -- %{debug_suffix_unquoted}}/.*$ +%else +# Don't generate provides/requires for JDK provided shared libraries at all. +%global __provides_exclude ^(%{_privatelibs}|%{_publiclibs})$ +%global __requires_exclude ^(%{_privatelibs}|%{_publiclibs})$ +%endif + + +%global etcjavasubdir %{_sysconfdir}/java/java-%{javaver}-%{origin} +%define etcjavadir() %{expand:%{etcjavasubdir}/%{uniquesuffix -- %{?1}}} +# Standard JPackage directories and symbolic links. +%define sdkdir() %{expand:%{uniquesuffix -- %{?1}}} +%define jrelnk() %{expand:jre-%{javaver}-%{origin}-%{version}-%{release}.%{_arch}%{?1}} + +%define sdkbindir() %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/bin} +%define jrebindir() %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/bin} + +%global rpm_state_dir %{_localstatedir}/lib/rpm-state/ + +%if %{with_systemtap} +# Where to install systemtap tapset (links) +# We would like these to be in a package specific sub-dir, +# but currently systemtap doesn't support that, so we have to +# use the root tapset dir for now. To distinguish between 64 +# and 32 bit architectures we place the tapsets under the arch +# specific dir (note that systemtap will only pickup the tapset +# for the primary arch for now). Systemtap uses the machine name +# aka build_cpu as architecture specific directory name. +%global tapsetroot /usr/share/systemtap +%global tapsetdirttapset %{tapsetroot}/tapset/ +%global tapsetdir %{tapsetdirttapset}/%{_build_cpu} +%endif + +# not-duplicated scriptlets for normal/debug packages +%global update_desktop_icons /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : + + +%define post_script() %{expand: +update-desktop-database %{_datadir}/applications &> /dev/null || : +/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : +exit 0 +} + + +%define post_headless() %{expand: +%ifarch %{jit_arches} +# MetaspaceShared::generate_vtable_methods not implemented for PPC JIT +%ifnarch %{ppc64le} +%{jrebindir -- %{?1}}/java -Xshare:dump >/dev/null 2>/dev/null +%endif +%endif + +PRIORITY=%{priority} +if [ "%{?1}" == %{debug_suffix} ]; then + let PRIORITY=PRIORITY-1 +fi + +ext=.gz +alternatives \\ + --install %{_bindir}/java java %{jrebindir -- %{?1}}/java $PRIORITY --family %{name}.%{_arch} \\ + --slave %{_jvmdir}/jre jre %{_jvmdir}/%{sdkdir -- %{?1}} \\ + --slave %{_bindir}/keytool keytool %{jrebindir -- %{?1}}/keytool \\ + --slave %{_bindir}/rmiregistry rmiregistry %{jrebindir -- %{?1}}/rmiregistry \\ + --slave %{_mandir}/man1/java.1$ext java.1$ext \\ + %{_mandir}/man1/java-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/keytool.1$ext keytool.1$ext \\ + %{_mandir}/man1/keytool-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/rmiregistry.1$ext rmiregistry.1$ext \\ + %{_mandir}/man1/rmiregistry-%{uniquesuffix -- %{?1}}.1$ext + +for X in %{origin} %{javaver} ; do + alternatives --install %{_jvmdir}/jre-"$X" jre_"$X" %{_jvmdir}/%{sdkdir -- %{?1}} $PRIORITY --family %{name}.%{_arch} +done + +update-alternatives --install %{_jvmdir}/jre-%{javaver}-%{origin} jre_%{javaver}_%{origin} %{_jvmdir}/%{jrelnk -- %{?1}} $PRIORITY --family %{name}.%{_arch} + + +update-desktop-database %{_datadir}/applications &> /dev/null || : +/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : + +# see pretrans where this file is declared +# also see that pretrans is only for non-debug +if [ ! "%{?1}" == %{debug_suffix} ]; then + if [ -f %{_libexecdir}/copy_jdk_configs_fixFiles.sh ] ; then + sh %{_libexecdir}/copy_jdk_configs_fixFiles.sh %{rpm_state_dir}/%{name}.%{_arch} %{_jvmdir}/%{sdkdir -- %{?1}} + fi +fi + +exit 0 +} + +%define postun_script() %{expand: +update-desktop-database %{_datadir}/applications &> /dev/null || : +if [ $1 -eq 0 ] ; then + /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null + %{update_desktop_icons} +fi +exit 0 +} + + +%define postun_headless() %{expand: + alternatives --remove java %{jrebindir -- %{?1}}/java + alternatives --remove jre_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}} + alternatives --remove jre_%{javaver} %{_jvmdir}/%{sdkdir -- %{?1}} + alternatives --remove jre_%{javaver}_%{origin} %{_jvmdir}/%{jrelnk -- %{?1}} +} + +%define posttrans_script() %{expand: +%{update_desktop_icons} +} + +%define post_devel() %{expand: + +PRIORITY=%{priority} +if [ "%{?1}" == %{debug_suffix} ]; then + let PRIORITY=PRIORITY-1 +fi + +ext=.gz +alternatives \\ + --install %{_bindir}/javac javac %{sdkbindir -- %{?1}}/javac $PRIORITY --family %{name}.%{_arch} \\ + --slave %{_jvmdir}/java java_sdk %{_jvmdir}/%{sdkdir -- %{?1}} \\ + --slave %{_bindir}/jlink jlink %{sdkbindir -- %{?1}}/jlink \\ + --slave %{_bindir}/jmod jmod %{sdkbindir -- %{?1}}/jmod \\ +%ifarch %{jit_arches} +%ifnarch s390x + --slave %{_bindir}/jhsdb jhsdb %{sdkbindir -- %{?1}}/jhsdb \\ +%endif +%endif + --slave %{_bindir}/jar jar %{sdkbindir -- %{?1}}/jar \\ + --slave %{_bindir}/jarsigner jarsigner %{sdkbindir -- %{?1}}/jarsigner \\ + --slave %{_bindir}/javadoc javadoc %{sdkbindir -- %{?1}}/javadoc \\ + --slave %{_bindir}/javap javap %{sdkbindir -- %{?1}}/javap \\ + --slave %{_bindir}/jcmd jcmd %{sdkbindir -- %{?1}}/jcmd \\ + --slave %{_bindir}/jconsole jconsole %{sdkbindir -- %{?1}}/jconsole \\ + --slave %{_bindir}/jdb jdb %{sdkbindir -- %{?1}}/jdb \\ + --slave %{_bindir}/jdeps jdeps %{sdkbindir -- %{?1}}/jdeps \\ + --slave %{_bindir}/jdeprscan jdeprscan %{sdkbindir -- %{?1}}/jdeprscan \\ + --slave %{_bindir}/jfr jfr %{sdkbindir -- %{?1}}/jfr \\ + --slave %{_bindir}/jimage jimage %{sdkbindir -- %{?1}}/jimage \\ + --slave %{_bindir}/jinfo jinfo %{sdkbindir -- %{?1}}/jinfo \\ + --slave %{_bindir}/jmap jmap %{sdkbindir -- %{?1}}/jmap \\ + --slave %{_bindir}/jps jps %{sdkbindir -- %{?1}}/jps \\ + --slave %{_bindir}/jpackage jpackage %{sdkbindir -- %{?1}}/jpackage \\ + --slave %{_bindir}/jrunscript jrunscript %{sdkbindir -- %{?1}}/jrunscript \\ + --slave %{_bindir}/jshell jshell %{sdkbindir -- %{?1}}/jshell \\ + --slave %{_bindir}/jstack jstack %{sdkbindir -- %{?1}}/jstack \\ + --slave %{_bindir}/jstat jstat %{sdkbindir -- %{?1}}/jstat \\ + --slave %{_bindir}/jstatd jstatd %{sdkbindir -- %{?1}}/jstatd \\ + --slave %{_bindir}/serialver serialver %{sdkbindir -- %{?1}}/serialver \\ + --slave %{_mandir}/man1/jar.1$ext jar.1$ext \\ + %{_mandir}/man1/jar-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jarsigner.1$ext jarsigner.1$ext \\ + %{_mandir}/man1/jarsigner-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/javac.1$ext javac.1$ext \\ + %{_mandir}/man1/javac-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/javadoc.1$ext javadoc.1$ext \\ + %{_mandir}/man1/javadoc-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/javap.1$ext javap.1$ext \\ + %{_mandir}/man1/javap-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jcmd.1$ext jcmd.1$ext \\ + %{_mandir}/man1/jcmd-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jconsole.1$ext jconsole.1$ext \\ + %{_mandir}/man1/jconsole-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jdb.1$ext jdb.1$ext \\ + %{_mandir}/man1/jdb-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jdeps.1$ext jdeps.1$ext \\ + %{_mandir}/man1/jdeps-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jinfo.1$ext jinfo.1$ext \\ + %{_mandir}/man1/jinfo-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jmap.1$ext jmap.1$ext \\ + %{_mandir}/man1/jmap-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jps.1$ext jps.1$ext \\ + %{_mandir}/man1/jps-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jpackage.1$ext jpackage.1$ext \\ + %{_mandir}/man1/jpackage-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jrunscript.1$ext jrunscript.1$ext \\ + %{_mandir}/man1/jrunscript-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jstack.1$ext jstack.1$ext \\ + %{_mandir}/man1/jstack-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jstat.1$ext jstat.1$ext \\ + %{_mandir}/man1/jstat-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/jstatd.1$ext jstatd.1$ext \\ + %{_mandir}/man1/jstatd-%{uniquesuffix -- %{?1}}.1$ext \\ + --slave %{_mandir}/man1/serialver.1$ext serialver.1$ext \\ + %{_mandir}/man1/serialver-%{uniquesuffix -- %{?1}}.1$ext + +for X in %{origin} %{javaver} ; do + alternatives \\ + --install %{_jvmdir}/java-"$X" java_sdk_"$X" %{_jvmdir}/%{sdkdir -- %{?1}} $PRIORITY --family %{name}.%{_arch} +done + +update-alternatives --install %{_jvmdir}/java-%{javaver}-%{origin} java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}} $PRIORITY --family %{name}.%{_arch} + +update-desktop-database %{_datadir}/applications &> /dev/null || : +/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : + +exit 0 +} + +%define postun_devel() %{expand: + alternatives --remove javac %{sdkbindir -- %{?1}}/javac + alternatives --remove java_sdk_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}} + alternatives --remove java_sdk_%{javaver} %{_jvmdir}/%{sdkdir -- %{?1}} + alternatives --remove java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}} + +update-desktop-database %{_datadir}/applications &> /dev/null || : + +if [ $1 -eq 0 ] ; then + /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null + %{update_desktop_icons} +fi +exit 0 +} + +%define posttrans_devel() %{expand: +%{update_desktop_icons} +} + +%define post_javadoc() %{expand: + +PRIORITY=%{priority} +if [ "%{?1}" == %{debug_suffix} ]; then + let PRIORITY=PRIORITY-1 +fi + +alternatives \\ + --install %{_javadocdir}/java javadocdir %{_javadocdir}/%{uniquejavadocdir -- %{?1}}/api \\ + $PRIORITY --family %{name} +exit 0 +} + +%define postun_javadoc() %{expand: + alternatives --remove javadocdir %{_javadocdir}/%{uniquejavadocdir -- %{?1}}/api +exit 0 +} + +%define post_javadoc_zip() %{expand: + +PRIORITY=%{priority} +if [ "%{?1}" == %{debug_suffix} ]; then + let PRIORITY=PRIORITY-1 +fi + +alternatives \\ + --install %{_javadocdir}/java-zip javadoczip %{_javadocdir}/%{uniquejavadocdir -- %{?1}}.zip \\ + $PRIORITY --family %{name} +exit 0 +} + +%define postun_javadoc_zip() %{expand: + alternatives --remove javadoczip %{_javadocdir}/%{uniquejavadocdir -- %{?1}}.zip +exit 0 +} + +%define files_jre() %{expand: +%{_datadir}/icons/hicolor/*x*/apps/java-%{javaver}-%{origin}.png +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsplashscreen.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libawt_xawt.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjawt.so +} + + +%define files_jre_headless() %{expand: +%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal +%dir %{_sysconfdir}/.java/.systemPrefs +%dir %{_sysconfdir}/.java +%dir %{_jvmdir}/%{sdkdir -- %{?1}} +%{_jvmdir}/%{sdkdir -- %{?1}}/release +%{_jvmdir}/%{jrelnk -- %{?1}} +%dir %{_jvmdir}/%{sdkdir -- %{?1}}/bin +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/java +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/keytool +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/rmiregistry +%dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib +%ifarch %{jit_arches} +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/classlist +%endif +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jexec +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jspawnhelper +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jrt-fs.jar +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/modules +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/psfont.properties.ja +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/psfontj2d.properties +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/tzdb.dat +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjli.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jvm.cfg +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libattach.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libawt.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libextnet.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjsig.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libawt_headless.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libdt_socket.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libfontmanager.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libinstrument.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libj2gss.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libj2pcsc.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libj2pkcs11.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjaas.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjava.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjavajpeg.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjdwp.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjimage.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjsound.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/liblcms.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libmanagement.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libmanagement_agent.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libmanagement_ext.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libmlib_image.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libnet.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libnio.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libprefs.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/librmi.so +%ifarch %{jit_arches} +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsaproc.so +%endif +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsctp.so +%ifarch %{svml_arches} +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjsvml.so +%endif +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsyslookup.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libverify.so +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libzip.so +%dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib/jfr +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jfr/default.jfc +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jfr/profile.jfc +%{_mandir}/man1/java-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/keytool-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/rmiregistry-%{uniquesuffix -- %{?1}}.1* +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/server/ +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/client/ +%attr(444, root, root) %ghost %{_jvmdir}/%{sdkdir -- %{?1}}/lib/server/classes.jsa +%attr(444, root, root) %ghost %{_jvmdir}/%{sdkdir -- %{?1}}/lib/client/classes.jsa +%dir %{etcjavasubdir} +%dir %{etcjavadir -- %{?1}} +%dir %{etcjavadir -- %{?1}}/lib +%dir %{etcjavadir -- %{?1}}/lib/security +%{etcjavadir -- %{?1}}/lib/security/cacerts +%dir %{etcjavadir -- %{?1}}/conf +%dir %{etcjavadir -- %{?1}}/conf/sdp +%dir %{etcjavadir -- %{?1}}/conf/management +%dir %{etcjavadir -- %{?1}}/conf/security +%dir %{etcjavadir -- %{?1}}/conf/security/policy +%dir %{etcjavadir -- %{?1}}/conf/security/policy/limited +%dir %{etcjavadir -- %{?1}}/conf/security/policy/unlimited +%config(noreplace) %{etcjavadir -- %{?1}}/lib/security/default.policy +%config(noreplace) %{etcjavadir -- %{?1}}/lib/security/blocked.certs +%config(noreplace) %{etcjavadir -- %{?1}}/lib/security/public_suffix_list.dat +%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/limited/exempt_local.policy +%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/limited/default_local.policy +%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/limited/default_US_export.policy +%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/unlimited/default_local.policy +%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/unlimited/default_US_export.policy + %{etcjavadir -- %{?1}}/conf/security/policy/README.txt +%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/java.policy +%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/java.security +%config(noreplace) %{etcjavadir -- %{?1}}/conf/logging.properties +%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/nss.cfg +%config(noreplace) %{etcjavadir -- %{?1}}/conf/management/jmxremote.access +# these are config templates, thus not config-noreplace +%config %{etcjavadir -- %{?1}}/conf/management/jmxremote.password.template +%config %{etcjavadir -- %{?1}}/conf/sdp/sdp.conf.template +%config(noreplace) %{etcjavadir -- %{?1}}/conf/management/management.properties +%config(noreplace) %{etcjavadir -- %{?1}}/conf/net.properties +%config(noreplace) %{etcjavadir -- %{?1}}/conf/sound.properties +%{_jvmdir}/%{sdkdir -- %{?1}}/conf +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/security +%if %is_system_jdk +%if %{is_release_build -- %{?1}} +%ghost %{_bindir}/java +%ghost %{_jvmdir}/jre +%ghost %{_bindir}/keytool +%ghost %{_bindir}/pack200 +%ghost %{_bindir}/rmid +%ghost %{_bindir}/rmiregistry +%ghost %{_bindir}/unpack200 +%ghost %{_jvmdir}/jre-%{origin} +%ghost %{_jvmdir}/jre-%{javaver} +%ghost %{_jvmdir}/jre-%{javaver}-%{origin} +%endif +%endif +} + +%define files_devel() %{expand: +%dir %{_jvmdir}/%{sdkdir -- %{?1}}/bin +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jar +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jarsigner +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/javac +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/javadoc +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/javap +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jconsole +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jcmd +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jfr +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jdb +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jdeps +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jdeprscan +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jimage +%ifarch %{jit_arches} +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jhsdb +%{_mandir}/man1/jhsdb-%{uniquesuffix -- %{?1}}.1.gz +%endif +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jinfo +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jlink +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jmap +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jmod +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jps +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jpackage +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jrunscript +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jshell +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jstack +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jstat +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jstatd +%{_jvmdir}/%{sdkdir -- %{?1}}/bin/serialver +%{_jvmdir}/%{sdkdir -- %{?1}}/include +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/ct.sym +%if %{with_systemtap} +%{_jvmdir}/%{sdkdir -- %{?1}}/tapset +%endif +%{_datadir}/applications/*jconsole%{?1}.desktop +%{_mandir}/man1/jar-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jarsigner-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/javac-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/javadoc-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/javap-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jconsole-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jcmd-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jdb-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jdeps-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jinfo-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jmap-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jps-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jpackage-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jrunscript-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jstack-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jstat-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jstatd-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/serialver-%{uniquesuffix -- %{?1}}.1* +%{_mandir}/man1/jdeprscan-%{uniquesuffix -- %{?1}}.1.gz +%{_mandir}/man1/jlink-%{uniquesuffix -- %{?1}}.1.gz +%{_mandir}/man1/jmod-%{uniquesuffix -- %{?1}}.1.gz +%{_mandir}/man1/jshell-%{uniquesuffix -- %{?1}}.1.gz +%{_mandir}/man1/jfr-%{uniquesuffix -- %{?1}}.1.gz + +%if %{with_systemtap} +%dir %{tapsetroot} +%dir %{tapsetdirttapset} +%dir %{tapsetdir} +%{tapsetdir}/*%{_arch}%{?1}.stp +%endif +%if %is_system_jdk +%if %{is_release_build -- %{?1}} +%ghost %{_bindir}/javac +%ghost %{_jvmdir}/java +%ghost %{_bindir}/jlink +%ghost %{_bindir}/jmod +%ghost %{_bindir}/jhsdb +%ghost %{_bindir}/jar +%ghost %{_bindir}/jarsigner +%ghost %{_bindir}/javadoc +%ghost %{_bindir}/javap +%ghost %{_bindir}/jcmd +%ghost %{_bindir}/jconsole +%ghost %{_bindir}/jdb +%ghost %{_bindir}/jdeps +%ghost %{_bindir}/jdeprscan +%ghost %{_bindir}/jimage +%ghost %{_bindir}/jinfo +%ghost %{_bindir}/jmap +%ghost %{_bindir}/jps +%ghost %{_bindir}/jrunscript +%ghost %{_bindir}/jshell +%ghost %{_bindir}/jstack +%ghost %{_bindir}/jstat +%ghost %{_bindir}/jstatd +%ghost %{_bindir}/serialver +%ghost %{_jvmdir}/java-%{origin} +%ghost %{_jvmdir}/java-%{javaver} +%ghost %{_jvmdir}/java-%{javaver}-%{origin} +%endif +%endif +} + +%define files_jmods() %{expand: +%{_jvmdir}/%{sdkdir -- %{?1}}/jmods +} + +%define files_demo() %{expand: +%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal +%{_jvmdir}/%{sdkdir -- %{?1}}/demo +%{_jvmdir}/%{sdkdir -- %{?1}}/sample +} + +%define files_src() %{expand: +%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal +%{_jvmdir}/%{sdkdir -- %{?1}}/lib/src.zip +} + +%define files_javadoc() %{expand: +%doc %{_javadocdir}/%{uniquejavadocdir -- %{?1}} +%license %{buildoutputdir -- %{?1}}/images/%{jdkimage}/legal +%if %is_system_jdk +%if %{is_release_build -- %{?1}} +%ghost %{_javadocdir}/java +%endif +%endif +} + +%define files_javadoc_zip() %{expand: +%doc %{_javadocdir}/%{uniquejavadocdir -- %{?1}}.zip +%license %{buildoutputdir -- %{?1}}/images/%{jdkimage}/legal +%if %is_system_jdk +%if %{is_release_build -- %{?1}} +%ghost %{_javadocdir}/java-zip +%endif +%endif +} + +# not-duplicated requires/provides/obsoletes for normal/debug packages +%define java_rpo() %{expand: +Requires: fontconfig%{?_isa} +Requires: xorg-x11-fonts-Type1 +# Requires rest of java +Requires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release} +OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release} +# for java-X-openjdk package's desktop binding +Recommends: gtk3%{?_isa} + +Provides: java-%{javaver}-%{origin}%{?1} = %{epoch}:%{version}-%{release} + +# Standard JPackage base provides +Provides: jre-%{javaver}%{?1} = %{epoch}:%{version}-%{release} +Provides: jre-%{javaver}-%{origin}%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}%{?1} = %{epoch}:%{version}-%{release} +%if %is_system_jdk +Provides: java-%{origin}%{?1} = %{epoch}:%{version}-%{release} +Provides: jre-%{origin}%{?1} = %{epoch}:%{version}-%{release} +Provides: java%{?1} = %{epoch}:%{version}-%{release} +Provides: jre%{?1} = %{epoch}:%{version}-%{release} +%endif +} + +%define java_headless_rpo() %{expand: +# Require /etc/pki/java/cacerts +Requires: ca-certificates +# Require javapackages-filesystem for ownership of /usr/lib/jvm/ and macros +Requires: javapackages-filesystem +# Require zone-info data provided by tzdata-java sub-package +Requires: tzdata-java >= 2015d +# tool to copy jdk's configs - should be Recommends only, but then only dnf/yum enforce it, +# not rpm transaction and so no configs are persisted when pure rpm -u is run. It may be +# considered as regression +Requires: copy-jdk-configs >= 3.3 +OrderWithRequires: copy-jdk-configs +# for printing support +Requires: cups-libs +# Post requires alternatives to install tool alternatives +Requires(post): %{_sbindir}/alternatives +# chkconfig does not contain alternatives anymore +# Postun requires alternatives to uninstall tool alternatives +Requires(postun): %{_sbindir}/alternatives +# for optional support of kernel stream control, card reader and printing bindings +Suggests: lksctp-tools%{?_isa}, pcsc-lite-libs%{?_isa} + +# Standard JPackage base provides +Provides: jre-%{javaver}-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release} +Provides: jre-%{javaver}-headless%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-headless%{?1} = %{epoch}:%{version}-%{release} +%if %is_system_jdk +Provides: java-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release} +Provides: jre-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release} +Provides: jre-headless%{?1} = %{epoch}:%{version}-%{release} +Provides: java-headless%{?1} = %{epoch}:%{version}-%{release} +%endif +} + +%define java_devel_rpo() %{expand: +# Requires base package +Requires: %{name}%{?1}%{?_isa} = %{epoch}:%{version}-%{release} +OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release} +# Post requires alternatives to install tool alternatives +Requires(post): %{_sbindir}/alternatives +# chkconfig does not contain alternatives anymore +# Postun requires alternatives to uninstall tool alternatives +Requires(postun): %{_sbindir}/alternatives + +# Standard JPackage devel provides +Provides: java-sdk-%{javaver}-%{origin}%{?1} = %{epoch}:%{version}-%{release} +Provides: java-sdk-%{javaver}%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-devel%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-%{origin}-devel%{?1} = %{epoch}:%{version}-%{release} +%if %is_system_jdk +Provides: java-devel-%{origin}%{?1} = %{epoch}:%{version}-%{release} +Provides: java-sdk-%{origin}%{?1} = %{epoch}:%{version}-%{release} +Provides: java-devel%{?1} = %{epoch}:%{version}-%{release} +Provides: java-sdk%{?1} = %{epoch}:%{version}-%{release} +%endif +} + +%define java_jmods_rpo() %{expand: +# Requires devel package +# as jmods are bytecode, they should be OK without any _isa +Requires: %{name}-devel%{?1} = %{epoch}:%{version}-%{release} +OrderWithRequires: %{name}-headless%{?1} = %{epoch}:%{version}-%{release} + +Provides: java-%{javaver}-jmods%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-%{origin}-jmods%{?1} = %{epoch}:%{version}-%{release} +%if %is_system_jdk +Provides: java-jmods%{?1} = %{epoch}:%{version}-%{release} +%endif +} + +%define java_demo_rpo() %{expand: +Requires: %{name}%{?1}%{?_isa} = %{epoch}:%{version}-%{release} +OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release} + +Provides: java-%{javaver}-demo%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-%{origin}-demo%{?1} = %{epoch}:%{version}-%{release} +%if %is_system_jdk +Provides: java-demo%{?1} = %{epoch}:%{version}-%{release} +%endif +} + +%define java_javadoc_rpo() %{expand: +OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release} +# Post requires alternatives to install javadoc alternative +Requires(post): %{_sbindir}/alternatives +# chkconfig does not contain alternatives anymore +# Postun requires alternatives to uninstall javadoc alternative +Requires(postun): %{_sbindir}/alternatives + +# Standard JPackage javadoc provides +Provides: java-%{javaver}-javadoc%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-%{origin}-javadoc%{?1} = %{epoch}:%{version}-%{release} +%if %is_system_jdk +Provides: java-javadoc%{?1} = %{epoch}:%{version}-%{release} +%endif +} + +%define java_src_rpo() %{expand: +Requires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release} + +# Standard JPackage sources provides +Provides: java-%{javaver}-src%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-%{origin}-src%{?1} = %{epoch}:%{version}-%{release} +%if %is_system_jdk +Provides: java-src%{?1} = %{epoch}:%{version}-%{release} +%endif +} + +# Prevent brp-java-repack-jars from being run +%global __jar_repack 0 + +Name: java-%{javaver}-%{origin} +Version: %{newjavaver}.%{buildver} +Release: 1 + +# 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 +# situation where in-the-wild java-1.5.0-ibm packages provided "java = +# 1:1.5.0". In RPM terms, "1.6.0 < 1:1.5.0" since 1.6.0 is +# interpreted as 0:1.6.0. So the "java >= 1.6.0" requirement would be +# satisfied by the 1:1.5.0 packages. Thus we need to set the epoch in +# JDK package >= 1.6.0 to 1, and packages referring to JDK virtual +# provides >= 1.6.0 must specify the epoch, "java >= 1:1.6.0". + +Epoch: 1 +Summary: %{origin_nice} Runtime Environment %{majorver} + +# HotSpot code is licensed under GPLv2 +# JDK library code is licensed under GPLv2 with the Classpath exception +# The Apache license is used in code taken from Apache projects (primarily xalan & xerces) +# DOM levels 2 & 3 and the XML digital signature schemas are licensed under the W3C Software License +# The JSR166 concurrency code is in the public domain +# The BSD and MIT licenses are used for a number of third-party libraries (see ADDITIONAL_LICENSE_INFO) +# The OpenJDK source tree includes: +# - JPEG library (IJG), zlib & libpng (zlib), giflib (MIT), harfbuzz (ISC), +# - freetype (FTL), jline (BSD) and LCMS (MIT) +# - jquery (MIT), jdk.crypto.cryptoki PKCS 11 wrapper (RSA) +# - public_suffix_list.dat from publicsuffix.org (MPLv2.0) +# The test code includes copies of NSS under the Mozilla Public License v2.0 +# The PCSClite headers are under a BSD with advertising license +# The elliptic curve cryptography (ECC) source code is licensed under the LGPLv2.1 or any later version +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 and ISC and FTL and RSA +URL: http://openjdk.java.net/ + + +# to regenerate source0 (jdk) and source8 (jdk's taspets) run update_package.sh +# update_package.sh contains hard-coded repos, revisions, tags, and projects to regenerate the source archives +Source0: jdk-updates-jdk%{majorver}u-jdk-%{filever}+%{buildver}.tar.gz +Source8: systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz + +# Desktop files. Adapted from IcedTea +Source9: jconsole.desktop.in + +# nss configuration file +Source11: nss.cfg.in + +# Ensure we aren't using the limited crypto policy +Source13: TestCryptoLevel.java + +# Ensure ECDSA is working +Source14: TestECDSA.java + +############################################ +# +# RPM/distribution specific patches +# +############################################ + +# NSS via SunPKCS11 Provider (disabled comment +# due to memory leak). + +# Ignore AWTError when assistive technologies are loaded +Patch1: rh1648242-accessible_toolkit_crash_do_not_break_jvm.patch +# Restrict access to java-atk-wrapper classes +Patch3: rh649512-remove_uses_of_far_in_jpeg_libjpeg_turbo_1_4_compat_for_jdk10_and_up.patch +# Depend on pcs-lite-libs instead of pcs-lite-devel as this is only in optional repo +Patch6: rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch + +############################################# +# +# OpenJDK patches in need of upstreaming +# +############################################# + +# 17.0.2 +Patch7: downgrade-the-glibc-symver-of-memcpy.patch +Patch8: downgrade-the-glibc-symver-of-log2f-posix_spawn.patch +Patch9: add-version-txt.patch +Patch10: 8273111-Default-timezone-should-return-zone-ID-if-et.patch +Patch11: Add-prefetch-before-copy-in-PSPromotionManager-copy_.patch +Patch12: 8272138-ZGC-Adopt-relaxed-ordering-for-self-healing.patch +Patch13: G1-GC-NUMA-feature-preferentially-selects-the-neares.patch +Patch14: Clean-up-JDK17-codeDEX.patch +Patch16: Clean-up-JDK17-codeDEX-fix-Non-static-numa_node_dist.patch + +# 17.0.4 +Patch18: Apply-TBI-to-ZGC-of-JDK17.patch + +# 17.0.5 +Patch19: 8253495-CDS-generates-non-deterministic-outpu.patch +Patch22: Fast-Serializer.patch +Patch23: Apply-TBI-barrier-patch-to-C1.patch + +# 17.0.6 +Patch24: 8275509-ModuleDescriptor.hashCode-isn-t-reproducible.patch + +# 17.0.7 +Patch26: 8280872-Reorder-code-cache-segments-to-improv.patch +Patch27: 8275509-ModuleDescriptor.hashCode-isn-t-rep.patch + +# 17.0.8 +Patch28: add-Parallel-Full-gc-mark-stack-draining-should.patch +Patch29: add-8271579-G1-Move-copy-before-CAS-in-do_copy.patch +Patch30: add-8267185-Add-string-deduplication-support-to.patch +Patch31: add-8292296-Use-multiple-threads-to-process-Par.patch +Patch32: fix-cds-SignedJar_java-test-fails.patch + +# 17.0.9 +Patch33: 8295068-SSLEngine-throws-NPE-parsing-CertificateRequ.patch +Patch34: 8316576-com.sun.jndi.ldap.Connection.cleanup-does-no.patch +Patch35: 8314063-The-socket-is-not-closed-in-Connection-creat.patch +Patch36: 8314236-Overflow-in-Collections.rotate.patch +Patch37: 8313626-C2-crash-due-to-unexpected-exception-control.patch +Patch38: 8168469-Memory-leak-in-JceSecurity.patch +Patch39: 8312065-Socket.connect-does-not-timeout-when-profili.patch +Patch40: 8285516-clearPassword-should-be-called-in-a-finally-.patch +Patch41: 8312200-Fix-Parse-catch_call_exceptions-memory-leak.patch + +############################################ +# +# LoongArch64 specific patches +# +############################################ +Patch2000: LoongArch64-support.patch + +############################################ +# +# riscv64 specific patches +# +############################################ +Patch3000: add-riscv64-support.patch + +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: alsa-lib-devel +BuildRequires: binutils +BuildRequires: cups-devel +BuildRequires: desktop-file-utils +BuildRequires: libstdc++-static +# elfutils only are OK for build without AOT +BuildRequires: elfutils-devel +BuildRequires: elfutils-extra +BuildRequires: fontconfig-devel +BuildRequires: freetype-devel +BuildRequires: giflib-devel +BuildRequires: gcc-c++ +BuildRequires: gdb +BuildRequires: harfbuzz-devel +BuildRequires: lcms2-devel +BuildRequires: libjpeg-devel +BuildRequires: libpng-devel +BuildRequires: libxslt +BuildRequires: libX11-devel +BuildRequires: libXi-devel +BuildRequires: libXinerama-devel +BuildRequires: libXrandr-devel +BuildRequires: libXrender-devel +BuildRequires: libXt-devel +BuildRequires: libXtst-devel +# Requirements for setting up the nss.cfg +BuildRequires: nss-devel +BuildRequires: pkgconfig +BuildRequires: xorg-x11-proto-devel +BuildRequires: zip +BuildRequires: javapackages-filesystem +BuildRequires: java-%{buildjdkver}-openjdk-devel +# Zero-assembler build requirement +%ifnarch %{jit_arches} +BuildRequires: libffi-devel +%endif +BuildRequires: tzdata-java >= 2015d +# Earlier versions have a bug in tree vectorization on PPC +BuildRequires: gcc >= 4.8.3-8 + +%if %{with_systemtap} +BuildRequires: systemtap-sdt-devel +%endif + +# this is always built, also during debug-only build +# when it is built in debug-only this package is just placeholder +%{java_rpo %{nil}} + +%description +The %{origin_nice} runtime environment. + +%if %{include_debug_build} +%package slowdebug +Summary: %{origin_nice} Runtime Environment %{majorver} %{debug_on} + +%{java_rpo -- %{debug_suffix_unquoted}} +%description slowdebug +The %{origin_nice} runtime environment. +%{debug_warning} +%endif + +%if %{include_normal_build} +%package headless +Summary: %{origin_nice} Headless Runtime Environment %{majorver} + +%{java_headless_rpo %{nil}} + +%description headless +The %{origin_nice} runtime environment %{majorver} without audio and video support. +%endif + +%if %{include_debug_build} +%package headless-slowdebug +Summary: %{origin_nice} Runtime Environment %{debug_on} + +%{java_headless_rpo -- %{debug_suffix_unquoted}} + +%description headless-slowdebug +The %{origin_nice} runtime environment %{majorver} without audio and video support. +%{debug_warning} +%endif + +%if %{include_normal_build} +%package devel +Summary: %{origin_nice} Development Environment %{majorver} + +%{java_devel_rpo %{nil}} + +%description devel +The %{origin_nice} development tools %{majorver}. +%endif + +%if %{include_debug_build} +%package devel-slowdebug +Summary: %{origin_nice} Development Environment %{majorver} %{debug_on} + +%{java_devel_rpo -- %{debug_suffix_unquoted}} + +%description devel-slowdebug +The %{origin_nice} development tools %{majorver}. +%{debug_warning} +%endif + +%if %{include_normal_build} +%package jmods +Summary: JMods for %{origin_nice} %{majorver} + +%{java_jmods_rpo %{nil}} + +%description jmods +The JMods for %{origin_nice}. +%endif + +%if %{include_debug_build} +%package jmods-slowdebug +Summary: JMods for %{origin_nice} %{majorver} %{debug_on} + +%{java_jmods_rpo -- %{debug_suffix_unquoted}} + +%description jmods-slowdebug +The JMods for %{origin_nice} %{majorver}. +%{debug_warning} +%endif + +%if %{include_normal_build} +%package demo +Summary: %{origin_nice} Demos %{majorver} + +%{java_demo_rpo %{nil}} + +%description demo +The %{origin_nice} demos %{majorver}. +%endif + +%if %{include_debug_build} +%package demo-slowdebug +Summary: %{origin_nice} Demos %{majorver} %{debug_on} + +%{java_demo_rpo -- %{debug_suffix_unquoted}} + +%description demo-slowdebug +The %{origin_nice} demos %{majorver}. +%{debug_warning} +%endif + +%if %{include_normal_build} +%package src +Summary: %{origin_nice} Source Bundle %{majorver} + +%{java_src_rpo %{nil}} + +%description src +The java-%{origin}-src sub-package contains the complete %{origin_nice} %{majorver} +class library source code for use by IDE indexers and debuggers. +%endif + +%if %{include_debug_build} +%package src-slowdebug +Summary: %{origin_nice} Source Bundle %{majorver} %{for_debug} + +%{java_src_rpo -- %{debug_suffix_unquoted}} + +%description src-slowdebug +The java-%{origin}-src-slowdebug sub-package contains the complete %{origin_nice} %{majorver} + class library source code for use by IDE indexers and debuggers. Debugging %{for_debug}. +%endif + +%if %{include_normal_build} +%package javadoc +Summary: %{origin_nice} %{majorver} API documentation +Requires: javapackages-filesystem +Obsoletes: javadoc-slowdebug < 1:13.0.0.33-1.rolling + +%{java_javadoc_rpo %{nil}} + +%description javadoc +The %{origin_nice} %{majorver} API documentation. +%endif + +%if %{include_normal_build} +%package javadoc-zip +Summary: %{origin_nice} %{majorver} API documentation compressed in a single archive +Requires: javapackages-filesystem +Obsoletes: javadoc-zip-slowdebug < 1:13.0.0.33-1.rolling + +%{java_javadoc_rpo %{nil}} + +%description javadoc-zip +The %{origin_nice} %{majorver} API documentation compressed in a single archive. +%endif + +%prep +if [ %{include_normal_build} -eq 0 -o %{include_normal_build} -eq 1 ] ; then + echo "include_normal_build is %{include_normal_build}" +else + echo "include_normal_build is %{include_normal_build}, thats invalid. Use 1 for yes or 0 for no" + exit 11 +fi +if [ %{include_debug_build} -eq 0 -o %{include_debug_build} -eq 1 ] ; then + echo "include_debug_build is %{include_debug_build}" +else + echo "include_debug_build is %{include_debug_build}, thats invalid. Use 1 for yes or 0 for no" + exit 12 +fi +if [ %{include_debug_build} -eq 0 -a %{include_normal_build} -eq 0 ] ; then + echo "You have disabled both include_debug_build and include_normal_build. That is a no go." + exit 13 +fi +%setup -q -c -n %{uniquesuffix ""} -T -a 0 +prioritylength=`expr length %{priority}` +if [ $prioritylength -ne 8 ] ; then + echo "priority must be 8 digits in total, violated" + exit 14 +fi + +# OpenJDK patches + +%ifnarch loongarch64 +pushd %{top_level_dir_name} +%patch1 -p1 +%patch3 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch16 -p1 +%patch18 -p1 +%patch19 -p1 +%patch22 -p1 +%patch23 -p1 +%patch24 -p1 +%patch26 -p1 +%patch27 -p1 +%patch28 -p1 +%patch29 -p1 +%patch30 -p1 +%patch31 -p1 +%patch32 -p1 +%patch33 -p1 +%patch34 -p1 +%patch35 -p1 +%patch36 -p1 +%patch37 -p1 +%patch38 -p1 +%patch39 -p1 +%patch40 -p1 +%patch41 -p1 + +%ifarch riscv64 +%patch3000 -p1 +%endif +popd # openjdk +%endif + +%ifarch loongarch64 +pushd %{top_level_dir_name} +%patch2000 -p1 +popd +%endif + + +# Extract systemtap tapsets +%if %{with_systemtap} +tar --strip-components=1 -x -I xz -f %{SOURCE8} +%if %{include_debug_build} +cp -r tapset tapset%{debug_suffix} +%endif + + +for suffix in %{build_loop} ; do + for file in "tapset"$suffix/*.in; do + OUTPUT_FILE=`echo $file | sed -e "s:\.stp\.in$:%{version}-%{release}.%{_arch}.stp:g"` + sed -e "s:@ABS_SERVER_LIBJVM_SO@:%{_jvmdir}/%{sdkdir -- $suffix}/lib/server/libjvm.so:g" $file > $file.1 +# TODO find out which architectures other than i686 have a client vm +%ifarch %{ix86} + sed -e "s:@ABS_CLIENT_LIBJVM_SO@:%{_jvmdir}/%{sdkdir -- $suffix}/lib/client/libjvm.so:g" $file.1 > $OUTPUT_FILE +%else + sed -e "/@ABS_CLIENT_LIBJVM_SO@/d" $file.1 > $OUTPUT_FILE +%endif + sed -i -e "s:@ABS_JAVA_HOME_DIR@:%{_jvmdir}/%{sdkdir -- $suffix}:g" $OUTPUT_FILE + sed -i -e "s:@INSTALL_ARCH_DIR@:%{archinstall}:g" $OUTPUT_FILE + sed -i -e "s:@prefix@:%{_jvmdir}/%{sdkdir -- $suffix}/:g" $OUTPUT_FILE + done +done +# systemtap tapsets ends +%endif + +# Prepare desktop files +for suffix in %{build_loop} ; do +for file in %{SOURCE9}; do + FILE=`basename $file | sed -e s:\.in$::g` + EXT="${FILE##*.}" + NAME="${FILE%.*}" + OUTPUT_FILE=$NAME$suffix.$EXT + sed -e "s:@JAVA_HOME@:%{sdkbindir -- $suffix}:g" $file > $OUTPUT_FILE + sed -i -e "s:@JRE_HOME@:%{jrebindir -- $suffix}:g" $OUTPUT_FILE + sed -i -e "s:@ARCH@:%{version}-%{release}.%{_arch}$suffix:g" $OUTPUT_FILE + sed -i -e "s:@JAVA_MAJOR_VERSION@:%{majorver}:g" $OUTPUT_FILE + sed -i -e "s:@JAVA_VENDOR@:%{origin}:g" $OUTPUT_FILE +done +done + +# Setup nss.cfg +sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE11} > nss.cfg + + +%build +# How many CPU's do we have? +export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :) +export NUM_PROC=${NUM_PROC:-1} +%if 0%{?_smp_ncpus_max} +# Honor %%_smp_ncpus_max +[ ${NUM_PROC} -gt %{?_smp_ncpus_max} ] && export NUM_PROC=%{?_smp_ncpus_max} +%endif + +%ifarch s390x sparc64 alpha %{power64} %{aarch64} loongarch64 +export ARCH_DATA_MODEL=64 +%endif +%ifarch alpha +export CFLAGS="$CFLAGS -mieee" +%endif + +# We use ourcppflags because the OpenJDK build seems to +# pass EXTRA_CFLAGS to the HotSpot C++ compiler... +# Explicitly set the C++ standard as the default has changed on GCC >= 6 +EXTRA_CFLAGS="%ourcppflags" +EXTRA_CPP_FLAGS="%ourcppflags" + +%ifarch %{power64} ppc +# fix rpmlint warnings +EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-strict-aliasing" +%endif +export EXTRA_CFLAGS + +for suffix in %{build_loop} ; do +if [ "x$suffix" = "x" ] ; then + debugbuild=release +else + # change --something to something + debugbuild=`echo $suffix | sed "s/-//g"` +fi + +# Variable used in hs_err hook on build failures +top_dir_abs_path=$(pwd)/%{top_level_dir_name} + +# The OpenJDK version file includes the current +# upstream version information. For some reason, +# configure does not automatically use the +# default pre-version supplied there (despite +# what the file claims), so we pass it manually +# to configure +VERSION_FILE=${top_dir_abs_path}/make/conf/version-numbers.conf +if [ -f ${VERSION_FILE} ] ; then + EA_DESIGNATOR=$(grep '^DEFAULT_PROMOTED_VERSION_PRE' ${VERSION_FILE} | cut -d '=' -f 2) +else + echo "Could not find OpenJDK version file."; + exit 16 +fi +if [ "x${EA_DESIGNATOR}" != "x%{expected_ea_designator}" ] ; then + echo "Spec file is configured for a %{build_type} build, but upstream version-pre setting is ${EA_DESIGNATOR}"; + exit 17 +fi + +mkdir -p %{buildoutputdir -- $suffix} +pushd %{buildoutputdir -- $suffix} + +bash ../configure \ +%ifnarch %{jit_arches} + --with-jvm-variants=zero \ +%endif +%ifarch %{ppc64le} + --with-jobs=1 \ +%endif + --with-version-build=%{buildver} \ + --with-version-pre=\"${EA_DESIGNATOR}\" \ + --with-version-opt=%{lts_designator} \ +%ifnarch loongarch64 + --with-vendor-version-string="%{vendor_version_string}" \ + --with-vendor-name="openEuler Community" \ +%endif +%if "%toolchain" == "clang" + --with-toolchain-type=clang \ +%endif + --with-vendor-url="https://openeuler.org/" \ + --with-vendor-bug-url="%{bug_url}" \ + --with-vendor-vm-bug-url="%{bug_url}" \ + --with-vendor-bug-url="https://gitee.com/src-openeuler/openjdk-17/issues/" \ + --with-vendor-vm-bug-url="https://gitee.com/src-openeuler/openjdk-17/issues/" \ + --with-boot-jdk=/usr/lib/jvm/java-%{buildjdkver}-openjdk \ + --with-debug-level=$debugbuild \ + --with-native-debug-symbols=internal \ + --enable-unlimited-crypto \ + --with-zlib=system \ + --with-libjpeg=system \ + --with-giflib=system \ + --with-libpng=system \ + --with-harfbuzz=system \ + --with-extra-cxxflags="$EXTRA_CPP_FLAGS" \ + --with-extra-cflags="$EXTRA_CFLAGS" \ + --with-extra-ldflags="%{ourldflags}" \ + --with-num-cores="$NUM_PROC" \ + --with-source-date="${SOURCE_DATE_EPOCH}" \ + --disable-javac-server \ + --disable-warnings-as-errors + +# Debug builds don't need same targets as release for +# build speed-up +maketargets="%{release_targets}" +if echo $debugbuild | grep -q "debug" ; then + maketargets="%{debug_targets}" +fi +make \ + WARNINGS_ARE_ERRORS="-Wno-error" \ + CFLAGS_WARNINGS_ARE_ERRORS="-Wno-error" \ + $maketargets || ( pwd; find $top_dir_abs_path -name "hs_err_pid*.log" | xargs cat && false ) + +# the build (erroneously) removes read permissions from some jars +# this is a regression in OpenJDK 7 (our compiler): +find images/%{jdkimage} -iname '*.jar' -exec chmod ugo+r {} \; + +# Build screws up permissions on binaries +# https://bugs.openjdk.java.net/browse/JDK-8173610 +find images/%{jdkimage} -iname '*.so' -exec chmod +x {} \; +find images/%{jdkimage}/bin/ -exec chmod +x {} \; + +popd >& /dev/null + +# Install nss.cfg right away as we will be using the JRE above +export JAVA_HOME=$(pwd)/%{buildoutputdir -- $suffix}/images/%{jdkimage} + +# Install nss.cfg right away as we will be using the JRE above +install -m 644 nss.cfg $JAVA_HOME/conf/security/ + +# Use system-wide tzdata +rm $JAVA_HOME/lib/tzdb.dat +ln -s %{_datadir}/javazi-1.8/tzdb.dat $JAVA_HOME/lib/tzdb.dat + +# build cycles +done + +%check + +# We test debug first as it will give better diagnostics on a crash +for suffix in %{rev_build_loop} ; do + +export JAVA_HOME=$(pwd)/%{buildoutputdir -- $suffix}/images/%{jdkimage} + +# Check unlimited policy has been used +$JAVA_HOME/bin/javac -d . %{SOURCE13} +$JAVA_HOME/bin/java --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel + +# Check ECC is working +$JAVA_HOME/bin/javac -d . %{SOURCE14} +$JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||") + +# Check debug symbols are present and can identify code +find "$JAVA_HOME" -iname '*.so' -print0 | while read -d $'\0' lib +do + if [ ![-f "$lib"] ] ; then + echo "Testing $lib for debug symbols" + # All these tests rely on RPM failing the build if the exit code of any set + # of piped commands is non-zero. + + # Test for .debug_* sections in the shared object. This is the main test + # Stripped objects will not contain these + eu-readelf -S "$lib" | grep "] .debug_" + test $(eu-readelf -S "$lib" | grep -E "\]\ .debug_(info|abbrev)" | wc --lines) == 2 + + # Test FILE symbols. These will most likely be removed by anything that + # manipulates symbol tables because it's generally useless. So a nice test + # that nothing has messed with symbols + old_IFS="$IFS" + IFS=$'\n' + for line in $(eu-readelf -s "$lib" | grep "00000000 0 FILE LOCAL DEFAULT") + do + # We expect to see .cpp files, except for architectures like aarch64 and + # s390 where we expect .o and .oS files + echo "$line" | grep -E "ABS ((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx|o|S|oS))?$" + done + IFS="$old_IFS" + + # If this is the JVM, look for javaCalls.(cpp|o) in FILEs, for extra sanity checking + if [ "`basename $lib`" = "libjvm.so" ]; then + eu-readelf -s "$lib" | \ + grep -E "00000000 0 FILE LOCAL DEFAULT ABS javaCalls.(cpp|o)$" + fi + + # Test that there are no .gnu_debuglink sections pointing to another + # debuginfo file. There shouldn't be any debuginfo files, so the link makes + # no sense either + eu-readelf -S "$lib" | grep 'gnu' + if eu-readelf -S "$lib" | grep "] .gnu_debuglink" | grep PROGBITS; then + echo "bad .gnu_debuglink section." + eu-readelf -x .gnu_debuglink "$lib" + false + fi + fi +done + +# Make sure gdb can do a backtrace based on line numbers on libjvm.so +# javaCalls.cpp:58 should map to: +# http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/file/ff3b27e6bcc2/src/share/vm/runtime/javaCalls.cpp#l58 +# Using line number 1 might cause build problems. See: +gdb -q "$JAVA_HOME/bin/java" < +-- if copy-jdk-configs is in transaction, it installs in pretrans to temp +-- if copy_jdk_configs is in temp, then it means that copy-jdk-configs is in transaction and so is +-- preferred over one in %%{_libexecdir}. If it is not in transaction, then depends +-- whether copy-jdk-configs is installed or not. If so, then configs are copied +-- (copy_jdk_configs from %%{_libexecdir} used) or not copied at all +local posix = require "posix" + +if (os.getenv("debug") == "true") then + debug = true; + print("cjc: in spec debug is on") +else + debug = false; +end + +SOURCE1 = "%{rpm_state_dir}/copy_jdk_configs.lua" +SOURCE2 = "%{_libexecdir}/copy_jdk_configs.lua" + +local stat1 = posix.stat(SOURCE1, "type"); +local stat2 = posix.stat(SOURCE2, "type"); + + if (stat1 ~= nil) then + if (debug) then + print(SOURCE1 .." exists - copy-jdk-configs in transaction, using this one.") + end; + package.path = package.path .. ";" .. SOURCE1 +else + if (stat2 ~= nil) then + if (debug) then + print(SOURCE2 .." exists - copy-jdk-configs already installed and NOT in transaction. Using.") + end; + package.path = package.path .. ";" .. SOURCE2 + else + if (debug) then + print(SOURCE1 .." does NOT exists") + print(SOURCE2 .." does NOT exists") + print("No config files will be copied") + end + return + end +end +-- run content of included file with fake args +cjc = require "copy_jdk_configs.lua" +arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}", "--temp", "%{rpm_state_dir}/%{name}.%{_arch}"} +cjc.mainProgram(arg) + +%post +%{post_script %{nil}} + +%post headless +%{post_headless %{nil}} + +%postun +%{postun_script %{nil}} + +%postun headless +%{postun_headless %{nil}} + +%posttrans +%{posttrans_script %{nil}} + +%post devel +%{post_devel %{nil}} + +%postun devel +%{postun_devel %{nil}} + +%posttrans devel +%{posttrans_devel %{nil}} + +%post javadoc +%{post_javadoc %{nil}} + +%postun javadoc +%{postun_javadoc %{nil}} + +%post javadoc-zip +%{post_javadoc_zip %{nil}} + +%postun javadoc-zip +%{postun_javadoc_zip %{nil}} +%endif + +%if %{include_debug_build} +%post slowdebug +%{post_script -- %{debug_suffix_unquoted}} + +%post headless-slowdebug +%{post_headless -- %{debug_suffix_unquoted}} + +%postun slowdebug +%{postun_script -- %{debug_suffix_unquoted}} + +%postun headless-slowdebug +%{postun_headless -- %{debug_suffix_unquoted}} + +%posttrans slowdebug +%{posttrans_script -- %{debug_suffix_unquoted}} + +%post devel-slowdebug +%{post_devel -- %{debug_suffix_unquoted}} + +%postun devel-slowdebug +%{postun_devel -- %{debug_suffix_unquoted}} + +%posttrans devel-slowdebug +%{posttrans_devel -- %{debug_suffix_unquoted}} +%endif + +%if %{include_normal_build} +%files +# main package builds always +%{files_jre %{nil}} +%else +%files +# placeholder +%endif + + +%if %{include_normal_build} +%files headless +# all config/noreplace files (and more) have to be declared in pretrans. See pretrans +%{files_jre_headless %{nil}} + +%files devel +%{files_devel %{nil}} + +%files jmods +%{files_jmods %{nil}} + +%files demo +%{files_demo %{nil}} + +%files src +%{files_src %{nil}} + +%files javadoc +%{files_javadoc %{nil}} + +# this puts huge file to /usr/share +# unluckily it is really a documentation file +# and unluckily it really is architecture-dependent, as eg. aot and grail are now x86_64 only +# same for debug variant +%files javadoc-zip +%{files_javadoc_zip %{nil}} +%endif + +%if %{include_debug_build} +%files slowdebug +%{files_jre -- %{debug_suffix_unquoted}} + +%files headless-slowdebug +%{files_jre_headless -- %{debug_suffix_unquoted}} + +%files devel-slowdebug +%{files_devel -- %{debug_suffix_unquoted}} + +%files jmods-slowdebug +%{files_jmods -- %{debug_suffix_unquoted}} + +%files demo-slowdebug +%{files_demo -- %{debug_suffix_unquoted}} + +%files src-slowdebug +%{files_src -- %{debug_suffix_unquoted}} +%endif + + +%changelog +* Thu Oct 26 2023 kuenking111 - 1:17.0.9.8-1 +- add 8295068-SSLEngine-throws-NPE-parsing-CertificateRequ.patch +- add 8316576-com.sun.jndi.ldap.Connection.cleanup-does-no.patch +- add 8314063-The-socket-is-not-closed-in-Connection-creat.patch +- add 8314236-Overflow-in-Collections.rotate.patch +- add 8313626-C2-crash-due-to-unexpected-exception-control.patch +- add 8168469-Memory-leak-in-JceSecurity.patch +- add 8312065-Socket.connect-does-not-timeout-when-profili.patch +- add 8285516-clearPassword-should-be-called-in-a-finally-.patch +- add 8312200-Fix-Parse-catch_call_exceptions-memory-leak.patch + +* Tue Oct 17 2023 kuenking111 - 1:17.0.9.8-0.rolling +- fix 8253495-CDS-generates-non-deterministic-outpu.patch +- fix add-8267185-Add-string-deduplication-support-to.patch +- fix add-version-txt.patch + +* Mon Sep 25 2023 kuenking111 - 1:17.0.8.7-2 +- add add-Parallel-Full-gc-mark-stack-draining-should.patch +- add add-8271579-G1-Move-copy-before-CAS-in-do_copy.patch +- add add-8267185-Add-string-deduplication-support-to.patch +- add add-8292296-Use-multiple-threads-to-process-Par.patch +- add fix-cds-SignedJar_java-test-fails.patch + +* Tue Aug 08 2023 misaka00251 - 1:17.0.8.7-1 +- Add riscv64 support + +* Fri Jul 21 2023 kuenking111 - 1:17.0.8.7-0.rolling +- del 8302595-use-after-free-related-to-GraphKit-.patch +- del 8303069-Memory-leak-in-CompilerOracle-parse.patch +- del 8304683-Memory-leak-in-WB_IsMethodCompatibl.patch +- del 8305541-C2-Div-Mod-nodes-without-zero-check.patch +- del Delete-expired-certificate.patch +- add jdk17.0.8+7-ga + +* Fri Jun 30 2023 kuenking111 - 1:17.0.7.7-0.6 +- add 8275509-ModuleDescriptor.hashCode-isn-t-rep.patch +- add 8302595-use-after-free-related-to-GraphKit-.patch +- add 8303069-Memory-leak-in-CompilerOracle-parse.patch +- add 8304683-Memory-leak-in-WB_IsMethodCompatibl.patch +- add 8305541-C2-Div-Mod-nodes-without-zero-check.patch + +* Tue May 30 2023 wanghao_hw - 1:17.0.7.7-0.5 +- del 8284336_CDS_SignedJar_java_test_fails_due__to_archived_Reference_object.patch + +* Mon May 29 2023 wanghao_hw - 1:17.0.7.7-0.4 +- add 8280872-Reorder-code-cache-segments-to-improv.patch + +* Thu May 25 2023 panxuefeng - 1:17.0.7.7-0.3 +- Init support for LoongArch64 + +* Tue May 16 2023 kuenking111 - 1:17.0.7.7-0.2 +- add 8284336_CDS_SignedJar_java_test_fails_due__to_archived_Reference_object.patch + +* Fri May 12 2023 misaka00251 - 1:17.0.7.7-0.1 +- Remove jdk17.0.6-ga source package + +* Thu May 4 2023 Autistic_boyya - 1:17.0.7.7-0.rolling +- add 8275509-ModuleDescriptor.hashCode-isn-t-reproducible.patch +- modified add-version-txt.patch +- modified 8253495-CDS-generates-non-deterministic-outpu.patch +- modified Delete-expired-certificate.patch +- modified Apply-TBI-to-ZGC-of-JDK17.patch +- add jdk17.0.7-ga + +* Mon Mar 27 2023 crash888 - 1:17.0.6.9-0.2 +- add libstdc++-static and del --with-static++lib=dynamic + +* Thu Mar 23 2023 crash888 - 1:17.0.6.9-0.1 +- del --whth-lcms=system + +* Sat Jan 28 2023 kuenking111 - 1:17.0.6.9-0.rolling +- modified add-version-txt.patch +- del 8290705_fix_StringConcat_validate_mem_flow_asserts_with_unexpected_userStoreI.patch +- del 8296480-Fix-the-problem-that-the-TestPolicy.j.patch +- del 8296485-BuildEEBasicConstraints.java-test-fai.patch +- del Add-Fast-serializer-testcase.patch +- add jdk17.0.6-ga + +* Thu Jan 5 2023 neu-mobi - 1:17.0.5.8-0.1 +- add 8253495-CDS-generates-non-deterministic-outpu.patch +- add 8296480-Fix-the-problem-that-the-TestPolicy.j.patch +- add 8296485-BuildEEBasicConstraints.java-test-fai.patch +- add Fast-Serializer.patch +- add Apply-TBI-barrier-patch-to-C1.patch +- add Add-Fast-serializer-testcase.patch + +* Wed Oct 19 2022 kuenking111 - 1:17.0.5.8-0.rolling +- modified add-version-txt.patch +- add jdk17.0.5-ga + +* Thu Sep 15 2022 kuenking111 - 1:17.0.4.8-0.3 +- add Apply-TBI-to-ZGC-of-JDK17.patch + +* Fri Aug 5 2022 kuenking111 - 1:17.0.4.8-0.2 +- del pr3183-rh1340845-support_system_crypto_policy.patch +- del rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch +- del rh1648644-java_access_bridge_privileged_security.patch + +* Fri Aug 5 2022 kuenking111 - 1:17.0.4.8-0.1 +- add 8290705_fix_StringConcat_validate_mem_flow_asserts_with_unexpected_userStoreI.patch + +* Mon Aug 1 2022 kuenking111 - 1:17.0.4.8-0.rolling +- modified Delete-expired-certificate.patch +- modified add-version-txt.patch +- del fix_X509TrustManagerImpl_symantec_distrust.patch +- add jdk17.0.4-ga + +* Thu Apr 28 2022 kuenking111 - 1:17.0.3.7-1 +- add fix_X509TrustManagerImpl_symantec_distrust.patch + +* Tue Apr 26 2022 kuenking111 - 1:17.0.3.7-0.rolling +- Init jdk-17.0.3+7-ga diff --git a/8168469-Memory-leak-in-JceSecurity.patch b/8168469-Memory-leak-in-JceSecurity.patch new file mode 100644 index 0000000000000000000000000000000000000000..039e1b30263c041af4f70d6cc705e83128ffaff2 --- /dev/null +++ b/8168469-Memory-leak-in-JceSecurity.patch @@ -0,0 +1,220 @@ +From 53853bf21c07116f6eff5fc8a74a1c4bcdd60343 Mon Sep 17 00:00:00 2001 +Subject: 8168469: Memory leak in JceSecurity +--- + .../javax/crypto/JceSecurity.java.template | 71 ++++++++++++------- + .../JceSecurity/VerificationResults.java | 59 +++++++++++++++ + 2 files changed, 103 insertions(+), 27 deletions(-) + create mode 100644 test/jdk/javax/crypto/JceSecurity/VerificationResults.java + +diff --git a/src/java.base/share/classes/javax/crypto/JceSecurity.java.template b/src/java.base/share/classes/javax/crypto/JceSecurity.java.template +index 7a344e8e3..bcdff3881 100644 +--- a/src/java.base/share/classes/javax/crypto/JceSecurity.java.template ++++ b/src/java.base/share/classes/javax/crypto/JceSecurity.java.template +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1997, 2023, 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 +@@ -51,7 +51,10 @@ package javax.crypto; + + import java.util.*; + import java.util.concurrent.ConcurrentHashMap; ++import java.util.function.Function; + import java.io.*; ++import java.lang.ref.ReferenceQueue; ++import java.lang.ref.WeakReference; + import java.net.URL; + import java.nio.file.*; + import java.security.*; +@@ -86,13 +89,16 @@ final class JceSecurity { + // Map of the providers we already have verified. + // If verified ok, value == PROVIDER_VERIFIED, otherwise + // the cause of verification failure is stored as value. +- private static final Map ++ private static final Map + verificationResults = new ConcurrentHashMap<>(); + + // Map of the providers currently being verified + private static final Map verifyingProviders = + new IdentityHashMap<>(); + ++ // weak references queued by GC ++ private static final ReferenceQueue queue = new ReferenceQueue<>(); ++ + private static final boolean isRestricted; + + /* +@@ -199,38 +205,51 @@ final class JceSecurity { + * Return null if ok, failure Exception if verification failed. + */ + static Exception getVerificationResult(Provider p) { +- IdentityWrapper pKey = new IdentityWrapper(p); +- Object o = verificationResults.get(pKey); +- // no mapping found +- if (o == null) { +- synchronized (JceSecurity.class) { +- // check cache again in case the result is now available +- o = verificationResults.get(pKey); +- if (o == null) { ++ expungeStaleWrappers(); ++ WeakIdentityWrapper pKey = new WeakIdentityWrapper(p, queue); ++ try { ++ Object o = verificationResults.computeIfAbsent(pKey, new Function<>() { ++ public Object apply(WeakIdentityWrapper key) { ++ // no mapping found + if (verifyingProviders.get(p) != null) { + // recursion; return failure now +- return new NoSuchProviderException +- ("Recursion during verification"); ++ throw new IllegalStateException(); + } ++ Object result; + try { + verifyingProviders.put(p, Boolean.FALSE); + URL providerURL = getCodeBase(p.getClass()); + verifyProvider(providerURL, p); +- o = PROVIDER_VERIFIED; ++ result = PROVIDER_VERIFIED; + } catch (Exception e) { +- o = e; ++ result = e; + } finally { + verifyingProviders.remove(p); + } +- verificationResults.put(pKey, o); + if (debug != null) { + debug.println("Provider " + p.getName() + +- " verification result: " + o); ++ " verification result: " + result); + } ++ return result; + } +- } ++ }); ++ return (o == PROVIDER_VERIFIED? null : (Exception) o); ++ ++ } catch (IllegalStateException ise) { ++ // recursive update detected ++ return new NoSuchProviderException ++ ("Recursion during verification"); ++ } ++ } ++ ++ /** ++ * Removes weakly reachable keys from history. ++ */ ++ static void expungeStaleWrappers() { ++ WeakIdentityWrapper key; ++ while ((key = (WeakIdentityWrapper) queue.poll()) != null) { ++ verificationResults.remove(key); + } +- return (o == PROVIDER_VERIFIED? null : (Exception) o); + } + + // return whether this provider is properly signed and can be used by JCE +@@ -403,12 +422,13 @@ final class JceSecurity { + return isRestricted; + } + +- private static final class IdentityWrapper { ++ private static final class WeakIdentityWrapper extends WeakReference { + +- final Provider obj; ++ final int hash; + +- IdentityWrapper(Provider obj) { +- this.obj = obj; ++ WeakIdentityWrapper(Provider obj, ReferenceQueue queue) { ++ super(obj, queue); ++ hash = System.identityHashCode(obj); + } + + @Override +@@ -416,15 +436,12 @@ final class JceSecurity { + if (this == o) { + return true; + } +- if (!(o instanceof IdentityWrapper)) { +- return false; +- } +- return this.obj == ((IdentityWrapper)o).obj; ++ return o instanceof WeakIdentityWrapper w && get() == w.get(); + } + + @Override + public int hashCode() { +- return System.identityHashCode(obj); ++ return hash; + } + } + } +diff --git a/test/jdk/javax/crypto/JceSecurity/VerificationResults.java b/test/jdk/javax/crypto/JceSecurity/VerificationResults.java +new file mode 100644 +index 000000000..9f87433a6 +--- /dev/null ++++ b/test/jdk/javax/crypto/JceSecurity/VerificationResults.java +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (c) 2023, BELLSOFT. 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 8168469 ++ * @summary Memory leak in JceSecurity ++ * @compile --add-exports java.base/com.sun.crypto.provider=ALL-UNNAMED VerificationResults.java ++ * @run main/othervm -Xmx128m --add-exports java.base/com.sun.crypto.provider=ALL-UNNAMED VerificationResults ++ */ ++ ++import java.security.NoSuchAlgorithmException; ++import java.security.Provider; ++ ++import javax.crypto.Cipher; ++import javax.crypto.NoSuchPaddingException; ++ ++import com.sun.crypto.provider.SunJCE; ++ ++public class VerificationResults { ++ ++ // approximate double the number of providers that fits in -Xmx128m heap ++ private static final int PROVIDERS_COUNT = 2000; ++ // the heap buffer size that triggers the OOME when the providers heap cannot be reclaimed ++ private static final int OOM_TRIGGER_SIZE = 10 * 1024 * 1024; ++ public static void main(String[] args) throws NoSuchAlgorithmException, NoSuchPaddingException { ++ int i = 0; ++ try { ++ for (; i < PROVIDERS_COUNT; i++) { ++ SunJCE jceProvider = new SunJCE(); ++ Cipher c = Cipher.getInstance("AES", jceProvider); ++ char[] arr = new char[OOM_TRIGGER_SIZE]; ++ } ++ } catch (OutOfMemoryError e) { ++ System.out.println("Caught OOME - less than 10M heap left.\nCreated " + i + " SunJCE providers"); ++ throw e; ++ } ++ } ++} +-- +2.22.0 + diff --git a/8253495-CDS-generates-non-deterministic-outpu.patch b/8253495-CDS-generates-non-deterministic-outpu.patch index 714aace824197b7ea8552cf40617bff3e922c3a9..5248a3a6a256b5da41a9e3d389ea117d9c788bea 100644 --- a/8253495-CDS-generates-non-deterministic-outpu.patch +++ b/8253495-CDS-generates-non-deterministic-outpu.patch @@ -3,8 +3,6 @@ Date: Wed, 4 Jan 2023 20:41:20 +0800 Subject: 8253495: CDS generates non-deterministic output --- - make/GenerateLinkOptData.gmk | 7 +- - .../build/tools/classlist/SortClasslist.java | 79 +++++++++++++++++++ make/scripts/compare.sh | 8 +- src/hotspot/share/cds/archiveBuilder.cpp | 5 +- src/hotspot/share/cds/archiveUtils.hpp | 5 +- @@ -18,129 +16,13 @@ Subject: 8253495: CDS generates non-deterministic output .../cds/appcds/javaldr/LockDuringDump.java | 4 +- .../appcds/javaldr/LockDuringDumpAgent.java | 16 +++- test/lib/jdk/test/lib/cds/CDSOptions.java | 33 ++++++-- - 15 files changed, 191 insertions(+), 35 deletions(-) + 13 files changed, 103 insertions(+), 33 deletions(-) create mode 100644 make/jdk/src/classes/build/tools/classlist/SortClasslist.java -diff --git a/make/GenerateLinkOptData.gmk b/make/GenerateLinkOptData.gmk -index 0de28d643..5dd766c8c 100644 ---- a/make/GenerateLinkOptData.gmk -+++ b/make/GenerateLinkOptData.gmk -@@ -1,5 +1,5 @@ - # --# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. -+# Copyright (c) 2016, 2021, 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 -@@ -88,7 +88,10 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXECUTABLE_SUFFIX) $(CLASSLIST - $(CAT) $(LINK_OPT_DIR)/stderr $(JLI_TRACE_FILE) ; \ - exit $$exitcode \ - ) -- $(GREP) -v HelloClasslist $@.raw.2 > $@ -+ $(GREP) -v HelloClasslist $@.raw.2 > $@.raw.3 -+ $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java \ -+ -cp $(SUPPORT_OUTPUTDIR)/classlist.jar \ -+ build.tools.classlist.SortClasslist $@.raw.3 > $@ - - # The jli trace is created by the same recipe as classlist. By declaring these - # dependencies, make will correctly rebuild both jli trace and classlist -diff --git a/make/jdk/src/classes/build/tools/classlist/SortClasslist.java b/make/jdk/src/classes/build/tools/classlist/SortClasslist.java -new file mode 100644 -index 000000000..cf9e55a7b ---- /dev/null -+++ b/make/jdk/src/classes/build/tools/classlist/SortClasslist.java -@@ -0,0 +1,79 @@ -+/* -+ * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2022, 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. Oracle designates this -+ * particular file as subject to the "Classpath" exception as provided -+ * by Oracle in the LICENSE file that accompanied this code. -+ * -+ * 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. -+ */ -+ -+/** -+ * This application is meant to be run to create a classlist file representing -+ * common use. -+ * -+ * The classlist is produced by adding -XX:DumpLoadedClassList=classlist -+ */ -+package build.tools.classlist; -+ -+import java.io.FileInputStream; -+import java.io.FileNotFoundException; -+import java.util.ArrayList; -+import java.util.Collections; -+import java.util.regex.Pattern; -+import java.util.regex.Matcher; -+import java.util.Scanner; -+ -+/** -+ * The classlist generated by build.tools.classlist.HelloClasslist -+ * may have non-deterministic contents, affected by Java thread execution order. -+ * SortClasslist sorts the file to make the JDK image's contents more deterministic. -+ */ -+public class SortClasslist { -+ public static void main(String args[]) throws FileNotFoundException { -+ ArrayList classes = new ArrayList<>(); -+ ArrayList lambdas = new ArrayList<>(); -+ -+ FileInputStream fis = new FileInputStream(args[0]); -+ Scanner scanner = new Scanner(fis); -+ while (scanner.hasNextLine()) { -+ String line = scanner.nextLine(); -+ if (line.startsWith("#")) { -+ // Comments -- print them first without sorting. These appear only at the top -+ // of the file. -+ System.out.println(line); -+ } else if (line.startsWith("@")) { -+ // @lambda-form-invoker, @lambda-proxy, etc. -+ lambdas.add(line); -+ } else { -+ classes.add(line); -+ } -+ } -+ -+ Collections.sort(classes); -+ Collections.sort(lambdas); -+ -+ for (String s : classes) { -+ System.out.println(s); -+ } -+ for (String s : lambdas) { -+ System.out.println(s); -+ } -+ } -+} diff --git a/make/scripts/compare.sh b/make/scripts/compare.sh -index b33c80c78..324529d70 100644 +index 76c3a0684..023299771 100644 --- a/make/scripts/compare.sh +++ b/make/scripts/compare.sh -@@ -1,6 +1,6 @@ - #!/bin/bash - # --# Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved. -+# Copyright (c) 2012, 2022, 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 @@ -325,7 +325,7 @@ compare_general_files() { ! -name "*.cpl" ! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \ ! -name "*.lib" ! -name "*.jmod" ! -name "*.exe" \ @@ -150,17 +32,6 @@ index b33c80c78..324529d70 100644 ! -name "*.map" \ | $GREP -v "./bin/" | $SORT | $FILTER) -@@ -357,8 +357,8 @@ compare_general_files() { - " - $CAT $OTHER_DIR/$f | eval "$SVG_FILTER" > $OTHER_FILE - $CAT $THIS_DIR/$f | eval "$SVG_FILTER" > $THIS_FILE -- elif [[ "$f" = *"/lib/classlist" ]] || [ "$SUFFIX" = "jar_contents" ]; then -- # The classlist files may have some lines in random order -+ elif [ "$SUFFIX" = "jar_contents" ]; then -+ # The jar_contents files may have some lines in random order - OTHER_FILE=$WORK_DIR/$f.other - THIS_FILE=$WORK_DIR/$f.this - $MKDIR -p $(dirname $OTHER_FILE) $(dirname $THIS_FILE) diff --git a/src/hotspot/share/cds/archiveBuilder.cpp b/src/hotspot/share/cds/archiveBuilder.cpp index 699926fcf..8e12cdabb 100644 --- a/src/hotspot/share/cds/archiveBuilder.cpp diff --git a/8285516-clearPassword-should-be-called-in-a-finally-.patch b/8285516-clearPassword-should-be-called-in-a-finally-.patch new file mode 100644 index 0000000000000000000000000000000000000000..8acc74858c153cda60c352e8f0c4ca3b0170e942 --- /dev/null +++ b/8285516-clearPassword-should-be-called-in-a-finally-.patch @@ -0,0 +1,33 @@ +From f7d209ac613d5736ab42ba38232a2cab05b28c07 Mon Sep 17 00:00:00 2001 +Subject: 8285516:clearPassword should be called in a finally try block + +--- + .../share/classes/sun/security/pkcs12/PKCS12KeyStore.java | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java b/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java +index 07f1145e8..12afa2f94 100644 +--- a/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java ++++ b/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java +@@ -864,14 +864,14 @@ public final class PKCS12KeyStore extends KeyStoreSpi { + { + SecretKey skey = null; + ++ PBEKeySpec keySpec = new PBEKeySpec(password); + try { +- PBEKeySpec keySpec = new PBEKeySpec(password); + SecretKeyFactory skFac = SecretKeyFactory.getInstance("PBE"); + skey = skFac.generateSecret(keySpec); +- keySpec.clearPassword(); + } catch (Exception e) { +- throw new IOException("getSecretKey failed: " + +- e.getMessage(), e); ++ throw new IOException("getSecretKey failed: " + e.getMessage(), e); ++ } finally { ++ keySpec.clearPassword(); + } + return skey; + } +-- +2.22.0 + diff --git a/8295068-SSLEngine-throws-NPE-parsing-CertificateRequ.patch b/8295068-SSLEngine-throws-NPE-parsing-CertificateRequ.patch new file mode 100644 index 0000000000000000000000000000000000000000..6be4b395d62f36ef1fbb912f5cd490d266160b58 --- /dev/null +++ b/8295068-SSLEngine-throws-NPE-parsing-CertificateRequ.patch @@ -0,0 +1,23 @@ +From 32dbeb16c3fd9e63ebc16b69861b15bb6d2f48bb Mon Sep 17 00:00:00 2001 +Subject: 8295068: SSLEngine throws NPE parsing CertificateRequests + +--- + .../share/classes/sun/security/ssl/CertificateRequest.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java b/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java +index 4def03c67..1f6147e4a 100644 +--- a/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java ++++ b/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java +@@ -136,7 +136,7 @@ final class CertificateRequest { + ArrayList keyTypes = new ArrayList<>(3); + for (byte id : ids) { + ClientCertificateType cct = ClientCertificateType.valueOf(id); +- if (cct.isAvailable) { ++ if (cct != null && cct.isAvailable) { + cct.keyAlgorithm.forEach(key -> { + if (!keyTypes.contains(key)) { + keyTypes.add(key); +-- +2.22.0 + diff --git a/8312065-Socket.connect-does-not-timeout-when-profili.patch b/8312065-Socket.connect-does-not-timeout-when-profili.patch new file mode 100644 index 0000000000000000000000000000000000000000..b54d4d537546b4b4f4a4eaa1ad1de6516de9eefd --- /dev/null +++ b/8312065-Socket.connect-does-not-timeout-when-profili.patch @@ -0,0 +1,370 @@ +From f8719924d97e3eb0f19daf59fe5e2913c17144eb Mon Sep 17 00:00:00 2001 +Subject: 8312065:Socket.connect does not timeout when profiling +--- + src/java.base/aix/native/libnet/aix_close.c | 48 +++++----- + .../linux/native/libnet/linux_close.c | 50 +++++------ + .../macosx/native/libnet/bsd_close.c | 50 +++++------ + test/jdk/java/net/Socket/B8312065.java | 88 +++++++++++++++++++ + 4 files changed, 162 insertions(+), 74 deletions(-) + create mode 100644 test/jdk/java/net/Socket/B8312065.java + +diff --git a/src/java.base/aix/native/libnet/aix_close.c b/src/java.base/aix/native/libnet/aix_close.c +index f3069920b..736a4ed8c 100644 +--- a/src/java.base/aix/native/libnet/aix_close.c ++++ b/src/java.base/aix/native/libnet/aix_close.c +@@ -388,50 +388,50 @@ int NET_SocketClose(int fd) { + /************** Basic I/O operations here ***************/ + + /* +- * Macro to perform a blocking IO operation. Restarts +- * automatically if interrupted by signal (other than +- * our wakeup signal) ++ * Macro to perform a blocking IO operation. ++ * If interrupted by signal (other than our wakeup signal), and if RETRY is true, ++ * then restarts automatically + */ +-#define BLOCKING_IO_RETURN_INT(FD, FUNC) { \ +- int ret; \ +- threadEntry_t self; \ +- fdEntry_t *fdEntry = getFdEntry(FD); \ +- if (fdEntry == NULL) { \ +- errno = EBADF; \ +- return -1; \ +- } \ +- do { \ +- startOp(fdEntry, &self); \ +- ret = FUNC; \ +- endOp(fdEntry, &self); \ +- } while (ret == -1 && errno == EINTR); \ +- return ret; \ ++#define BLOCKING_IO_RETURN_INT(FD, FUNC, RETRY) { \ ++ int ret; \ ++ threadEntry_t self; \ ++ fdEntry_t *fdEntry = getFdEntry(FD); \ ++ if (fdEntry == NULL) { \ ++ errno = EBADF; \ ++ return -1; \ ++ } \ ++ do { \ ++ startOp(fdEntry, &self); \ ++ ret = FUNC; \ ++ endOp(fdEntry, &self); \ ++ } while ((RETRY) && ret == -1 && errno == EINTR); \ ++ return ret; \ + } + + int NET_Read(int s, void* buf, size_t len) { +- BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0) ); ++ BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0), JNI_TRUE ); + } + + int NET_NonBlockingRead(int s, void* buf, size_t len) { +- BLOCKING_IO_RETURN_INT(s, recv(s, buf, len, MSG_NONBLOCK)); ++ BLOCKING_IO_RETURN_INT(s, recv(s, buf, len, MSG_NONBLOCK), JNI_TRUE ); + } + + int NET_RecvFrom(int s, void *buf, int len, unsigned int flags, + struct sockaddr *from, socklen_t *fromlen) { +- BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen) ); ++ BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen), JNI_TRUE ); + } + + int NET_Send(int s, void *msg, int len, unsigned int flags) { +- BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags) ); ++ BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags), JNI_TRUE ); + } + + int NET_SendTo(int s, const void *msg, int len, unsigned int + flags, const struct sockaddr *to, int tolen) { +- BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen) ); ++ BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen), JNI_TRUE ); + } + + int NET_Accept(int s, struct sockaddr *addr, socklen_t *addrlen) { +- BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen) ); ++ BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen), JNI_TRUE ); + } + + int NET_Connect(int s, struct sockaddr *addr, int addrlen) { +@@ -489,7 +489,7 @@ int NET_Connect(int s, struct sockaddr *addr, int addrlen) { + } + + int NET_Poll(struct pollfd *ufds, unsigned int nfds, int timeout) { +- BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout) ); ++ BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout), JNI_FALSE ); + } + + /* +diff --git a/src/java.base/linux/native/libnet/linux_close.c b/src/java.base/linux/native/libnet/linux_close.c +index 0d4e81e07..aabdaad4e 100644 +--- a/src/java.base/linux/native/libnet/linux_close.c ++++ b/src/java.base/linux/native/libnet/linux_close.c +@@ -345,58 +345,58 @@ int NET_SocketClose(int fd) { + /************** Basic I/O operations here ***************/ + + /* +- * Macro to perform a blocking IO operation. Restarts +- * automatically if interrupted by signal (other than +- * our wakeup signal) ++ * Macro to perform a blocking IO operation. ++ * If interrupted by signal (other than our wakeup signal), and if RETRY is true, ++ * then restarts automatically + */ +-#define BLOCKING_IO_RETURN_INT(FD, FUNC) { \ +- int ret; \ +- threadEntry_t self; \ +- fdEntry_t *fdEntry = getFdEntry(FD); \ +- if (fdEntry == NULL) { \ +- errno = EBADF; \ +- return -1; \ +- } \ +- do { \ +- startOp(fdEntry, &self); \ +- ret = FUNC; \ +- endOp(fdEntry, &self); \ +- } while (ret == -1 && errno == EINTR); \ +- return ret; \ ++#define BLOCKING_IO_RETURN_INT(FD, FUNC, RETRY) { \ ++ int ret; \ ++ threadEntry_t self; \ ++ fdEntry_t *fdEntry = getFdEntry(FD); \ ++ if (fdEntry == NULL) { \ ++ errno = EBADF; \ ++ return -1; \ ++ } \ ++ do { \ ++ startOp(fdEntry, &self); \ ++ ret = FUNC; \ ++ endOp(fdEntry, &self); \ ++ } while ((RETRY) && ret == -1 && errno == EINTR); \ ++ return ret; \ + } + + int NET_Read(int s, void* buf, size_t len) { +- BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0) ); ++ BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0), JNI_TRUE ); + } + + int NET_NonBlockingRead(int s, void* buf, size_t len) { +- BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, MSG_DONTWAIT) ); ++ BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, MSG_DONTWAIT), JNI_TRUE ); + } + + int NET_RecvFrom(int s, void *buf, int len, unsigned int flags, + struct sockaddr *from, socklen_t *fromlen) { +- BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen) ); ++ BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen), JNI_TRUE ); + } + + int NET_Send(int s, void *msg, int len, unsigned int flags) { +- BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags) ); ++ BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags), JNI_TRUE ); + } + + int NET_SendTo(int s, const void *msg, int len, unsigned int + flags, const struct sockaddr *to, int tolen) { +- BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen) ); ++ BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen), JNI_TRUE ); + } + + int NET_Accept(int s, struct sockaddr *addr, socklen_t *addrlen) { +- BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen) ); ++ BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen), JNI_TRUE ); + } + + int NET_Connect(int s, struct sockaddr *addr, int addrlen) { +- BLOCKING_IO_RETURN_INT( s, connect(s, addr, addrlen) ); ++ BLOCKING_IO_RETURN_INT( s, connect(s, addr, addrlen), JNI_TRUE ); + } + + int NET_Poll(struct pollfd *ufds, unsigned int nfds, int timeout) { +- BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout) ); ++ BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout), JNI_FALSE ); + } + + /* +diff --git a/src/java.base/macosx/native/libnet/bsd_close.c b/src/java.base/macosx/native/libnet/bsd_close.c +index 4a348b212..e4fd22b01 100644 +--- a/src/java.base/macosx/native/libnet/bsd_close.c ++++ b/src/java.base/macosx/native/libnet/bsd_close.c +@@ -349,58 +349,58 @@ int NET_SocketClose(int fd) { + /************** Basic I/O operations here ***************/ + + /* +- * Macro to perform a blocking IO operation. Restarts +- * automatically if interrupted by signal (other than +- * our wakeup signal) ++ * Macro to perform a blocking IO operation. ++ * If interrupted by signal (other than our wakeup signal), and if RETRY is true, ++ * then restarts automatically + */ +-#define BLOCKING_IO_RETURN_INT(FD, FUNC) { \ +- int ret; \ +- threadEntry_t self; \ +- fdEntry_t *fdEntry = getFdEntry(FD); \ +- if (fdEntry == NULL) { \ +- errno = EBADF; \ +- return -1; \ +- } \ +- do { \ +- startOp(fdEntry, &self); \ +- ret = FUNC; \ +- endOp(fdEntry, &self); \ +- } while (ret == -1 && errno == EINTR); \ +- return ret; \ ++#define BLOCKING_IO_RETURN_INT(FD, FUNC, RETRY) { \ ++ int ret; \ ++ threadEntry_t self; \ ++ fdEntry_t *fdEntry = getFdEntry(FD); \ ++ if (fdEntry == NULL) { \ ++ errno = EBADF; \ ++ return -1; \ ++ } \ ++ do { \ ++ startOp(fdEntry, &self); \ ++ ret = FUNC; \ ++ endOp(fdEntry, &self); \ ++ } while ((RETRY) && ret == -1 && errno == EINTR); \ ++ return ret; \ + } + + int NET_Read(int s, void* buf, size_t len) { +- BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0) ); ++ BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0), JNI_TRUE ); + } + + int NET_NonBlockingRead(int s, void* buf, size_t len) { +- BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, MSG_DONTWAIT)); ++ BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, MSG_DONTWAIT), JNI_TRUE); + } + + int NET_RecvFrom(int s, void *buf, int len, unsigned int flags, + struct sockaddr *from, socklen_t *fromlen) { +- BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen) ); ++ BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen), JNI_TRUE ); + } + + int NET_Send(int s, void *msg, int len, unsigned int flags) { +- BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags) ); ++ BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags), JNI_TRUE ); + } + + int NET_SendTo(int s, const void *msg, int len, unsigned int + flags, const struct sockaddr *to, int tolen) { +- BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen) ); ++ BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen), JNI_TRUE ); + } + + int NET_Accept(int s, struct sockaddr *addr, socklen_t *addrlen) { +- BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen) ); ++ BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen), JNI_TRUE ); + } + + int NET_Connect(int s, struct sockaddr *addr, int addrlen) { +- BLOCKING_IO_RETURN_INT( s, connect(s, addr, addrlen) ); ++ BLOCKING_IO_RETURN_INT( s, connect(s, addr, addrlen), JNI_TRUE ); + } + + int NET_Poll(struct pollfd *ufds, unsigned int nfds, int timeout) { +- BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout) ); ++ BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout), JNI_FALSE ); + } + + /* +diff --git a/test/jdk/java/net/Socket/B8312065.java b/test/jdk/java/net/Socket/B8312065.java +new file mode 100644 +index 000000000..118792ead +--- /dev/null ++++ b/test/jdk/java/net/Socket/B8312065.java +@@ -0,0 +1,88 @@ ++/* ++ * Copyright (c) 2023, Alibaba Group Holding Limited. 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 8312065 ++ * @summary Socket.connect does not timeout as expected when profiling (i.e. keep receiving signal) ++ * @requires (os.family != "windows") ++ * @compile NativeThread.java ++ * @run main/othervm/native/timeout=120 -Djdk.net.usePlainSocketImpl B8312065 ++ */ ++ ++import sun.misc.Signal; ++ ++import java.net.InetSocketAddress; ++import java.net.Socket; ++import java.net.SocketTimeoutException; ++import java.util.concurrent.TimeUnit; ++ ++public class B8312065 { ++ public static void main(String[] args) throws Exception { ++ System.loadLibrary("NativeThread"); ++ ++ // Setup SIGPIPE handler ++ Signal.handle(new Signal("PIPE"), System.out::println); ++ ++ long osThreadId = NativeThread.getID(); ++ ++ int timeoutMillis = 2000; ++ int n = 10; ++ Thread t = new Thread(() -> { ++ // Send SIGPIPE to the thread every second ++ for (int i = 0; i < n; i++) { ++ if (NativeThread.signal(osThreadId, NativeThread.SIGPIPE) != 0) { ++ System.out.println("Test FAILED: failed to send signal"); ++ System.exit(1); ++ } ++ try { ++ Thread.sleep(1000); ++ } catch (InterruptedException e) { ++ System.out.println("Test FAILED: unexpected interrupt"); ++ System.exit(1); ++ } ++ } ++ System.out.println("Test FAILED: Socket.connect blocked " + n + " seconds, " + ++ "expected around " + timeoutMillis / 1000 + " seconds"); ++ System.exit(1); ++ }); ++ t.setDaemon(true); ++ t.start(); ++ ++ long startTime = System.nanoTime(); ++ ++ try { ++ Socket socket = new Socket(); ++ // There is no good way to mock SocketTimeoutException, just assume 192.168.255.255 is not in use ++ socket.connect(new InetSocketAddress("192.168.255.255", 8080), timeoutMillis); ++ } catch (SocketTimeoutException e) { ++ long duration = TimeUnit.MILLISECONDS.convert(System.nanoTime() - startTime, TimeUnit.NANOSECONDS); ++ if (duration >= timeoutMillis) { ++ System.out.println("Test passed"); ++ } else { ++ System.out.println("Test FAILED: duration " + duration + " ms, expected >= " + timeoutMillis + " ms"); ++ System.exit(1); ++ } ++ } ++ } ++} +-- +2.22.0 + diff --git a/8312200-Fix-Parse-catch_call_exceptions-memory-leak.patch b/8312200-Fix-Parse-catch_call_exceptions-memory-leak.patch new file mode 100644 index 0000000000000000000000000000000000000000..bced601ce938722eed82655473b25c4b6f6a91c8 --- /dev/null +++ b/8312200-Fix-Parse-catch_call_exceptions-memory-leak.patch @@ -0,0 +1,100 @@ +From 061819ea31fcf07a91835c7d7d229927fb1fba9a Mon Sep 17 00:00:00 2001 +Subject: 8312200: Fix Parse::catch_call_exceptions memory leak + +--- + src/hotspot/share/opto/doCall.cpp | 39 ++++++++++++++++--------------- + 1 file changed, 20 insertions(+), 19 deletions(-) + +diff --git a/src/hotspot/share/opto/doCall.cpp b/src/hotspot/share/opto/doCall.cpp +index ed0d14348..b91e61a21 100644 +--- a/src/hotspot/share/opto/doCall.cpp ++++ b/src/hotspot/share/opto/doCall.cpp +@@ -785,46 +785,47 @@ void Parse::catch_call_exceptions(ciExceptionHandlerStream& handlers) { + Node* i_o = this->i_o(); + + // Add a CatchNode. +- GrowableArray* bcis = new (C->node_arena()) GrowableArray(C->node_arena(), 8, 0, -1); +- GrowableArray* extypes = new (C->node_arena()) GrowableArray(C->node_arena(), 8, 0, nullptr); +- GrowableArray* saw_unloaded = new (C->node_arena()) GrowableArray(C->node_arena(), 8, 0, 0); ++ Arena tmp_mem{mtCompiler}; ++ GrowableArray bcis(&tmp_mem, 8, 0, -1); ++ GrowableArray extypes(&tmp_mem, 8, 0, nullptr); ++ GrowableArray saw_unloaded(&tmp_mem, 8, 0, -1); + + bool default_handler = false; + for (; !handlers.is_done(); handlers.next()) { +- ciExceptionHandler* h = handlers.handler(); +- int h_bci = h->handler_bci(); +- ciInstanceKlass* h_klass = h->is_catch_all() ? env()->Throwable_klass() : h->catch_klass(); ++ ciExceptionHandler* h = handlers.handler(); ++ int h_bci = h->handler_bci(); ++ ciInstanceKlass* h_klass = h->is_catch_all() ? env()->Throwable_klass() : h->catch_klass(); + // Do not introduce unloaded exception types into the graph: + if (!h_klass->is_loaded()) { +- if (saw_unloaded->contains(h_bci)) { ++ if (saw_unloaded.contains(h_bci)) { + /* We've already seen an unloaded exception with h_bci, + so don't duplicate. Duplication will cause the CatchNode to be + unnecessarily large. See 4713716. */ + continue; + } else { +- saw_unloaded->append(h_bci); ++ saw_unloaded.append(h_bci); + } + } +- const Type* h_extype = TypeOopPtr::make_from_klass(h_klass); ++ const Type* h_extype = TypeOopPtr::make_from_klass(h_klass); + // (We use make_from_klass because it respects UseUniqueSubclasses.) + h_extype = h_extype->join(TypeInstPtr::NOTNULL); + assert(!h_extype->empty(), "sanity"); +- // Note: It's OK if the BCIs repeat themselves. +- bcis->append(h_bci); +- extypes->append(h_extype); ++ // Note: It's OK if the BCIs repeat themselves. ++ bcis.append(h_bci); ++ extypes.append(h_extype); + if (h_bci == -1) { + default_handler = true; + } + } + + if (!default_handler) { +- bcis->append(-1); ++ bcis.append(-1); + const Type* extype = TypeOopPtr::make_from_klass(env()->Throwable_klass())->is_instptr(); + extype = extype->join(TypeInstPtr::NOTNULL); +- extypes->append(extype); ++ extypes.append(extype); + } + +- int len = bcis->length(); ++ int len = bcis.length(); + CatchNode *cn = new CatchNode(control(), i_o, len+1); + Node *catch_ = _gvn.transform(cn); + +@@ -835,18 +836,18 @@ void Parse::catch_call_exceptions(ciExceptionHandlerStream& handlers) { + PreserveJVMState pjvms(this); + // Locals are just copied from before the call. + // Get control from the CatchNode. +- int handler_bci = bcis->at(i); ++ int handler_bci = bcis.at(i); + Node* ctrl = _gvn.transform( new CatchProjNode(catch_, i+1,handler_bci)); + // This handler cannot happen? + if (ctrl == top()) continue; + set_control(ctrl); + + // Create exception oop +- const TypeInstPtr* extype = extypes->at(i)->is_instptr(); +- Node *ex_oop = _gvn.transform(new CreateExNode(extypes->at(i), ctrl, i_o)); ++ const TypeInstPtr* extype = extypes.at(i)->is_instptr(); ++ Node* ex_oop = _gvn.transform(new CreateExNode(extypes.at(i), ctrl, i_o)); + + // Handle unloaded exception classes. +- if (saw_unloaded->contains(handler_bci)) { ++ if (saw_unloaded.contains(handler_bci)) { + // An unloaded exception type is coming here. Do an uncommon trap. + #ifndef PRODUCT + // We do not expect the same handler bci to take both cold unloaded +-- +2.22.0 + diff --git a/8313626-C2-crash-due-to-unexpected-exception-control.patch b/8313626-C2-crash-due-to-unexpected-exception-control.patch new file mode 100644 index 0000000000000000000000000000000000000000..999ac717b1e09f3ccb3e09156a3acd926f0a4b34 --- /dev/null +++ b/8313626-C2-crash-due-to-unexpected-exception-control.patch @@ -0,0 +1,223 @@ +From 146c0fa1d45690a787b512d2ab1d9e0da9ec918a Mon Sep 17 00:00:00 2001 +Subject: 8313626: C2 crash due to unexpected exception control flow +--- + src/hotspot/share/opto/doCall.cpp | 4 + + .../parsing/MissingSafepointOnTryCatch.jasm | 111 ++++++++++++++++++ + .../TestMissingSafepointOnTryCatch.java | 65 ++++++++++ + 3 files changed, 180 insertions(+) + create mode 100644 test/hotspot/jtreg/compiler/parsing/MissingSafepointOnTryCatch.jasm + create mode 100644 test/hotspot/jtreg/compiler/parsing/TestMissingSafepointOnTryCatch.java + +diff --git a/src/hotspot/share/opto/doCall.cpp b/src/hotspot/share/opto/doCall.cpp +index d42f9367d..ed0d14348 100644 +--- a/src/hotspot/share/opto/doCall.cpp ++++ b/src/hotspot/share/opto/doCall.cpp +@@ -979,6 +979,8 @@ void Parse::catch_inline_exceptions(SafePointNode* ex_map) { + if (PrintOpto && WizardMode) { + tty->print_cr(" Catching every inline exception bci:%d -> handler_bci:%d", bci(), handler_bci); + } ++ // If this is a backwards branch in the bytecodes, add safepoint ++ maybe_add_safepoint(handler_bci); + merge_exception(handler_bci); // jump to handler + return; // No more handling to be done here! + } +@@ -1010,6 +1012,8 @@ void Parse::catch_inline_exceptions(SafePointNode* ex_map) { + klass->print_name(); + tty->cr(); + } ++ // If this is a backwards branch in the bytecodes, add safepoint ++ maybe_add_safepoint(handler_bci); + merge_exception(handler_bci); + } + set_control(not_subtype_ctrl); +diff --git a/test/hotspot/jtreg/compiler/parsing/MissingSafepointOnTryCatch.jasm b/test/hotspot/jtreg/compiler/parsing/MissingSafepointOnTryCatch.jasm +new file mode 100644 +index 000000000..5d5fced0c +--- /dev/null ++++ b/test/hotspot/jtreg/compiler/parsing/MissingSafepointOnTryCatch.jasm +@@ -0,0 +1,111 @@ ++/* ++ * Copyright (c) 2023, 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. ++ */ ++ ++public class MissingSafepointOnTryCatch version 52:0 { ++ ++ static Method m:"()V" { ++ return; ++ } ++ ++ static Method test1:"()V" stack 1 { ++ try t; ++ invokestatic m:"()V"; ++ return; ++ ++ catch t java/lang/Throwable; ++ stack_map class java/lang/Throwable; ++ athrow; ++ endtry t; ++ } ++ ++ static Method test2:"()V" stack 1 { ++ try t0; ++ try t1; ++ invokestatic m:"()V"; ++ endtry t1; ++ return; ++ ++ catch t1 java/lang/Exception; ++ stack_map class java/lang/Exception; ++ return; ++ ++ catch t0 java/lang/Throwable; ++ stack_map class java/lang/Throwable; ++ athrow; ++ endtry t0; ++ } ++ ++ public static Method th:"()V" ++ throws java/lang/Exception ++ stack 2 locals 0 ++ { ++ new class java/lang/Exception; ++ dup; ++ invokespecial Method java/lang/Exception."":"()V"; ++ athrow; ++ } ++ ++ static Method test3:"()V" stack 1 locals 2 { ++ try t; ++ invokestatic m:"()V"; ++ iconst_1; ++ istore_0; ++ iconst_0; ++ istore_1; ++ return; ++ catch t java/lang/Throwable; ++ stack_map class java/lang/Throwable; ++ invokestatic th:"()V"; ++ return; ++ endtry t; ++ } ++ ++ static Method test4:"()V" stack 2 locals 2 { ++ try t; ++ invokestatic m:"()V"; ++ iconst_1; ++ istore_0; ++ iconst_0; ++ istore_1; ++ return; ++ catch t java/lang/Throwable; ++ stack_map class java/lang/Throwable; ++ iconst_1; ++ istore_0; ++ invokestatic th:"()V"; ++ return; ++ endtry t; ++ } ++ ++ static Method testInfinite:"()V" stack 1 { ++ try t; ++ invokestatic th:"()V"; ++ return; ++ ++ catch t java/lang/Throwable; ++ stack_map class java/lang/Throwable; ++ athrow; ++ endtry t; ++ } ++ ++} // end Class MissingSafepointOnTryCatch +diff --git a/test/hotspot/jtreg/compiler/parsing/TestMissingSafepointOnTryCatch.java b/test/hotspot/jtreg/compiler/parsing/TestMissingSafepointOnTryCatch.java +new file mode 100644 +index 000000000..9a8a31357 +--- /dev/null ++++ b/test/hotspot/jtreg/compiler/parsing/TestMissingSafepointOnTryCatch.java +@@ -0,0 +1,65 @@ ++/* ++ * Copyright (c) 2023, 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 8313626 ++ * @summary assert(false) failed: malformed control flow to missing safepoint on backedge of a try-catch ++ * @library /test/lib ++ * @compile MissingSafepointOnTryCatch.jasm ++ * @run main/othervm -XX:CompileCommand=quiet ++ * -XX:CompileCommand=compileonly,MissingSafepointOnTryCatch::test* ++ * -XX:CompileCommand=dontinline,MissingSafepointOnTryCatch::m ++ * -XX:CompileCommand=inline,MissingSafepointOnTryCatch::th ++ * -XX:-TieredCompilation -Xcomp TestMissingSafepointOnTryCatch ++ */ ++ ++import jdk.test.lib.Utils; ++ ++public class TestMissingSafepointOnTryCatch { ++ ++ public static void infiniteLoop() { ++ try { ++ Thread thread = new Thread() { ++ public void run() { ++ MissingSafepointOnTryCatch.testInfinite(); ++ } ++ }; ++ thread.setDaemon(true); ++ thread.start(); ++ Thread.sleep(Utils.adjustTimeout(500)); ++ } catch (Exception e) {} ++ } ++ ++ public static void main(String[] args) { ++ try { ++ // to make sure java/lang/Exception class is resolved ++ MissingSafepointOnTryCatch.th(); ++ } catch (Exception e) {} ++ MissingSafepointOnTryCatch.test1(); ++ MissingSafepointOnTryCatch.test2(); ++ MissingSafepointOnTryCatch.test3(); ++ MissingSafepointOnTryCatch.test4(); ++ infiniteLoop(); ++ } ++} +-- +2.22.0 + diff --git a/8314063-The-socket-is-not-closed-in-Connection-creat.patch b/8314063-The-socket-is-not-closed-in-Connection-creat.patch new file mode 100644 index 0000000000000000000000000000000000000000..e6e9f452857354b7f3c9f76d749e359d7e4adeff --- /dev/null +++ b/8314063-The-socket-is-not-closed-in-Connection-creat.patch @@ -0,0 +1,447 @@ +From e1726b4ccb0b51f527f1bf7a5a39c027294f5174 Mon Sep 17 00:00:00 2001 +Subject: 8314063: The socket is not closed in Connection::createSocket when the handshake failed for LDAP connection +--- + .../classes/com/sun/jndi/ldap/Connection.java | 131 +++++---- + .../ldap/LdapSSLHandshakeFailureTest.java | 249 ++++++++++++++++++ + test/jdk/com/sun/jndi/ldap/ksWithSAN | 0 + 3 files changed, 314 insertions(+), 66 deletions(-) + create mode 100644 test/jdk/com/sun/jndi/ldap/LdapSSLHandshakeFailureTest.java + create mode 100644 test/jdk/com/sun/jndi/ldap/ksWithSAN + +diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java b/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java +index ebb21bd8b..f71b1bb14 100644 +--- a/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java ++++ b/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java +@@ -280,79 +280,79 @@ public final class Connection implements Runnable { + private Socket createSocket(String host, int port, String socketFactory, + int connectTimeout) throws Exception { + +- Socket socket = null; +- +- if (socketFactory != null) { ++ SocketFactory factory = getSocketFactory(socketFactory); ++ assert factory != null; ++ Socket socket = createConnectionSocket(host, port, factory, connectTimeout); + +- // create the factory ++ // the handshake for SSL connection with server and reset timeout for the socket ++ if (socket instanceof SSLSocket sslSocket) { ++ try { ++ initialSSLHandshake(sslSocket, connectTimeout); ++ } catch (Exception e) { ++ // 8314063 the socket is not closed after the failure of handshake ++ // close the socket while the error happened ++ closeOpenedSocket(socket); ++ throw e; ++ } ++ } ++ return socket; ++ } + ++ private SocketFactory getSocketFactory(String socketFactoryName) throws Exception { ++ if (socketFactoryName == null) { ++ if (debug) { ++ System.err.println("Connection: using default SocketFactory"); ++ } ++ return SocketFactory.getDefault(); ++ } else { ++ if (debug) { ++ System.err.println("Connection: loading supplied SocketFactory: " + socketFactoryName); ++ } + @SuppressWarnings("unchecked") + Class socketFactoryClass = +- (Class)Obj.helper.loadClass(socketFactory); ++ (Class) Obj.helper.loadClass(socketFactoryName); + Method getDefault = +- socketFactoryClass.getMethod("getDefault", new Class[]{}); ++ socketFactoryClass.getMethod("getDefault"); + SocketFactory factory = (SocketFactory) getDefault.invoke(null, new Object[]{}); ++ return factory; ++ } ++ } + +- // create the socket +- +- if (connectTimeout > 0) { +- +- InetSocketAddress endpoint = +- createInetSocketAddress(host, port); +- +- // unconnected socket +- socket = factory.createSocket(); +- +- if (debug) { +- System.err.println("Connection: creating socket with " + +- "a timeout using supplied socket factory"); +- } +- +- // connected socket +- socket.connect(endpoint, connectTimeout); +- } +- +- // continue (but ignore connectTimeout) +- if (socket == null) { +- if (debug) { +- System.err.println("Connection: creating socket using " + +- "supplied socket factory"); +- } +- // connected socket +- socket = factory.createSocket(host, port); +- } +- } else { +- +- if (connectTimeout > 0) { +- +- InetSocketAddress endpoint = createInetSocketAddress(host, port); +- +- socket = new Socket(); ++ private Socket createConnectionSocket(String host, int port, SocketFactory factory, ++ int connectTimeout) throws Exception { ++ Socket socket = null; + +- if (debug) { +- System.err.println("Connection: creating socket with " + +- "a timeout"); +- } +- socket.connect(endpoint, connectTimeout); ++ if (connectTimeout > 0) { ++ // create unconnected socket and then connect it if timeout ++ // is supplied ++ InetSocketAddress endpoint = ++ createInetSocketAddress(host, port); ++ // unconnected socket ++ socket = factory.createSocket(); ++ // connect socket with a timeout ++ socket.connect(endpoint, connectTimeout); ++ if (debug) { ++ System.err.println("Connection: creating socket with " + ++ "a connect timeout"); + } +- +- // continue (but ignore connectTimeout) +- +- if (socket == null) { +- if (debug) { +- System.err.println("Connection: creating socket"); +- } +- // connected socket +- socket = new Socket(host, port); ++ } ++ if (socket == null) { ++ // create connected socket ++ socket = factory.createSocket(host, port); ++ if (debug) { ++ System.err.println("Connection: creating connected socket with" + ++ " no connect timeout"); + } + } ++ return socket; ++ } ++ ++ // For LDAP connect timeouts on LDAP over SSL connections must treat ++ // the SSL handshake following socket connection as part of the timeout. ++ // So explicitly set a socket read timeout, trigger the SSL handshake, ++ // then reset the timeout. ++ private void initialSSLHandshake(SSLSocket sslSocket , int connectTimeout) throws Exception { + +- // For LDAP connect timeouts on LDAP over SSL connections must treat +- // the SSL handshake following socket connection as part of the timeout. +- // So explicitly set a socket read timeout, trigger the SSL handshake, +- // then reset the timeout. +- if (socket instanceof SSLSocket) { +- SSLSocket sslSocket = (SSLSocket) socket; + if (!IS_HOSTNAME_VERIFICATION_DISABLED) { + SSLParameters param = sslSocket.getSSLParameters(); + param.setEndpointIdentificationAlgorithm("LDAPS"); +@@ -365,8 +365,6 @@ public final class Connection implements Runnable { + sslSocket.startHandshake(); + sslSocket.setSoTimeout(socketTimeout); + } +- } +- return socket; + } + + //////////////////////////////////////////////////////////////////////////// +@@ -642,7 +640,7 @@ public final class Connection implements Runnable { + + flushAndCloseOutputStream(); + // 8313657 socket is not closed until GC is run +- closeOpenedSocket(); ++ closeOpenedSocket(sock); + tryUnpauseReader(); + + if (!notifyParent) { +@@ -695,9 +693,10 @@ public final class Connection implements Runnable { + } + + // close socket +- private void closeOpenedSocket() { ++ private void closeOpenedSocket(Socket socket) { + try { +- sock.close(); ++ if (socket != null && !socket.isClosed()) ++ socket.close(); + } catch (IOException ioEx) { + if (debug) { + System.err.println("Connection.closeConnectionSocket: Socket close problem: " + ioEx); +diff --git a/test/jdk/com/sun/jndi/ldap/LdapSSLHandshakeFailureTest.java b/test/jdk/com/sun/jndi/ldap/LdapSSLHandshakeFailureTest.java +new file mode 100644 +index 000000000..29f74d250 +--- /dev/null ++++ b/test/jdk/com/sun/jndi/ldap/LdapSSLHandshakeFailureTest.java +@@ -0,0 +1,249 @@ ++/* ++ * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ */ ++ ++import jdk.test.lib.net.URIBuilder; ++ ++import javax.naming.Context; ++import javax.naming.ldap.InitialLdapContext; ++import javax.naming.ldap.LdapContext; ++import javax.net.SocketFactory; ++import javax.net.ssl.SSLServerSocketFactory; ++import java.io.File; ++import java.io.IOException; ++import java.io.InputStream; ++import java.io.OutputStream; ++import java.net.InetAddress; ++import java.net.ServerSocket; ++import java.net.Socket; ++import java.net.SocketException; ++import java.util.Hashtable; ++ ++/* ++ * @test ++ * @bug 8314063 ++ * @library /test/lib ++ * @summary For LDAPs connection, if the value of com.sun.jndi.ldap.connect.timeout is ++ * set too small or not an optimal value for the system, after the socket is created and ++ * connected to the server, but the handshake between the client and server fails due to ++ * socket time out, the opened socket is not closed properly. In this test case, the server ++ * is forced to sleep ten seconds and connection time out for client is one second. This ++ * will allow the socket opened and connected, and give the chance for the handshake to be ++ * timed out. Before this fix, the socket is kept opened. Right now the exception will be ++ * caught and the socket will be closed. ++ * ++ * @run main/othervm LdapSSLHandshakeFailureTest LdapSSLHandshakeFailureTest$CustomSocketFactory true 6000 ++ * @run main/othervm LdapSSLHandshakeFailureTest -1000 true 6000 ++ * @run main/othervm LdapSSLHandshakeFailureTest -1000 false 6000 ++ * @run main/othervm LdapSSLHandshakeFailureTest 2000 false 6000 ++ * @run main/othervm LdapSSLHandshakeFailureTest 0 true 6000 ++ * @run main/othervm LdapSSLHandshakeFailureTest 0 false 6000 ++ * @run main/othervm LdapSSLHandshakeFailureTest true ++ * @run main/othervm LdapSSLHandshakeFailureTest false ++ */ ++ ++public class LdapSSLHandshakeFailureTest { ++ private static String SOCKET_CLOSED_MSG = "The socket has been closed."; ++ ++ private static int serverSleepingTime = 5000; ++ ++ public static void main(String args[]) throws Exception { ++ ++ // Set the keystores ++ setKeyStore(); ++ boolean serverSlowDown = Boolean.valueOf(args[0]); ++ if (args.length == 2) { ++ serverSlowDown = Boolean.valueOf(args[1]); ++ } ++ ++ if (args.length == 3) { ++ serverSleepingTime = Integer.valueOf(args[2]); ++ } ++ ++ boolean hasCustomSocketFactory = args[0] ++ .equals("LdapSSLHandshakeFailureTest$CustomSocketFactory"); ++ // start the test server first. ++ try (TestServer server = new TestServer(serverSlowDown, serverSleepingTime)) { ++ server.start(); ++ Hashtable env = new Hashtable<>(); ++ env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); ++ env.put("java.naming.ldap.version", "3"); ++ env.put(Context.PROVIDER_URL, URIBuilder.newBuilder() ++ .scheme("ldaps") ++ .loopback() ++ .port(server.getPortNumber()) ++ .buildUnchecked().toString()); ++ ++ if (hasCustomSocketFactory) { ++ env.put("java.naming.ldap.factory.socket", args[0]); ++ env.put("com.sun.jndi.ldap.connect.timeout", "1000"); ++ } ++ ++ if (args.length == 2 && !hasCustomSocketFactory) { ++ env.put("com.sun.jndi.ldap.connect.timeout", args[0]); ++ } ++ ++ env.put(Context.SECURITY_PROTOCOL, "ssl"); ++ env.put(Context.SECURITY_AUTHENTICATION, "Simple"); ++ env.put(Context.SECURITY_PRINCIPAL, "cn=principal"); ++ env.put(Context.SECURITY_CREDENTIALS, "123456"); ++ LdapContext ctx = null; ++ try { ++ ctx = new InitialLdapContext(env, null); ++ } catch (Exception e) { ++ if (CustomSocketFactory.customSocket.closeMethodCalledCount() > 0 ++ && hasCustomSocketFactory ++ && Boolean.valueOf(args[1])) { ++ System.out.println(SOCKET_CLOSED_MSG); ++ } else { ++ throw e; ++ } ++ } finally { ++ if (ctx != null) ++ ctx.close(); ++ } ++ } ++ } ++ ++ public static class CustomSocketFactory extends SocketFactory { ++ private static CustomSocket customSocket; ++ ++ public static CustomSocketFactory getDefault() { ++ return new CustomSocketFactory(); ++ } ++ ++ @Override ++ public Socket createSocket() throws SocketException { ++ customSocket = new CustomSocket(); ++ return customSocket; ++ } ++ ++ @Override ++ public Socket createSocket(String s, int timeout) { ++ return customSocket; ++ } ++ ++ @Override ++ public Socket createSocket(String host, int port, InetAddress localHost, ++ int localPort) { ++ return customSocket; ++ } ++ ++ @Override ++ public Socket createSocket(InetAddress host, int port) { ++ return customSocket; ++ } ++ ++ @Override ++ public Socket createSocket(InetAddress address, int port, ++ InetAddress localAddress, int localPort) { ++ return customSocket; ++ } ++ } ++ ++ private static class CustomSocket extends Socket { ++ private int closeMethodCalled = 0; ++ ++ public CustomSocket() { ++ closeMethodCalled = 0; ++ } ++ ++ public int closeMethodCalledCount() { ++ return closeMethodCalled; ++ } ++ ++ @Override ++ public void close() throws java.io.IOException { ++ closeMethodCalled++; ++ super.close(); ++ } ++ } ++ ++ private static void setKeyStore() { ++ ++ String fileName = "ksWithSAN", dir = System.getProperty("test.src", ".") + File.separator; ++ ++ System.setProperty("javax.net.ssl.keyStore", dir + fileName); ++ System.setProperty("javax.net.ssl.keyStorePassword", "welcome1"); ++ System.setProperty("javax.net.ssl.trustStore", dir + fileName); ++ System.setProperty("javax.net.ssl.trustStorePassword", "welcome1"); ++ } ++ ++ static class TestServer extends Thread implements AutoCloseable { ++ private boolean isForceToSleep; ++ private int sleepingTime; ++ private final ServerSocket serverSocket; ++ private final int PORT; ++ ++ private TestServer(boolean isForceToSleep, int sleepingTime) { ++ this.isForceToSleep = isForceToSleep; ++ this.sleepingTime = sleepingTime; ++ try { ++ SSLServerSocketFactory socketFactory = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); ++ serverSocket = socketFactory.createServerSocket(0, 0, InetAddress.getLoopbackAddress()); ++ PORT = serverSocket.getLocalPort(); ++ } catch (IOException ex) { ++ throw new RuntimeException(ex); ++ } ++ setDaemon(true); ++ } ++ ++ public int getPortNumber() { ++ return PORT; ++ } ++ ++ @Override ++ public void run() { ++ try (Socket socket = serverSocket.accept(); ++ InputStream in = socket.getInputStream(); ++ OutputStream out = socket.getOutputStream()) { ++ if (isForceToSleep) { ++ Thread.sleep(sleepingTime); ++ } ++ byte[] bindResponse = {0x30, 0x0C, 0x02, 0x01, 0x01, 0x61, 0x07, 0x0A, ++ 0x01, 0x00, 0x04, 0x00, 0x04, 0x00}; ++ // read the bindRequest ++ while (in.read() != -1) { ++ in.skip(in.available()); ++ break; ++ } ++ out.write(bindResponse); ++ out.flush(); ++ // ignore the further requests ++ while (in.read() != -1) { ++ in.skip(in.available()); ++ } ++ } catch (Exception e) { ++ e.printStackTrace(); ++ } ++ } ++ ++ @Override ++ public void close() throws Exception { ++ if (serverSocket != null) { ++ serverSocket.close(); ++ } ++ } ++ } ++} ++ ++ +diff --git a/test/jdk/com/sun/jndi/ldap/ksWithSAN b/test/jdk/com/sun/jndi/ldap/ksWithSAN +new file mode 100644 +index 000000000..e69de29bb +-- +2.22.0 + diff --git a/8314236-Overflow-in-Collections.rotate.patch b/8314236-Overflow-in-Collections.rotate.patch new file mode 100644 index 0000000000000000000000000000000000000000..9e3bf5e17332f7ebd052a5409b86032f0d3992be --- /dev/null +++ b/8314236-Overflow-in-Collections.rotate.patch @@ -0,0 +1,125 @@ +From 99dde5664ec2941f6744391b3effb9466146c9df Mon Sep 17 00:00:00 2001 +Subject: 8314236: Overflow in Collections.rotate +--- + .../share/classes/java/util/Collections.java | 9 +- + .../jdk/java/util/Collections/RotateHuge.java | 83 +++++++++++++++++++ + 2 files changed, 88 insertions(+), 4 deletions(-) + create mode 100644 test/jdk/java/util/Collections/RotateHuge.java + +diff --git a/src/java.base/share/classes/java/util/Collections.java b/src/java.base/share/classes/java/util/Collections.java +index 473de05f9..31e83060e 100644 +--- a/src/java.base/share/classes/java/util/Collections.java ++++ b/src/java.base/share/classes/java/util/Collections.java +@@ -792,15 +792,16 @@ public class Collections { + if (distance == 0) + return; + +- for (int cycleStart = 0, nMoved = 0; nMoved != size; cycleStart++) { ++ int bound = size - distance; ++ for (int cycleStart = 0, nMoved = 0; nMoved < size; cycleStart++) { + T displaced = list.get(cycleStart); + int i = cycleStart; + do { +- i += distance; +- if (i >= size) ++ if (i >= bound) + i -= size; ++ i += distance; + displaced = list.set(i, displaced); +- nMoved ++; ++ nMoved++; + } while (i != cycleStart); + } + } +diff --git a/test/jdk/java/util/Collections/RotateHuge.java b/test/jdk/java/util/Collections/RotateHuge.java +new file mode 100644 +index 000000000..44368aff2 +--- /dev/null ++++ b/test/jdk/java/util/Collections/RotateHuge.java +@@ -0,0 +1,83 @@ ++/* ++ * Copyright (c) 2023, 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 8314236 ++ * @summary Overflow in Collections.rotate ++ */ ++ ++import java.util.AbstractList; ++import java.util.Collections; ++import java.util.List; ++import java.util.Objects; ++import java.util.RandomAccess; ++ ++public class RotateHuge { ++ ++ private static final class MockList extends AbstractList ++ implements RandomAccess { ++ private final int size; ++ ++ public MockList(final int size) { ++ if (size < 0) ++ throw new IllegalArgumentException("Illegal size: " + size); ++ this.size = size; ++ } ++ ++ @Override ++ public Object get(final int index) { ++ Objects.checkIndex(index, size); ++ return null; ++ } ++ ++ @Override ++ public Object set(final int index, final Object element) { ++ Objects.checkIndex(index, size); ++ return null; ++ } ++ ++ @Override ++ public int size() { ++ return size; ++ } ++ } ++ ++ public static void main(final String[] args) { ++ testRotate((1 << 30) + 1, -(1 << 30) - 2); ++ testRotate((1 << 30) + 1, 1 << 30); ++ testRotate(Integer.MAX_VALUE, Integer.MIN_VALUE); ++ testRotate(Integer.MAX_VALUE, Integer.MIN_VALUE + 3); ++ testRotate(Integer.MAX_VALUE, 2); ++ testRotate(Integer.MAX_VALUE, Integer.MAX_VALUE - 1); ++ } ++ ++ /* ++ * This test covers only index computations. ++ * Correctness of elements rotation is not checked. ++ */ ++ private static void testRotate(final int size, final int distance) { ++ final List list = new MockList(size); ++ Collections.rotate(list, distance); ++ } ++} +-- +2.22.0 + diff --git a/8316576-com.sun.jndi.ldap.Connection.cleanup-does-no.patch b/8316576-com.sun.jndi.ldap.Connection.cleanup-does-no.patch new file mode 100644 index 0000000000000000000000000000000000000000..f8a58422fb962fd2481cec4641a6699a560d28ee --- /dev/null +++ b/8316576-com.sun.jndi.ldap.Connection.cleanup-does-no.patch @@ -0,0 +1,262 @@ +From f693db304169874bc69d84e1ffd93da6d585a417 Mon Sep 17 00:00:00 2001 +Subject: 8316576: com.sun.jndi.ldap.Connection.cleanup does not close connections on SocketTimeoutErrors + +--- + .../classes/com/sun/jndi/ldap/Connection.java | 53 +++++- + .../com/sun/jndi/ldap/SocketCloseTest.java | 168 ++++++++++++++++++ + 2 files changed, 212 insertions(+), 9 deletions(-) + create mode 100644 test/jdk/com/sun/jndi/ldap/SocketCloseTest.java + +diff --git a/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java b/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java +index d8de2ddbb..ebb21bd8b 100644 +--- a/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java ++++ b/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1999, 2023, 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 +@@ -639,14 +639,12 @@ public final class Connection implements Runnable { + ldapUnbind(reqCtls); + } + } finally { +- try { +- outStream.flush(); +- sock.close(); +- unpauseReader(); +- } catch (IOException ie) { +- if (debug) +- System.err.println("Connection: problem closing socket: " + ie); +- } ++ ++ flushAndCloseOutputStream(); ++ // 8313657 socket is not closed until GC is run ++ closeOpenedSocket(); ++ tryUnpauseReader(); ++ + if (!notifyParent) { + LdapRequest ldr = pendingRequests; + while (ldr != null) { +@@ -680,6 +678,43 @@ public final class Connection implements Runnable { + } + } + ++ // flush and close output stream ++ private void flushAndCloseOutputStream() { ++ try { ++ outStream.flush(); ++ } catch (IOException ioEx) { ++ if (debug) ++ System.err.println("Connection.flushOutputStream: OutputStream flush problem " + ioEx); ++ } ++ try { ++ outStream.close(); ++ } catch (IOException ioEx) { ++ if (debug) ++ System.err.println("Connection.closeOutputStream: OutputStream close problem " + ioEx); ++ } ++ } ++ ++ // close socket ++ private void closeOpenedSocket() { ++ try { ++ sock.close(); ++ } catch (IOException ioEx) { ++ if (debug) { ++ System.err.println("Connection.closeConnectionSocket: Socket close problem: " + ioEx); ++ System.err.println("Socket isClosed: " + sock.isClosed()); ++ } ++ } ++ } ++ ++ // unpause reader ++ private void tryUnpauseReader() { ++ try { ++ unpauseReader(); ++ } catch (IOException ioEx) { ++ if (debug) ++ System.err.println("Connection.tryUnpauseReader: unpauseReader problem " + ioEx); ++ } ++ } + + // Assume everything is "quiet" + // "synchronize" might lead to deadlock so don't synchronize method +diff --git a/test/jdk/com/sun/jndi/ldap/SocketCloseTest.java b/test/jdk/com/sun/jndi/ldap/SocketCloseTest.java +new file mode 100644 +index 000000000..a33beb6ca +--- /dev/null ++++ b/test/jdk/com/sun/jndi/ldap/SocketCloseTest.java +@@ -0,0 +1,168 @@ ++/* ++ * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ */ ++ ++import javax.naming.Context; ++import javax.naming.directory.DirContext; ++import javax.naming.directory.InitialDirContext; ++import javax.net.SocketFactory; ++import java.net.InetAddress; ++import java.net.Socket; ++import java.net.SocketAddress; ++import java.io.ByteArrayInputStream; ++import java.io.IOException; ++import java.io.InputStream; ++import java.io.OutputStream; ++import java.util.Hashtable; ++ ++import jdk.test.lib.process.OutputAnalyzer; ++import jdk.test.lib.process.ProcessTools; ++ ++/* ++ * @test ++ * @bug 8313657 ++ * @summary make sure socket is closed when the error happens for OutputStream flushing ++ * The value of provider url can be random, not necessary to be the one in the code ++ * @library /test/lib ++ * @run main/othervm SocketCloseTest ++ */ ++ ++public class SocketCloseTest { ++ public static String SOCKET_CLOSED_MSG = "The socket has been closed."; ++ public static String SOCKET_NOT_CLOSED_MSG = "The socket was not closed."; ++ public static String BAD_FLUSH = "Bad flush!"; ++ private static final byte[] BIND_RESPONSE = new byte[]{ ++ 48, 12, 2, 1, 1, 97, 7, 10, 1, 0, 4, 0, 4, 0 ++ }; ++ ++ public static void main(String[] args) throws Exception { ++ SocketCloseTest scTest = new SocketCloseTest(); ++ scTest.runCloseSocketScenario(); ++ } ++ ++ public void runCloseSocketScenario() throws Exception { ++ Hashtable props = new Hashtable<>(); ++ ++ props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); ++ props.put(Context.PROVIDER_URL, "ldap://localhost:1389/o=example"); ++ props.put("java.naming.ldap.factory.socket", CustomSocketFactory.class.getName()); ++ try { ++ final DirContext ctx = new InitialDirContext(props); ++ } catch (Exception e) { ++ if (CustomSocketFactory.customSocket.closeMethodCalledCount() > 0) { ++ System.out.println(SOCKET_CLOSED_MSG); ++ } else { ++ System.out.println(SOCKET_NOT_CLOSED_MSG); ++ throw e; ++ } ++ } ++ } ++ ++ public static class CustomSocketFactory extends SocketFactory { ++ public static CustomSocket customSocket = new CustomSocket(); ++ ++ public static CustomSocketFactory getDefault() { ++ return new CustomSocketFactory(); ++ } ++ ++ @Override ++ public Socket createSocket() { ++ return customSocket; ++ } ++ ++ @Override ++ public Socket createSocket(String s, int timeout) { ++ return customSocket; ++ } ++ ++ @Override ++ public Socket createSocket(String host, int port, InetAddress localHost, ++ int localPort) { ++ return customSocket; ++ } ++ ++ @Override ++ public Socket createSocket(InetAddress host, int port) { ++ return customSocket; ++ } ++ ++ @Override ++ public Socket createSocket(InetAddress address, int port, ++ InetAddress localAddress, int localPort) { ++ return customSocket; ++ } ++ } ++ ++ private static class LdapInputStream extends InputStream { ++ private ByteArrayInputStream bos; ++ ++ public LdapInputStream() { ++ } ++ ++ @Override ++ public int read() throws IOException { ++ bos = new ByteArrayInputStream(BIND_RESPONSE); ++ return bos.read(); ++ } ++ } ++ ++ private static class LdapOutputStream extends OutputStream { ++ ++ @Override ++ public void write(int b) throws IOException { ++ System.out.println("output stream writing"); ++ } ++ ++ @Override ++ public void flush() throws IOException { ++ System.out.println(BAD_FLUSH); ++ throw new IOException(BAD_FLUSH); ++ } ++ } ++ ++ private static class CustomSocket extends Socket { ++ private int closeMethodCalled = 0; ++ private LdapOutputStream output = new LdapOutputStream(); ++ private LdapInputStream input = new LdapInputStream(); ++ ++ public void connect(SocketAddress address, int timeout) { ++ } ++ ++ public InputStream getInputStream() { ++ return input; ++ } ++ ++ public OutputStream getOutputStream() { ++ return output; ++ } ++ ++ public int closeMethodCalledCount() { ++ return closeMethodCalled; ++ } ++ ++ @Override ++ public void close() throws IOException { ++ closeMethodCalled++; ++ super.close(); ++ } ++ } ++} +-- +2.22.0 + diff --git a/add-8267185-Add-string-deduplication-support-to.patch b/add-8267185-Add-string-deduplication-support-to.patch index 9b222f3d569ec32e9d94489ba9647b42e5028383..7a4102facf8de78df57aef2298266ed4ee1e8694 100644 --- a/add-8267185-Add-string-deduplication-support-to.patch +++ b/add-8267185-Add-string-deduplication-support-to.patch @@ -357,13 +357,14 @@ index 7e5bb9ae5..83a652a8e 100644 * @test TestStringDeduplicationFullGC * @summary Test string deduplication during full GC diff --git a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationInterned.java b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationInterned.java -index 072f10e10..145adb946 100644 +index a5720b88e..a39419f0a 100644 --- a/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationInterned.java +++ b/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationInterned.java -@@ -36,6 +36,19 @@ package gc.stringdedup; - * @run driver gc.stringdedup.TestStringDeduplicationInterned G1 +@@ -48,6 +48,20 @@ package gc.stringdedup; + * java.management + * @run driver gc.stringdedup.TestStringDeduplicationInterned Shenandoah */ - ++ +/* + * @test TestStringDeduplicationInterned + * @summary Test string deduplication of interned strings diff --git a/add-version-txt.patch b/add-version-txt.patch index 4209b9883bc6476f3389622d6f331a3e70431b03..f9480989ee77cacd00878a41183b9253b21b37f6 100644 --- a/add-version-txt.patch +++ b/add-version-txt.patch @@ -13,7 +13,7 @@ index 000000000..b717bafbe --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ -+17.0.8.0.13 ++17.0.9.0.13 -- 2.19.0 diff --git a/jdk-updates-jdk17u-jdk-17.0.8+7.tar.gz b/jdk-updates-jdk17u-jdk-17.0.9+8.tar.gz similarity index 82% rename from jdk-updates-jdk17u-jdk-17.0.8+7.tar.gz rename to jdk-updates-jdk17u-jdk-17.0.9+8.tar.gz index 560d75d2f907dd5201c6f5664dff0fa621211238..371c05eba9a987ba349277c643eaa07ca1a095cf 100644 Binary files a/jdk-updates-jdk17u-jdk-17.0.8+7.tar.gz and b/jdk-updates-jdk17u-jdk-17.0.9+8.tar.gz differ diff --git a/openjdk-17.spec b/openjdk-17.spec index dfbdde49fb792e1c5b9fb9bfe7d52c7b040074ce..8f751c0c8fe0d0dfcc89253139bd70462f47924d 100644 --- a/openjdk-17.spec +++ b/openjdk-17.spec @@ -161,7 +161,7 @@ # Used via new version scheme. JDK 17 was # GA'ed in March 2021 => 21.9 %global vendor_version_string 21.9 -%global securityver 8 +%global securityver 9 # buildjdkver is usually same as %%{majorver}, # but in time of bootstrap of next jdk, it is majorver-1, # and this it is better to change it here, on single place @@ -181,7 +181,7 @@ %global origin_nice OpenJDK %global top_level_dir_name %{origin} %global minorver 0 -%global buildver 7 +%global buildver 8 # priority must be 8 digits in total; up to openjdk 1.8, we were using 18..... so when we moved to 11, we had to add another digit %if %is_system_jdk %global priority %( printf '%02d%02d%02d%02d' %{majorver} %{minorver} %{securityver} %{buildver} ) @@ -891,7 +891,7 @@ Provides: java-src%{?1} = %{epoch}:%{version}-%{release} Name: java-%{javaver}-%{origin} Version: %{newjavaver}.%{buildver} -Release: 3 +Release: 1 # 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 @@ -996,6 +996,17 @@ Patch30: add-8267185-Add-string-deduplication-support-to.patch Patch31: add-8292296-Use-multiple-threads-to-process-Par.patch Patch32: fix-cds-SignedJar_java-test-fails.patch +# 17.0.9 +Patch33: 8295068-SSLEngine-throws-NPE-parsing-CertificateRequ.patch +Patch34: 8316576-com.sun.jndi.ldap.Connection.cleanup-does-no.patch +Patch35: 8314063-The-socket-is-not-closed-in-Connection-creat.patch +Patch36: 8314236-Overflow-in-Collections.rotate.patch +Patch37: 8313626-C2-crash-due-to-unexpected-exception-control.patch +Patch38: 8168469-Memory-leak-in-JceSecurity.patch +Patch39: 8312065-Socket.connect-does-not-timeout-when-profili.patch +Patch40: 8285516-clearPassword-should-be-called-in-a-finally-.patch +Patch41: 8312200-Fix-Parse-catch_call_exceptions-memory-leak.patch + ############################################ # # LoongArch64 specific patches @@ -1255,6 +1266,15 @@ pushd %{top_level_dir_name} %patch30 -p1 %patch31 -p1 %patch32 -p1 +%patch33 -p1 +%patch34 -p1 +%patch35 -p1 +%patch36 -p1 +%patch37 -p1 +%patch38 -p1 +%patch39 -p1 +%patch40 -p1 +%patch41 -p1 %ifarch riscv64 %patch3000 -p1 @@ -1815,8 +1835,21 @@ require "copy_jdk_configs.lua" %changelog -* Thu Oct 12 2023 DXwangg - 1:17.0.8.7-3 -- fix [EulerMaker] openjdk-17 build problem in openEuler-20.03-LTS-SP4:everything +* Thu Oct 26 2023 kuenking111 - 1:17.0.9.8-1 +- add 8295068-SSLEngine-throws-NPE-parsing-CertificateRequ.patch +- add 8316576-com.sun.jndi.ldap.Connection.cleanup-does-no.patch +- add 8314063-The-socket-is-not-closed-in-Connection-creat.patch +- add 8314236-Overflow-in-Collections.rotate.patch +- add 8313626-C2-crash-due-to-unexpected-exception-control.patch +- add 8168469-Memory-leak-in-JceSecurity.patch +- add 8312065-Socket.connect-does-not-timeout-when-profili.patch +- add 8285516-clearPassword-should-be-called-in-a-finally-.patch +- add 8312200-Fix-Parse-catch_call_exceptions-memory-leak.patch + +* Tue Oct 17 2023 kuenking111 - 1:17.0.9.8-0.rolling +- fix 8253495-CDS-generates-non-deterministic-outpu.patch +- fix add-8267185-Add-string-deduplication-support-to.patch +- fix add-version-txt.patch * Mon Sep 25 2023 kuenking111 - 1:17.0.8.7-2 - add add-Parallel-Full-gc-mark-stack-draining-should.patch