[GRADLE-3076] Gradle 1.12-rc-2 fails with UnsatisfiedLinkError on some Linux versions. Created: 26/Apr/14 Updated: 12/Feb/15 Resolved: 04/Feb/15 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | 2.3-rc-2 |
Type: | Bug | ||
Reporter: | Gradle Forums | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 8 |
Issue Links: |
|
Description |
My gradle build is kicked off by a Linux shell script runs gradlew with SunJDK 1.6.0_45. It works fine one a box "Linux XXX 2.6.32-358.23.2.el6.x86_64 #1 SMP Sat Sep 14 05:32:37 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux". It fails on a box "Linux YYY 2.6.9-103.EL.msdw.1largesmp #1 SMP Mon Dec 12 13:34:16 EST 2011 x86_64 x86_64 x86_64 GNU/Linux" with the following error: FAILURE: Build failed with an exception.
|
Comments |
Comment by Adam Murdoch [ 07/May/14 ] |
Probably a duplicate of |
Comment by Joern Huxhorn [ 17/Jun/14 ] |
We have a similar issue with 1.12 on our build server. Linux hostname 2.6.32-431.11.2.el6.x86_64 #1 SMP Tue Mar 25 11:15:18 CDT 2014 x86_64 x86_64 x86_64 GNU/Linux Scientific Linux release 6.5 (Carbon) java version "1.8.0_05" Java(TM) SE Runtime Environment (build 1.8.0_05-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode) Scientific Linux release 6.5 is the current version so this isn't caused by an outdated operating system. org.gradle.internal.service.ServiceCreationException: Could not create service of type DaemonContext using DaemonServices.createDaemonContext(). at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:638) at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:592) at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectProvider.getInstance(DefaultServiceRegistry.java:434) at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:474) at org.gradle.internal.service.DefaultServiceRegistry.doGet(DefaultServiceRegistry.java:295) at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:279) at org.gradle.launcher.daemon.server.DaemonServices.getDaemonLogFile(DaemonServices.java:71) at org.gradle.launcher.daemon.bootstrap.DaemonMain.doAction(DaemonMain.java:99) at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) at org.gradle.launcher.daemon.bootstrap.DaemonMain.main(DaemonMain.java:82) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50) at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32) at org.gradle.launcher.daemon.bootstrap.GradleDaemon.main(GradleDaemon.java:22) Caused by: org.gradle.internal.service.ServiceCreationException: Could not create service of type ProcessEnvironment using NativeServices.createProcessEnvironment(). at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:638) at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:592) at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectProvider.getInstance(DefaultServiceRegistry.java:434) at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:474) at org.gradle.internal.service.DefaultServiceRegistry.doGet(DefaultServiceRegistry.java:295) at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:283) at org.gradle.internal.service.DefaultServiceRegistry$ParentServices.getService(DefaultServiceRegistry.java:846) at org.gradle.internal.service.DefaultServiceRegistry$CompositeProvider.getService(DefaultServiceRegistry.java:791) at org.gradle.internal.service.DefaultServiceRegistry$CompositeProvider.getService(DefaultServiceRegistry.java:791) at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext.find(DefaultServiceRegistry.java:981) at org.gradle.internal.service.DefaultServiceRegistry.doGet(DefaultServiceRegistry.java:293) at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:279) at org.gradle.launcher.daemon.server.DaemonServices.createDaemonContext(DaemonServices.java:58) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63) at org.gradle.internal.service.DefaultServiceRegistry.invoke(DefaultServiceRegistry.java:323) at org.gradle.internal.service.DefaultServiceRegistry.access$1200(DefaultServiceRegistry.java:53) at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:636) ... 16 more Caused by: net.rubygrapefruit.platform.NativeException: Failed to load native library 'libnative-platform.so' for Linux amd64. at net.rubygrapefruit.platform.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:49) at net.rubygrapefruit.platform.Native.init(Native.java:55) at net.rubygrapefruit.platform.Native.get(Native.java:80) at org.gradle.internal.nativeplatform.services.NativeServices.createProcessEnvironment(NativeServices.java:94) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63) at org.gradle.internal.service.DefaultServiceRegistry.invoke(DefaultServiceRegistry.java:323) at org.gradle.internal.service.DefaultServiceRegistry.access$1200(DefaultServiceRegistry.java:53) at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:636) ... 36 more Caused by: java.lang.UnsatisfiedLinkError: /tmp/native-platform1661764416051624276dir/libnative-platform.so: /tmp/native-platform1661764416051624276dir/libnative-platform.so: failed to map segment from shared object: Operation not permitted at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1929) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1814) at java.lang.Runtime.load0(Runtime.java:809) at java.lang.System.load(System.java:1083) at net.rubygrapefruit.platform.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:45) ... 47 more The issue is that the OS disallows loading of .so from the tempfs. $ mount | grep /tmp tmpfs on /tmp type tmpfs (rw,noexec) Setting the java.io.tmpdir system property to a mounted filesystem without noexec option is a workaround. |
Comment by Joern Huxhorn [ 17/Jun/14 ] |
Using -Dorg.gradle.native=false as suggested in the forum did NOT fix the problem and resulted in the following exception. Picked up _JAVA_OPTIONS: -Dorg.gradle.native=false FAILURE: Build failed with an exception. * What went wrong: Could not create service of type FileSystem using FileSystemServices.createFileSystem(). |
Comment by Joern Huxhorn [ 17/Jun/14 ] |
Whoops, just found Gradle v1.12 daemon fails to start if /tmp is mounted with noexec in the forum. |
Comment by Sven Reimers [ 18/Jun/14 ] |
Same problem for me running RHEL 6 with noexec mounted /tmp. This problem is still in 2.0-rc-1. |
Comment by Adam Murdoch [ 19/Jun/14 ] |
Can you try with the 2.0-rc-1 release? This problem should be fixed now. |
Comment by Joern Huxhorn [ 20/Jun/14 ] |
I'm currently on vacation so I don't have full access to our build infrastructure. I'll try to test this somehow, though. We have a bit of a hen-egg-issue regarding our main project because of the propdeps-plugin issue described in http://forums.gradle.org/gradle/topics/gradle_2_0_rc_1_is_now_available_for_testing They have fixed the issue (see https://github.com/spring-projects/gradle-plugins/issues/41 ) but didn't perform a release yet (see http://repo.spring.io/plugins-release/org/springframework/build/gradle/propdeps-plugin/ ). And all our builds use that plugin... But Sven Reimers above said that the problem still exists in 2.0-rc-1. |
Comment by Sven Reimers [ 23/Jun/14 ] |
This problem is still in 2.0-rc-2. |
Comment by Joern Huxhorn [ 23/Jun/14 ] |
Can confirm that this is still broken in 2.0-rc-2 StackTrace with 2.0-rc-2: org.gradle.internal.service.ServiceCreationException: Could not create service of type DaemonContext using DaemonServices.createDaemonContext(). at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:639) at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:593) at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectProvider.getInstance(DefaultServiceRegistry.java:435) at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:475) at org.gradle.internal.service.DefaultServiceRegistry.doGet(DefaultServiceRegistry.java:296) at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:280) at org.gradle.launcher.daemon.server.DaemonServices.getDaemonLogFile(DaemonServices.java:71) at org.gradle.launcher.daemon.bootstrap.DaemonMain.doAction(DaemonMain.java:82) at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54) at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35) at org.gradle.launcher.daemon.bootstrap.GradleDaemon.main(GradleDaemon.java:22) Caused by: org.gradle.internal.service.ServiceCreationException: Could not create service of type ProcessEnvironment using NativeServices.createProcessEnvironment(). at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:639) at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:593) at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectProvider.getInstance(DefaultServiceRegistry.java:435) at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:475) at org.gradle.internal.service.DefaultServiceRegistry.doGet(DefaultServiceRegistry.java:296) at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:284) at org.gradle.internal.service.DefaultServiceRegistry$ParentServices.getService(DefaultServiceRegistry.java:847) at org.gradle.internal.service.DefaultServiceRegistry$CompositeProvider.getService(DefaultServiceRegistry.java:792) at org.gradle.internal.service.DefaultServiceRegistry$CompositeProvider.getService(DefaultServiceRegistry.java:792) at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext.find(DefaultServiceRegistry.java:982) at org.gradle.internal.service.DefaultServiceRegistry.doGet(DefaultServiceRegistry.java:294) at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:280) at org.gradle.launcher.daemon.server.DaemonServices.createDaemonContext(DaemonServices.java:58) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63) at org.gradle.internal.service.DefaultServiceRegistry.invoke(DefaultServiceRegistry.java:324) at org.gradle.internal.service.DefaultServiceRegistry.access$1200(DefaultServiceRegistry.java:54) at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:637) ... 15 more Caused by: net.rubygrapefruit.platform.NativeException: Failed to load native library 'libnative-platform.so' for Linux amd64. at net.rubygrapefruit.platform.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:49) at net.rubygrapefruit.platform.Native.init(Native.java:55) at net.rubygrapefruit.platform.Native.get(Native.java:80) at org.gradle.internal.nativeplatform.services.NativeServices.createProcessEnvironment(NativeServices.java:97) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63) at org.gradle.internal.service.DefaultServiceRegistry.invoke(DefaultServiceRegistry.java:324) at org.gradle.internal.service.DefaultServiceRegistry.access$1200(DefaultServiceRegistry.java:54) at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:637) ... 35 more Caused by: java.lang.UnsatisfiedLinkError: /tmp/native-platform1558613371714991939dir/libnative-platform.so: /tmp/native-platform1558613371714991939dir/libnative-platform.so: failed to map segment from shared object: Operation not permitted at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1929) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1814) at java.lang.Runtime.load0(Runtime.java:809) at java.lang.System.load(System.java:1083) at net.rubygrapefruit.platform.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:45) ... 46 more |
Comment by Aurélien Giraudon [ 06/Sep/14 ] |
Confirm that the bug still exist in 2.1-rc4 (this time with chmod and not symlink, as I don't want to open up a duplicate and it seems quite the same so I'm posting it here). ------------------------------------------------------------ Gradle 2.1-rc-4 ------------------------------------------------------------ Build time: 2014-09-03 09:20:53 UTC Build number: none Revision: e6cf70745ac11fa943e19294d19a2c527a669a53 Groovy: 2.3.6 Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013 JVM: 1.7.0_45 (Oracle Corporation 24.45-b08) OS: Linux 3.2.0-4-amd64 i386 Linux XXXXX 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux FAILURE: Build failed with an exception. * What went wrong: net.rubygrapefruit.platform.internal.jni.PosixFileFunctions.chmod(Ljava/lang/String;ILnet/rubygrapefruit/platform/internal/FunctionResult;)V * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Hope it can help ! (If it's not linked to the current bug I'll open a new one) |
Comment by François Guillot [ 11/Sep/14 ] |
Bug confirmed with official released gradle 2.1 :compileJava UP-TO-DATE FAILURE: Build failed with an exception.
|
Comment by François Guillot [ 01/Oct/14 ] |
Does anyone have a working solution to this problem ? I tried the same gradle build on two separate executors under my Jenkins server, one linux 32 bits, and the other linux 64 bits, and I get these kind of errors on the 32 bits one. Unfortunately I have to stick to the 32 bits build, due to the usage of a 32 bits only third party native library. |
Comment by Dennis Schridde [ 02/Nov/14 ] |
Setting systemProp.java.io.tmpdir=/some/dir/with/exec/set in ~/.gradle/gradle.properties did not work for me. It seems that gradle does not at all pick this up. Setting TMPDIR=... did not work, either. |
Comment by François Guillot [ 12/Dec/14 ] |
any progress or information on the subject ? My stack trace is ./gradlew clean build --stacktrace
|
Comment by Eric Wasserman [ 02/Feb/15 ] |
Has any progress been made on this bug? I am seeing the same stack trade as François. Thanks in advance! |
Comment by Gary Hale [ 03/Feb/15 ] |
A fix for the issue with the daemon and a noexec /tmp partition will be in 2.4. It should be in the latest nightly if you want to try it out. It's not clear to me whether this is the same issue as the one Francois reported or not, but it's likely that it is. It would be great if someone could confirm. |
Comment by Eric Wasserman [ 03/Feb/15 ] |
Thanks, Gary. Do you happen to know if there were any breaking changes from 2.1 to 2.4? Id be happy to give it a shot. I ask because we use a custom plugin at my office. |
Comment by Gary Hale [ 03/Feb/15 ] |
You can check the release notes for known issues: https://gradle.org/docs/nightly/release-notes#potential-breaking-changes |
Comment by Eric Wasserman [ 05/Feb/15 ] |
Hi Gary - I am struggling with testing this due to the problem I've posted here: http://forums.gradle.org/gradle/topics/how-do-you-create-the-model-component-closure-in-a-custom-plugin If you have any insight into this I would highly appreciate it. |
Comment by Morten Høgh [ 11/Feb/15 ] |
I'm also getting this: net.rubygrapefruit.platform.internal.jni.PosixFileFunctions.chmod(Ljava/lang/String;ILnet/rubygrapefruit/platform/internal/FunctionResult;)V even on Gradle 2.4-20150210230025+0000. If I downgrade again to Gradle-1.11 the issue goes away. I'm using: Java 1.8.0_20 (Oracle Corporation 25.20-b23) |
Comment by Gary Hale [ 11/Feb/15 ] |
I think this is actually a separate issue than the original issue reported here (daemon failing to initialize with a noexec /tmp partition) although the symptom is similar (UnsatisfiedLinkError). I've opened |
Comment by Morten Høgh [ 11/Feb/15 ] |
Found the solution. Rookie mistake. |
Comment by Eric Wasserman [ 11/Feb/15 ] |
Hey Morten. My issue looks more like yours than the separate issue Gary mentions above. What was the mistake? I'm hoping I'm currently making the same one. |
Comment by Gary Hale [ 12/Feb/15 ] |
Morten had reported that it was because he was using a 32-bit version of Java on a 64-bit machine: http://forums.gradle.org/gradle/topics/the-issue-gradle-3076-was-closed-a-bit-premature-if-i-can-help-solve-it-in-any-way-please-let |