brettwooldridge / NuProcess

Low-overhead, non-blocking I/O, external Process implementation for Java
Apache License 2.0
712 stars 84 forks source link

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

Closed robby-phd closed 6 years ago

robby-phd commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

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

robby-phd commented 6 years ago

Great, thanks!