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

Inconsistent behavior in a OSX context #4

Closed
olivier-schmitt opened this issue Jul 16, 2017 · 8 comments
Closed

Inconsistent behavior in a OSX context #4

olivier-schmitt opened this issue Jul 16, 2017 · 8 comments

Comments

@olivier-schmitt
Copy link

Hello,

I've cloned the 0.1.2 version and tried a mvn clean install.

Here is my mvn banner (-version):

Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00)
Maven home: /Users/oschmitt/java/tools/maven/apache-maven-3.5.0
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre
Default locale: fr_FR, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.5", arch: "x86_64", family: "mac"

One test does not pass, an assertion failed with a strange compiler output :
/private/var/folders/86/kjgz0dfn7gb9y4pp6dcw_vqw0000gn/T/solc/solc: /private/var/folders/86/kjgz0dfn7gb9y4pp6dcw_vqw0000gn/T/solc/solc: cannot execute binary file

It's the SolidityCompilerTest and the compileContract method.

If if run the test alone with IntelliJ for instance, the test passes.

Regards.

@h2mch
Copy link
Contributor

h2mch commented Jul 17, 2017

Hi,
On the unixed based buidserver (see https://travis-ci.org/web3j/web3j-maven-plugin) the test are working. It looks like, that the permission on the file is wrong (not chmod +x). Maybe maven, which downloads the file, has not the right permission.
Can you run maven with the --debug flag and provide me the output?

@olivier-schmitt
Copy link
Author

Hello,

i've forked your repo and put it on travis with an OS X env.

https://travis-ci.org/olivier-schmitt/web3j-maven-plugin

The --debug flag is set in mvn command.

Here is my fork:
https://github.com/olivier-schmitt/web3j-maven-plugin

I've added a system.out.println() to output compiler errors in the console.

Connor should contact you about what i've done myself with web3j, I did not see your plugin and I built one with a different approach.

Thanks.

@olivier-schmitt
Copy link
Author

I've removed the system.out from SolidityCompilerTest to avoid side effects.
The code is now the same as yours (unless I missed some), .travis.yml is tailored for OS X of course.

@h2mch
Copy link
Contributor

h2mch commented Jul 17, 2017

I looks like, that maven is executing

Can you try to remove sudo: false in your travis.yml file on your fork?

@olivier-schmitt
Copy link
Author

Yes, I just removed the sudo : false.

Now, it's sudo: true.

It does not change the status: https://travis-ci.org/olivier-schmitt/web3j-maven-plugin/jobs/254416423

Have you noticed that the test case passed when I ran it directly through IntelliJ ?

Maybe the test cases are not isolated, but it should be a problem with Linux OS too, it's not.

Anyway, one should not be forced to use sudo to run mvn install or web3j app.

My guess it's the nasty native related bug, not obvious to pinpoint.

Regards.

h2mch added a commit that referenced this issue Jul 18, 2017
h2mch added a commit that referenced this issue Jul 18, 2017
h2mch added a commit that referenced this issue Jul 18, 2017
h2mch added a commit that referenced this issue Jul 18, 2017
h2mch added a commit that referenced this issue Jul 18, 2017
h2mch added a commit that referenced this issue Jul 18, 2017
h2mch added a commit that referenced this issue Jul 18, 2017
h2mch added a commit that referenced this issue Jul 18, 2017
h2mch added a commit that referenced this issue Jul 18, 2017
h2mch added a commit that referenced this issue Jul 18, 2017
h2mch added a commit that referenced this issue Jul 18, 2017
h2mch added a commit that referenced this issue Jul 18, 2017
h2mch added a commit that referenced this issue Jul 18, 2017
h2mch added a commit that referenced this issue Jul 18, 2017
@h2mch
Copy link
Contributor

h2mch commented Jul 18, 2017

as you can see, i played around a lot. Unfortunately unsuccessful. But I have some hints:

I think the root cause is following message

objc[1162]: Class JavaLaunchHelper is implemented in both 
/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/bin/java (0x10fe0f4c0) and 
/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x1121bb4e0).
One of the two will be used. Which one is undefined.

It looks like a bug in the current jdk
https://stackoverflow.com/questions/20794751/class-javalaunchhelper-is-implemented-in-both-one-of-the-two-will-be-used-whic

@olivier-schmitt
Copy link
Author

I've done some research and this bug is known as cosmetic as far I understand.

https://bugs.openjdk.java.net/browse/JDK-8022291

First registered in 2013 in the bug tracking service of OpenJDK.

I had that message for years on my mac without any inconvenience.

I don't see the link between the permission message error and the JavaLaunchHelper warning message.

When I run the test case alone through IntelliJ, it passes and it get the same message :

/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/bin/java -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:/Applications/IntelliJ IDEA 2017.2 EAP.app/Contents/lib/idea_rt.jar=49491:/Applications/IntelliJ IDEA 2017.2 EAP.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA 2017.2 EAP.app/Contents/lib/idea_rt.jar:/Applications/IntelliJ IDEA 2017.2 EAP.app/Contents/plugins/junit/lib/junit-rt.jar:/Applications/IntelliJ IDEA 2017.2 EAP.app/Contents/plugins/junit/lib/junit5-rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/lib/tools.jar:/Users/oschmitt/Downloads/web3j-maven-plugin-web3j-maven-plugin-0.1.2/target/test-classes:/Users/oschmitt/Downloads/web3j-maven-plugin-web3j-maven-plugin-0.1.2/target/classes:/Users/oschmitt/.m2/repository/org/apache/maven/maven-plugin-api/3.5.0/maven-plugin-api-3.5.0.jar:/Users/oschmitt/.m2/repository/org/apache/maven/maven-model/3.5.0/maven-model-3.5.0.jar:/Users/oschmitt/.m2/repository/org/apache/maven/maven-artifact/3.5.0/maven-artifact-3.5.0.jar:/Users/oschmitt/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.3/org.eclipse.sisu.plexus-0.3.3.jar:/Users/oschmitt/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar:/Users/oschmitt/.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar:/Users/oschmitt/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.3/org.eclipse.sisu.inject-0.3.3.jar:/Users/oschmitt/.m2/repository/org/apache/maven/maven-core/3.5.0/maven-core-3.5.0.jar:/Users/oschmitt/.m2/repository/org/apache/maven/maven-settings/3.5.0/maven-settings-3.5.0.jar:/Users/oschmitt/.m2/repository/org/apache/maven/maven-settings-builder/3.5.0/maven-settings-builder-3.5.0.jar:/Users/oschmitt/.m2/repository/org/apache/maven/maven-builder-support/3.5.0/maven-builder-support-3.5.0.jar:/Users/oschmitt/.m2/repository/org/apache/maven/maven-repository-metadata/3.5.0/maven-repository-metadata-3.5.0.jar:/Users/oschmitt/.m2/repository/org/apache/maven/maven-model-builder/3.5.0/maven-model-builder-3.5.0.jar:/Users/oschmitt/.m2/repository/com/google/guava/guava/20.0/guava-20.0.jar:/Users/oschmitt/.m2/repository/org/apache/maven/maven-resolver-provider/3.5.0/maven-resolver-provider-3.5.0.jar:/Users/oschmitt/.m2/repository/org/apache/maven/resolver/maven-resolver-impl/1.0.3/maven-resolver-impl-1.0.3.jar:/Users/oschmitt/.m2/repository/org/apache/maven/resolver/maven-resolver-api/1.0.3/maven-resolver-api-1.0.3.jar:/Users/oschmitt/.m2/repository/org/apache/maven/resolver/maven-resolver-spi/1.0.3/maven-resolver-spi-1.0.3.jar:/Users/oschmitt/.m2/repository/org/apache/maven/resolver/maven-resolver-util/1.0.3/maven-resolver-util-1.0.3.jar:/Users/oschmitt/.m2/repository/org/apache/maven/shared/maven-shared-utils/3.1.0/maven-shared-utils-3.1.0.jar:/Users/oschmitt/.m2/repository/com/google/inject/guice/4.0/guice-4.0-no_aop.jar:/Users/oschmitt/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar:/Users/oschmitt/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:/Users/oschmitt/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.24/plexus-interpolation-1.24.jar:/Users/oschmitt/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.jar:/Users/oschmitt/.m2/repository/org/codehaus/plexus/plexus-classworlds/2.5.2/plexus-classworlds-2.5.2.jar:/Users/oschmitt/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.7.1/plexus-component-annotations-1.7.1.jar:/Users/oschmitt/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar:/Users/oschmitt/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar:/Users/oschmitt/.m2/repository/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar:/Users/oschmitt/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-annotations/3.5/maven-plugin-annotations-3.5.jar:/Users/oschmitt/.m2/repository/org/apache/maven/shared/file-management/3.0.0/file-management-3.0.0.jar:/Users/oschmitt/.m2/repository/org/apache/maven/shared/maven-shared-io/3.0.0/maven-shared-io-3.0.0.jar:/Users/oschmitt/.m2/repository/org/ethereum/solcJ-all/0.4.8/solcJ-all-0.4.8.jar:/Users/oschmitt/.m2/repository/org/web3j/core/2.2.1/core-2.2.1.jar:/Users/oschmitt/.m2/repository/org/apache/httpcomponents/httpclient/4.5.2/httpclient-4.5.2.jar:/Users/oschmitt/.m2/repository/org/apache/httpcomponents/httpcore/4.4.4/httpcore-4.4.4.jar:/Users/oschmitt/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/Users/oschmitt/.m2/repository/commons-codec/commons-codec/1.9/commons-codec-1.9.jar:/Users/oschmitt/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.8.5/jackson-databind-2.8.5.jar:/Users/oschmitt/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.8.0/jackson-annotations-2.8.0.jar:/Users/oschmitt/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.8.5/jackson-core-2.8.5.jar:/Users/oschmitt/.m2/repository/org/bouncycastle/bcprov-jdk15on/1.54/bcprov-jdk15on-1.54.jar:/Users/oschmitt/.m2/repository/com/lambdaworks/scrypt/1.4.0/scrypt-1.4.0.jar:/Users/oschmitt/.m2/repository/com/squareup/javapoet/1.7.0/javapoet-1.7.0.jar:/Users/oschmitt/.m2/repository/io/reactivex/rxjava/1.2.4/rxjava-1.2.4.jar:/Users/oschmitt/.m2/repository/com/github/jnr/jnr-unixsocket/0.15/jnr-unixsocket-0.15.jar:/Users/oschmitt/.m2/repository/com/github/jnr/jnr-ffi/2.1.2/jnr-ffi-2.1.2.jar:/Users/oschmitt/.m2/repository/com/github/jnr/jffi/1.2.14/jffi-1.2.14.jar:/Users/oschmitt/.m2/repository/com/github/jnr/jffi/1.2.14/jffi-1.2.14-native.jar:/Users/oschmitt/.m2/repository/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar:/Users/oschmitt/.m2/repository/org/ow2/asm/asm-commons/5.0.3/asm-commons-5.0.3.jar:/Users/oschmitt/.m2/repository/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.jar:/Users/oschmitt/.m2/repository/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar:/Users/oschmitt/.m2/repository/org/ow2/asm/asm-util/5.0.3/asm-util-5.0.3.jar:/Users/oschmitt/.m2/repository/com/github/jnr/jnr-x86asm/1.0.2/jnr-x86asm-1.0.2.jar:/Users/oschmitt/.m2/repository/com/github/jnr/jnr-constants/0.9.6/jnr-constants-0.9.6.jar:/Users/oschmitt/.m2/repository/com/github/jnr/jnr-enxio/0.14/jnr-enxio-0.14.jar:/Users/oschmitt/.m2/repository/com/github/jnr/jnr-posix/3.0.33/jnr-posix-3.0.33.jar:/Users/oschmitt/.m2/repository/junit/junit/4.12/junit-4.12.jar:/Users/oschmitt/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/Users/oschmitt/.m2/repository/org/apache/maven/plugin-testing/maven-plugin-testing-harness/3.3.0/maven-plugin-testing-harness-3.3.0.jar:/Users/oschmitt/.m2/repository/commons-io/commons-io/2.2/commons-io-2.2.jar:/Users/oschmitt/.m2/repository/org/codehaus/plexus/plexus-archiver/2.2/plexus-archiver-2.2.jar:/Users/oschmitt/.m2/repository/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar:/Users/oschmitt/.m2/repository/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.jar:/Users/oschmitt/.m2/repository/org/codehaus/plexus/plexus-io/2.0.4/plexus-io-2.0.4.jar:/Users/oschmitt/.m2/repository/org/apache/maven/maven-compat/3.5.0/maven-compat-3.5.0.jar:/Users/oschmitt/.m2/repository/org/apache/maven/wagon/wagon-provider-api/2.12/wagon-provider-api-2.12.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 org.web3j.mavenplugin.solidity.SolidityCompilerTest
objc[721]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/bin/java (0x1068334c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x1068fb4e0). One of the two will be used. Which one is undefined.

h2mch added a commit that referenced this issue Jul 18, 2017
os property survived
h2mch added a commit that referenced this issue Jul 18, 2017
os property survived. fix test
@h2mch
Copy link
Contributor

h2mch commented Jul 18, 2017

After a lot of commit noise and help from @kabl:
The issue was an unittest, which had not revert the systemproperty "os.image".

See the new version of SolCTest.java

Sorry for that!

@h2mch h2mch closed this as completed Jul 18, 2017
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