Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master HEAD into openj9-staging #608

Merged
merged 501 commits into from
Jun 20, 2023

Conversation

JasonFengJ9
Copy link
Member

@JasonFengJ9 JasonFengJ9 commented Jun 2, 2023

Merge master HEAD into openj9-staging

Resolved conflicts:

	src/java.base/share/classes/java/lang/Thread.java
	src/java.base/share/classes/jdk/internal/foreign/abi/AbstractLinker.java
	src/java.base/share/classes/jdk/internal/foreign/abi/SharedUtils.java
	src/java.base/share/classes/jdk/internal/foreign/layout/ValueLayouts.java
	src/java.desktop/share/native/libfreetype/src/truetype/ttgxvar.c
	test/jdk/java/foreign/LibraryLookupTest.java
	test/jdk/java/foreign/NativeTestHelper.java
	test/jdk/java/foreign/SafeFunctionAccessTest.java
	test/jdk/java/foreign/StdLibTest.java
	test/jdk/java/foreign/TestClassLoaderFindNative.java
	test/jdk/java/foreign/TestDowncallScope.java
	test/jdk/java/foreign/TestDowncallStack.java
	test/jdk/java/foreign/TestFunctionDescriptor.java
	test/jdk/java/foreign/TestHeapAlignment.java
	test/jdk/java/foreign/TestMatrix.java
	test/jdk/java/foreign/TestNULLAddress.java
	test/jdk/java/foreign/TestNative.java
	test/jdk/java/foreign/TestNulls.java
	test/jdk/java/foreign/TestScopedOperations.java
	test/jdk/java/foreign/TestSegments.java
	test/jdk/java/foreign/TestStringEncoding.java
	test/jdk/java/foreign/TestUpcallAsync.java
	test/jdk/java/foreign/TestUpcallException.java
	test/jdk/java/foreign/TestUpcallHighArity.java
	test/jdk/java/foreign/TestUpcallScope.java
	test/jdk/java/foreign/TestUpcallStack.java
	test/jdk/java/foreign/TestUpcallStructScope.java
	test/jdk/java/foreign/TestValueLayouts.java
	test/jdk/java/foreign/TestVarArgs.java
	test/jdk/java/foreign/enablenativeaccess/TestEnableNativeAccess.java
	test/jdk/java/foreign/handles/Driver.java
	test/jdk/java/foreign/loaderLookup/TestLoaderLookup.java
	test/jdk/java/foreign/loaderLookup/TestLoaderLookupJNI.java
	test/jdk/java/lang/Thread/virtual/HoldsLock.java

Added protected ByteOrder linkerByteOrder() for following classes:

src/java.base/share/classes/jdk/internal/foreign/abi/s390x/sysv/SysVS390xLinker.java
src/java.base/share/classes/jdk/internal/foreign/abi/ppc64/sysv/SysVPPC64leLinker.java
src/java.base/share/classes/jdk/internal/foreign/abi/ppc64/aix/AixPPC64Linker.java
src/java.base/share/classes/jdk/internal/foreign/abi/ppc64/CallArranger.java

Modified src/java.base/share/classes/jdk/internal/loader/NativeLibraries.java to lazily initialize loadLibraryOnlyIfPresent, otherwise the following error might occur.

Exception in thread "(unnamed thread)" java/lang/ExceptionInInitializerError
	at java/lang/J9VMInternals.ensureError (java.base@21/J9VMInternals.java:191)
	at java/lang/J9VMInternals.recordInitializationFailure (java.base@21/J9VMInternals.java:180)
	at jdk/internal/loader/ClassLoaderHelper.<clinit> (java.base@21/ClassLoaderHelper.java:37)
	at jdk/internal/loader/NativeLibraries.<clinit> (java.base@21/NativeLibraries.java:64)
java/lang/NullPointerException
	at java/lang/reflect/Executable.declaredAnnotations (java.base@21/Executable.java:637)
	at java/lang/reflect/Executable.getAnnotation (java.base@21/Executable.java:600)
	at java/lang/reflect/Method.getAnnotation (java.base@21/Method.java:791)
	at java/lang/reflect/AnnotatedElement.isAnnotationPresent (java.base@21/AnnotatedElement.java:292)
	at java/lang/reflect/AccessibleObject.isAnnotationPresent (java.base@21/AccessibleObject.java:558)
	at jdk/internal/reflect/Reflection.isCallerSensitive (java.base@21/Reflection.java:347)
	at java/lang/reflect/Method.isCallerSensitive (java.base@21/Method.java:616)
	at java/lang/reflect/Method.invoke (java.base@21/Method.java:559)
	at java/lang/Class.getEnumConstantsShared (java.base@21/Class.java:3420)
	at java/lang/Class.enumConstantDirectory (java.base@21/Class.java:3356)
	at java/lang/Enum.valueOf (java.base@21/Enum.java:287)
	at jdk/internal/util/OperatingSystem.valueOf (java.base@21/OperatingSystem.java:63)
	at jdk/internal/util/OperatingSystem.initOS (java.base@21/OperatingSystem.java:139)
	at jdk/internal/util/OperatingSystem.<clinit> (java.base@21/OperatingSystem.java:83)
	at jdk/internal/loader/ClassLoaderHelper.<clinit> (java.base@21/ClassLoaderHelper.java:37)
	at jdk/internal/loader/NativeLibraries.<clinit> (java.base@21/NativeLibraries.java:64)

or

Exception in thread "(unnamed thread)" java/lang/Error: bootstrap error, system property access before init
	at java/lang/System.getProperties (java.base@21/System.java:596)
	at jdk/internal/util/StaticProperty.<clinit> (java.base@21/StaticProperty.java:64)
	at jdk/internal/util/OSVersion.initVersion (java.base@21/OSVersion.java:50)
	at jdk/internal/util/OSVersion.<clinit> (java.base@21/OSVersion.java:34)
	at jdk/internal/loader/ClassLoaderHelper.loadLibraryOnlyIfPresent (java.base@21/ClassLoaderHelper.java:51)
	at jdk/internal/loader/NativeLibraries.<clinit> (java.base@21/NativeLibraries.java:64)

This was caused by OpenJ9 jclcinit.c:initializeRequiredClasses() J9VMCONSTANTPOOL_JDKINTERNALLOADERNATIVELIBRARIES

initializeRequiredClasses(J9VMThread *vmThread, char* dllName)
{
	static UDATA requiredClasses[] = {
			J9VMCONSTANTPOOL_JAVALANGTHREAD,
...
			J9VMCONSTANTPOOL_JDKINTERNALLOADERNATIVELIBRARIES,

Depends on

Signed-off-by: Jason Feng fengj@ca.ibm.com

Alisen Chung and others added 30 commits May 18, 2023 15:45
Reviewed-by: mkartashev, prr
…xpected event: ThreadStartEvent in thread resume008-thread0"

Reviewed-by: dcubed
…de_generated_while_holding_locks

Reviewed-by: sspitsyn, cjplummer
….RuntimeException: values differ by more than 1GB

Reviewed-by: jpai, rriggs
Reviewed-by: amitkumar, jsjolen, fparain
…tual test thread factory

Reviewed-by: sspitsyn
Reviewed-by: cjplummer, amenkov, sspitsyn
8308468: ProblemList containers/docker/TestMemoryAwareness.java on linux-x64
8308470: ProblemList javax/management/remote/mandatory/connection/BrokenConnectionTest.java on linux-all
8308471: ProblemList javax/management/remote/mandatory/loading/MissingClassTest.java on windows-x64 w/ loom
8308472: ProblemList javax/management/remote/mandatory/loading/RMIDownloadTest.java on windows-x64 w/ loom
8308473: ProblemList java/lang/instrument/NativeMethodPrefixAgent.java with loom

Reviewed-by: lmesnik
8300545: Compiler Implementation for Record Patterns

Co-authored-by: Aggelos Biboudis <abimpoudis@openjdk.org>
Reviewed-by: vromero, mcimadamore
Reviewed-by: dholmes, lmesnik
…Preview)

8307444: java.lang.AssertionError when using unnamed patterns
8307482: Compiler should accept var _ in nested patterns in switch case
8307007: Implementation for javax.lang.model for unnamed variables (Preview)
8308312: Compiler should fail when a local variable declaration does not include an Identifier and does not have an initializer
8308309: Compiler should accept mixed masked and unmasked variables in lambda parameters

Co-authored-by: Jan Lahoda <jlahoda@openjdk.org>
Co-authored-by: Aggelos Biboudis <abimpoudis@openjdk.org>
Reviewed-by: vromero, darcy
…mode on selected platforms

Co-authored-by: Adam Sotona <asotona@openjdk.org>
Reviewed-by: erikj, vromero, bpb
Reviewed-by: dfuchs, naoto, djelinski, jpai, michaelm
closed/openjdk-tag.gmk Outdated Show resolved Hide resolved
src/java.base/share/classes/java/lang/Thread.java Outdated Show resolved Hide resolved
test/jdk/java/foreign/NativeTestHelper.java Outdated Show resolved Hide resolved
test/jdk/java/foreign/StdLibTest.java Outdated Show resolved Hide resolved
test/jdk/java/foreign/TestClassLoaderFindNative.java Outdated Show resolved Hide resolved
test/jdk/java/foreign/TestSegments.java Outdated Show resolved Hide resolved
test/jdk/java/foreign/TestValueLayouts.java Outdated Show resolved Hide resolved
@keithc-ca
Copy link
Member

I think this is ready to be merged, but

Once all four changes ready, we will want to merge them concurrently so openj9 remains compatible with jdk21 and this repo.

@JasonFengJ9
Copy link
Member Author

test/jdk/java/foreign/TestClassLoaderFindNative.java Outdated Show resolved Hide resolved
Comment on lines +72 to +78
private static boolean loadLibraryOnlyIfPresentInitialized;
private static void initLoadLibraryOnlyIfPresent() {
loadLibraryOnlyIfPresent = ClassLoaderHelper.loadLibraryOnlyIfPresent();
loadLibraryOnlyIfPresentInitialized = true;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any problems during a build; please explain how to reproduce the problem this is intended to address or revert this change.

@JasonFengJ9
Copy link
Member Author

I don't see any problems during a build; please explain how to reproduce the problem this is intended to address or revert this change.

Exception in thread "(unnamed thread)" java/lang/Error: bootstrap error, system property access before init
	at java/lang/System.getProperties (java.base@21/System.java:596)
	at jdk/internal/util/StaticProperty.<clinit> (java.base@21/StaticProperty.java:64)
	at jdk/internal/util/OSVersion.initVersion (java.base@21/OSVersion.java:50)
	at jdk/internal/util/OSVersion.<clinit> (java.base@21/OSVersion.java:34)
	at jdk/internal/loader/ClassLoaderHelper.<clinit> (java.base@21/ClassLoaderHelper.java:36)
	at jdk/internal/loader/NativeLibraries.<clinit> (java.base@21/NativeLibraries.java:64)

ClassLoaderHelper.java is platform specific.

./src/java.base/unix/classes/jdk/internal/loader/ClassLoaderHelper.java
./src/java.base/macosx/classes/jdk/internal/loader/ClassLoaderHelper.java
./src/java.base/windows/classes/jdk/internal/loader/ClassLoaderHelper.java
./src/java.base/aix/classes/jdk/internal/loader/ClassLoaderHelper.java

This is a MacOS-specific issue

// SDK 10.15 and earlier always reports 10.16 instead of 11.x.x
private static final boolean hasDynamicLoaderCache = OSVersion.current()
.compareTo(new OSVersion(10, 16)) >= 0;

@keithc-ca
Copy link
Member

Ok, I understand now. I thought we might limit the patch to the macOS version of ClassLoaderHelper, but that doesn't appear likely to work. Ideally we would fix the openj9 boot sequence so no openjdk patches are required here, but we can explore that later.

@keithc-ca
Copy link
Member

Please update the patch to NativeLibraries so comments make clear the delayed access is only required on macOS.

@JasonFengJ9
Copy link
Member Author

Please update the patch to NativeLibraries so comments make clear the delayed access is only required on macOS.

Added a comment, please have another look.

@keithc-ca
Copy link
Member

Please update the comment in NativeLibraries.java; I don't see the point of a reference to this pull request, and it's spelled "macOS" (no capital M).

Conflicts:
	src/java.base/share/classes/java/lang/Thread.java
	src/java.base/share/classes/jdk/internal/foreign/abi/AbstractLinker.java
	src/java.base/share/classes/jdk/internal/foreign/abi/SharedUtils.java
	src/java.base/share/classes/jdk/internal/foreign/layout/ValueLayouts.java
	src/java.desktop/share/native/libfreetype/src/truetype/ttgxvar.c
	test/jdk/TEST.ROOT
	test/jdk/java/foreign/LibraryLookupTest.java
	test/jdk/java/foreign/NativeTestHelper.java
	test/jdk/java/foreign/SafeFunctionAccessTest.java
	test/jdk/java/foreign/StdLibTest.java
	test/jdk/java/foreign/TestClassLoaderFindNative.java
	test/jdk/java/foreign/TestDowncallScope.java
	test/jdk/java/foreign/TestDowncallStack.java
	test/jdk/java/foreign/TestFunctionDescriptor.java
	test/jdk/java/foreign/TestHeapAlignment.java
	test/jdk/java/foreign/TestMatrix.java
	test/jdk/java/foreign/TestNULLAddress.java
	test/jdk/java/foreign/TestNative.java
	test/jdk/java/foreign/TestNulls.java
	test/jdk/java/foreign/TestScopedOperations.java
	test/jdk/java/foreign/TestSegments.java
	test/jdk/java/foreign/TestStringEncoding.java
	test/jdk/java/foreign/TestUpcallAsync.java
	test/jdk/java/foreign/TestUpcallException.java
	test/jdk/java/foreign/TestUpcallHighArity.java
	test/jdk/java/foreign/TestUpcallScope.java
	test/jdk/java/foreign/TestUpcallStack.java
	test/jdk/java/foreign/TestUpcallStructScope.java
	test/jdk/java/foreign/TestValueLayouts.java
	test/jdk/java/foreign/TestVarArgs.java
	test/jdk/java/foreign/enablenativeaccess/TestEnableNativeAccess.java
	test/jdk/java/foreign/handles/Driver.java
	test/jdk/java/foreign/loaderLookup/TestLoaderLookup.java
	test/jdk/java/foreign/loaderLookup/TestLoaderLookupJNI.java
	test/jdk/java/lang/Thread/virtual/HoldsLock.java

Added protected ByteOrder linkerByteOrder() for following classes:
    src/java.base/share/classes/jdk/internal/foreign/abi/s390x/sysv/SysVS390xLinker.java
    src/java.base/share/classes/jdk/internal/foreign/abi/ppc64/sysv/SysVPPC64leLinker.java
    src/java.base/share/classes/jdk/internal/foreign/abi/ppc64/aix/AixPPC64Linker.java
    src/java.base/share/classes/jdk/internal/foreign/abi/ppc64/CallArranger.java

Modified src/java.base/share/classes/jdk/internal/loader/NativeLibraries.java to lazily initialize loadLibraryOnlyIfPresent

Signed-off-by: Jason Feng <fengj@ca.ibm.com>
Signed-off-by: Jason Feng <fengj@ca.ibm.com>
@JasonFengJ9
Copy link
Member Author

Please update the comment in NativeLibraries.java; I don't see the point of a reference to this pull request, and it's spelled "macOS" (no capital M).

Updated

@keithc-ca
Copy link
Member

Jenkins compile aix,alinux64,amac,win jdknext depends eclipse-openj9/openj9#17514

@keithc-ca keithc-ca merged commit b57347e into ibmruntimes:openj9-staging Jun 20, 2023
@JasonFengJ9 JasonFengJ9 deleted the mergetmp branch June 21, 2023 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.