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

Remove Lambda expression to avoid bootstrap problem #113

Merged
merged 1 commit into from
Jan 31, 2019

Conversation

JasonFengJ9
Copy link
Member

@JasonFengJ9 JasonFengJ9 commented Jan 30, 2019

Remove Lambda expression to avoid bootstrap problem

When jdk.internal.lambda.dumpProxyClasses is enabled, this triggers Module method calls before java.base is created, and caused null module object is returned and eventually NPE.

Replaced Lambda expression with anonymous class avoid such bootstrap problem.

Related to eclipse-openj9/openj9#3399

Depends on eclipse-openj9/openj9#4533

Reviewer: @pshipton
FYI: @DanHeidinga @hangshao0

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

@pshipton
Copy link
Member

Made a comment eclipse-openj9/openj9#3399 (comment)

When jdk.internal.lambda.dumpProxyClasses is enabled, this triggers
module method calls before java.base is created, and caused null module
object is returned and eventually NPE.

Replaced Lambda expression with anonymous class avoid such bootstrap
problem.

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

jenkins test sanity zlinux

@pshipton
Copy link
Member

@JasonFengJ9
Copy link
Member Author

JasonFengJ9 commented Jan 31, 2019

The failure was due to the OpenJDK bug identified at eclipse-openj9/openj9#3399 (comment)

11:12:20 Exception in thread "main" java.lang.ExceptionInInitializerError
11:12:20 	at java.base/java.lang.J9VMInternals.ensureError(J9VMInternals.java:191)
11:12:20 	at java.base/java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:180)
11:12:20 	at java.base/com.ibm.tools.attach.target.AttachHandler.initializeAttachAPI(AttachHandler.java:131)
11:12:20 Caused by: java.lang.NullPointerException
11:12:20 	at java.base/jdk.internal.reflect.ReflectionFactory.newMethodAccessor(ReflectionFactory.java:200)
11:12:20 	at java.base/java.lang.reflect.Method.acquireMethodAccessor(Method.java:632)
11:12:20 	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
11:12:20 	at java.base/java.lang.Class.cacheField(Class.java:3950)
11:12:20 	at java.base/java.lang.Class.getDeclaredField(Class.java:901)
11:12:20 	at java.base/java.lang.Class.getEnumVars(Class.java:2906)
11:12:20 	at java.base/java.lang.Class.getEnumConstantsShared(Class.java:2969)
11:12:20 	at java.base/java.lang.Access.getEnumConstantsShared(Access.java:91)
11:12:20 	at java.base/java.util.EnumSet.getUniverse(EnumSet.java:406)
11:12:20 	at java.base/java.util.EnumSet.noneOf(EnumSet.java:109)
11:12:20 	at java.base/java.util.EnumSet.of(EnumSet.java:283)
11:12:20 	at java.base/com.ibm.tools.attach.target.IPC.<clinit>(IPC.java:65)

However it is interesting that this PR triggered this NPE while it didn't hit it before.
Will seek a workaround.

@JasonFengJ9
Copy link
Member Author

I guess this PR changed bootstrap sequence a bit and the fieldjdk/internal/reflect/ReflectionFactory.langReflectAccess was referenced before a similar call but with correct method jdk/internal/reflect/ReflectionFactory.langReflectAccess() was made.
Will add a call Modifier.isPublic(Modifier.PUBLIC); in J9JCL code to initialize the fieldjdk/internal/reflect/ReflectionFactory.langReflectAccess.

@pshipton
Copy link
Member

Tested via eclipse-openj9/openj9#4533

@pshipton pshipton merged commit 14c9739 into ibmruntimes:openj9 Jan 31, 2019
hangshao0 pushed a commit to hangshao0/openj9-openjdk-jdk11 that referenced this pull request Aug 7, 2019
Remove references to libffi shared libary
@JasonFengJ9 JasonFengJ9 deleted the loggen branch October 9, 2019 01:37
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.

2 participants