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

Upgrading to 1.2.x (from 1.1.3) causes NoClassDefFoundError in macOS (and Java 10) #87

Closed
robby-phd opened this issue May 9, 2018 · 5 comments
Labels

Comments

@robby-phd
Copy link

Upgrading to 1.2.x throws the following exception when using NuProcess in macOS (10.13.4, Zulu JDK 10.2+3-jdk10.0.1):

java.lang.NoClassDefFoundError: Could not initialize class com.zaxxer.nuprocess.osx.OsxProcess
	at com.zaxxer.nuprocess.osx.OsxProcessFactory.createProcess(OsxProcessFactory.java:33)
	at com.zaxxer.nuprocess.NuProcessBuilder.start(NuProcessBuilder.java:266)
	at org.sireum.util.jvm.Exec.run(Exec.scala:100)
        ...

Steps to reproduce using 1.2.2 (note: this first downloads Zulu JDK, Sbt, and other dependencies):

git clone --recursive --depth=1 https://github.com/sireum/v3 sireum-v3
sed -i.bak 's/nuprocess=1.1.3/nuprocess=1.2.2/' sireum-v3/versions.properties
sireum-v3/bin/sbt-launch.sh "project logika-jvm" test
@brettwooldridge
Copy link
Owner

I will try to investigate this in the next few days. It should be noted that v1.2.2, on Linux, very well may not work on non Oracle/OpenJDK versions of Java due to the use of an internal JDK API. MacOS however, should work, so I will investigate this.

@robby-phd
Copy link
Author

Thanks. I can confirm that 1.2.2 on Linux with Zulu JDK 10 crashes:

java.lang.NoClassDefFoundError: Could not initialize class com.zaxxer.nuprocess.internal.LibC
	at com.zaxxer.nuprocess.internal.BasePosixProcess.createPipes(BasePosixProcess.java:585)
	at com.zaxxer.nuprocess.linux.LinuxProcess.start(LinuxProcess.java:86)
	at com.zaxxer.nuprocess.linux.LinProcessFactory.createProcess(LinProcessFactory.java:40)
	at com.zaxxer.nuprocess.NuProcessBuilder.start(NuProcessBuilder.java:266)
	at org.sireum.util.jvm.Exec.run(Exec.scala:100)

1.1.3 on Linux with the Zulu JDK works; 1.2.2 on Linux with Oracle Java 8 also works.

@brettwooldridge
Copy link
Owner

@robby-phd Thanks for confirming. I have the feeling that I can support Zulu (on Linux), if I can uncover their internal API for spawning processes (a little class-decompilation should reveal it).

Regarding supporting OS X on Zulu, that looks like a straight-up bug, as the v1.2.2 OS X process spawning code is [nearly] identical to v1.1.3. Whatever minor difference was introduced should be quickly resolvable.

@brettwooldridge
Copy link
Owner

@robby-phd NuProcess v1.2.3 has been published with support for Azul Systems' Zulu JVM.

@robby-phd
Copy link
Author

Great, thanks!

jvican added a commit to scalacenter/bloop that referenced this issue Jun 7, 2018
bturner added a commit to bturner/NuProcess that referenced this issue Jan 16, 2020
On brettwooldridge#87 (May 2018), there was a report of a linkage issue when using
Azul Zulu 10. As part of fixing that issue, a check was added to use
a new code path when the JVM vendor included "Azul".

A month later, brettwooldridge#91 (June 2018) was created showing a similar linkage
error when using OpenJDK 10. For that issue, the Azul-specific change
from brettwooldridge#87 was generalized to apply to any Java 10+ JVM, but the Azul
vendor check was not removed. As a result, Azul Zulu 8 (for example)
attempts to use the Java 10 code path and fails.

- Removed the Azul vendor check. Now, regardless of JVM vendor:
  - Java 10+ JVMs use Java_java_lang_ProcessImpl_forkAndExec
  - Earlier JVMs use Java_java_lang_UNIXProcess_forkAndExec
brettwooldridge pushed a commit that referenced this issue Jan 19, 2020
On #87 (May 2018), there was a report of a linkage issue when using
Azul Zulu 10. As part of fixing that issue, a check was added to use
a new code path when the JVM vendor included "Azul".

A month later, #91 (June 2018) was created showing a similar linkage
error when using OpenJDK 10. For that issue, the Azul-specific change
from #87 was generalized to apply to any Java 10+ JVM, but the Azul
vendor check was not removed. As a result, Azul Zulu 8 (for example)
attempts to use the Java 10 code path and fails.

- Removed the Azul vendor check. Now, regardless of JVM vendor:
  - Java 10+ JVMs use Java_java_lang_ProcessImpl_forkAndExec
  - Earlier JVMs use Java_java_lang_UNIXProcess_forkAndExec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants