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

Unsupported type MethodAccessorGenerator on Kafka #9633

Closed
galderz opened this issue May 27, 2020 · 4 comments
Closed

Unsupported type MethodAccessorGenerator on Kafka #9633

galderz opened this issue May 27, 2020 · 4 comments
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@galderz
Copy link
Member

galderz commented May 27, 2020

Replicated locally (first seen in #9486):

Error: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported type jdk.internal.reflect.MethodAccessorGenerator is reachable
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
Detailed message:
Trace:
	at parsing [email protected]/jdk.internal.reflect.ReflectionFactory.generateConstructor(ReflectionFactory.java:513)
Call path from entry point to jdk.internal.reflect.ReflectionFactory.generateConstructor(Class, Constructor):
	at [email protected]/jdk.internal.reflect.ReflectionFactory.generateConstructor(ReflectionFactory.java:513)
	at [email protected]/jdk.internal.reflect.ReflectionFactory.newConstructorForSerialization(ReflectionFactory.java:506)
	at [email protected]/java.io.ObjectStreamClass.getSerializableConstructor(ObjectStreamClass.java:1531)
	at [email protected]/java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:509)
	at [email protected]/java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:484)
	at app//com.oracle.svm.core.jdk.Target_java_security_AccessController.doPrivileged(SecuritySubstitutions.java:101)
	at [email protected]/sun.security.ssl.TransportContext$NotifyHandshake.run(TransportContext.java:657)
	at [email protected]/java.lang.Thread.run(Thread.java:834)
	at app//com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:517)
	at app//com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)
	at com.oracle.svm.core.code.IsolateEnterStub.PosixJavaThreads_pthreadStartRoutine_e1f4a8c0039f8337338252cd8734f63a79b5e3df(generated:0)
@galderz galderz added the kind/bug Something isn't working label May 27, 2020
@galderz galderz self-assigned this May 27, 2020
@galderz
Copy link
Member Author

galderz commented May 27, 2020

Longer output of failure.

The key for these issues is figuring out why ObjectStreamClass is being brought to the pointsto analysis. The reason ObjectStreamClass access is forbidden is because it's the result of serialization that results in new classes being created on the fly.

So. to see what the source really is, we forbid ObjectStreamClass usage with:

@TargetClass(java.io.ObjectStreamClass.class)
@SuppressWarnings({"unused"})
final class Target_java_io_ObjectStreamClass {

    @Delete("Object serialization is currently not supported")
    private static native ObjectStreamClass lookup(Class<?> cl, boolean all);

    @Delete("Object serialization is currently not supported")
    private Target_java_io_ObjectStreamClass(final Class<?> cl) {
    }

    @Delete("Object serialization is currently not supported")
    private Target_java_io_ObjectStreamClass() {
    }
}

That results in:

Error: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported constructor java.io.ObjectStreamClass.<init>() is reachable: Object serialization is currently not supported
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
Trace:
	at parsing [email protected]/java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1926)
Call path from entry point to java.io.ObjectInputStream.readNonProxyDesc(boolean):
	at [email protected]/java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1922)
	at [email protected]/java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1829)
	at [email protected]/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1624)
	at [email protected]/java.io.ObjectInputStream$GetFieldImpl.readFields(ObjectInputStream.java:2591)
	at [email protected]/java.io.ObjectInputStream.readFields(ObjectInputStream.java:644)
	at [email protected]/javax.security.auth.Subject.readObject(Subject.java:963)
	at com.oracle.svm.reflect.Subject_readObject_59d6db48bb6a4b2f99935bb5de87f42e62d92681_919.invoke(Unknown Source)
	at [email protected]/java.lang.reflect.Method.invoke(Method.java:566)
	at org.jboss.resteasy.core.ContextParameterInjector$GenericDelegatingProxy.invoke(ContextParameterInjector.java:122)
	at com.sun.proxy.$Proxy234.hashCode(Unknown Source)
	at [email protected]/java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
	at [email protected]/java.util.Properties.getProperty(Properties.java:1125)
	at app//com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:144)
	at app//com.oracle.svm.core.jdk.Target_java_lang_System.getProperty(JavaLangSubstitutions.java:345)
	at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_ARRAY:Ljava_lang_System_2_0002egetProperty_00028Ljava_lang_String_2_00029Ljava_lang_String_2(generated:0)

Longer output of above.

@galderz
Copy link
Member Author

galderz commented May 28, 2020

Created a draft PR: #9651.

@galderz
Copy link
Member Author

galderz commented May 29, 2020

New PR for wider scope.

@galderz
Copy link
Member Author

galderz commented Jun 5, 2020

Issue should be fixed with fix in Quarkus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants