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

Clojure code: NoSuchMethodException: jdk.internal.misc.SharedSecrets.setJavaUtilZipFileAccess #507

Open
awwx opened this issue Nov 25, 2024 · 1 comment

Comments

@awwx
Copy link

awwx commented Nov 25, 2024

Clojure dynamically loads code at runtime:

gov.nasa.jpf.vm.NoUncaughtExceptionsProperty
java.lang.NoSuchMethodException: jdk.internal.misc.SharedSecrets.setJavaUtilZipFileAccess(Ljdk/internal/misc/JavaUtilZipFileAccess;)V
	at java.util.zip.ZipFile.<clinit>(ZipFile.java:1152)
	at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:84)
	at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:125)
	at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:92)
	at clojure.lang.RT.lastModified(RT.java:416)

I see https://github.com/javapathfinder/jpf-core/blob/master/src/classes/modules/java.base/jdk/internal/misc/SharedSecrets.java and perhaps I could add setJavaUtilZipFileAccess there.

Before I get there though, I was wondering if it might be possible to execute a program to a certain point in the system VM and then switch to the JPF VM?

Clojure is only calling setJavaUtilZipFileAccess during initialization when it's loading Clojure program code. It's not called when the program is being tested.

I also noticed the comment in the JPF SharedSecrets implementation

All of this is hopefully going away when we drop Java 1.5 support, and is
to be replaced by some native peers providing the required native calls

If I will need setJavaUtilZipFileAccess support in JPF, would it be easier/better to try implementing the native peers instead?

@cyrille-artho
Copy link
Member

This is complex and closely related to issue #483, which we hope to resolve in the coming months.

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

No branches or pull requests

2 participants