Re: [jruby-user] JRuby 1.7.17: getppid unsupported or native support failed to load

Michael Pitman <[email protected]> Mon, 22 Dec 2014 10:37:32 +1100
Newsgroups gmane.comp.lang.jruby.user
Message-ID <CAL-6QiVeSG9q=9n49Cw4aChgPR2-16KqzOXFqxuQCHFPTHpOOQ@mail.gmail.com>
Hi Tom,

So it's picking up the library as "libcrypt.so.1" if it's installed in /lib
(as it is in Ubuntu 10.04), but not if it's installed
under /lib/x86_64-linux-gnu (as it is in Ubuntu 12.04).

I can get it to load if I do either:

ln -s /lib/x86_64-linux-gnu/libcrypt-2.15.so /lib/libcrypt.so.1
or
ln -s /lib/x86_64-linux-gnu/libcrypt-2.15.so
/lib/x86_64-linux-gnu/libcrypt.so

ie link from /lib to /lib/x86_64-linux-gnu/ as libcrypt.so.1 or create the
link as simply libcrypt.so under /lib/x86_64-linux-gnu

It feels to me like that's not going to be the root cause, but rather would
indicate a mis-configuration of the machine somewhere.

Is it possible to get jruby working with this configuration (eg by using
fall-backs), or do we consider this a machine configuration problem, and
fix it on our production servers?

Thanks,

Michael



On 20 December 2014 at 11:36, Michael Pitman <[email protected]>
wrote:

> Hi Tom,
>
> Thanks for that, it certainly detected the underlying problem:
>
> > jruby -Xnative.verbose=true -e 'p Process.ppid'
>
> Failed to load native POSIX impl; falling back on Java impl. Stacktrace
> follows.
> java.lang.UnsatisfiedLinkError: libcrypt.so: cannot open shared object
> file: No such file or directory
> at
> jnr.ffi.provider.jffi.NativeLibrary.loadNativeLibraries(NativeLibrary.java:87)
> at
> jnr.ffi.provider.jffi.NativeLibrary.getNativeLibraries(NativeLibrary.java:70)
> at
> jnr.ffi.provider.jffi.NativeLibrary.getSymbolAddress(NativeLibrary.java:49)
> at
> jnr.ffi.provider.jffi.NativeLibrary.findSymbolAddress(NativeLibrary.java:59)
> at
> jnr.ffi.provider.jffi.AsmLibraryLoader.generateInterfaceImpl(AsmLibraryLoader.java:117)
> at
> jnr.ffi.provider.jffi.AsmLibraryLoader.loadLibrary(AsmLibraryLoader.java:59)
> at
> jnr.ffi.provider.jffi.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:43)
> at jnr.ffi.LibraryLoader.load(LibraryLoader.java:265)
> at jnr.ffi.Library.loadLibrary(Library.java:123)
> at
> jnr.posix.POSIXFactory$DefaultLibCProvider$SingletonHolder.<clinit>(POSIXFactory.java:223)
> at
> jnr.posix.POSIXFactory$DefaultLibCProvider.getLibC(POSIXFactory.java:227)
> at jnr.posix.BaseNativePOSIX.<init>(BaseNativePOSIX.java:36)
> at jnr.posix.LinuxPOSIX.<init>(LinuxPOSIX.java:18)
> at jnr.posix.POSIXFactory.loadLinuxPOSIX(POSIXFactory.java:95)
> at jnr.posix.POSIXFactory.loadNativePOSIX(POSIXFactory.java:69)
> at jnr.posix.POSIXFactory.loadPOSIX(POSIXFactory.java:38)
> at jnr.posix.LazyPOSIX.loadPOSIX(LazyPOSIX.java:35)
> at jnr.posix.LazyPOSIX.posix(LazyPOSIX.java:31)
> at jnr.posix.LazyPOSIX.umask(LazyPOSIX.java:301)
> at org.jruby.RubyFile.getUmaskSafe(RubyFile.java:1514)
> ...
> NotImplementedError: getppid unsupported or native support failed to load
>
>
> The machine has libcrypt installed:
>
> > ldconfig -p  | grep libcrypt
> libcrypto.so.1.0.0 (libc6,x86-64) =>
> /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
> libcrypto.so.0.9.8 (libc6,x86-64) =>
> /lib/x86_64-linux-gnu/libcrypto.so.0.9.8
> libcrypto.so.0.9.8 (libc6,x86-64) =>
> /usr/lib/x86_64-linux-gnu/libcrypto.so.0.9.8
> libcrypt.so.1 (libc6,x86-64, OS ABI: Linux 2.6.24) =>
> /lib/x86_64-linux-gnu/libcrypt.so.1
>
>
> But it's not installed as libcrypt.so, since the package libc6 is
> installed, but not libc6-dev, which installs and links that file. It also
> explains why this is working on our dev machines, but not on the
> production-like boxes.
>
> I'd rather not ask our clients to install development libraries on their
> production machines, so is it possible to coerce jruby to use the library
> installed as .so.1  if it is found?
>
> Thanks,
>
> Michael
>
>
>
>
>
> On 20 December 2014 at 01:36, Thomas E Enebo <[email protected]> wrote:
>>
>> Can you try jruby -Xnative.verbose=true -e 'p Process.ppid'?  Can you
>> also tell me whether this machine has libcrypt?  That was the main change
>> to jnr-posix around 1.7.17's release.
>>
>> -Tom
>>
>> On Thu, Dec 18, 2014 at 3:37 PM, Michael Pitman <
>> [email protected]> wrote:
>>>
>>> Hi,
>>>
>>> I'm getting an error trying to run a "runnable" war on one of our
>>> production (Ubuntu 12.04) machines under jruby 1.7.17. We have isolated it
>>> just to 1.7.17, since it works OK when using 1.7.16.2, and all other gems
>>> and code are identical.
>>>
>>> There must be something on that machining that's triggering this to
>>> happen, since the exact same war file works on other machines. The machine
>>> was failing while running java version 1.7.0_21, but I upgraded java
>>> to 1.7.0_72 and it continues to fail.
>>>
>>> Anyway, below is the stack trace, and I'd appreciate any help in
>>> resolving the issue. Below that I've listed the linked library versions, if
>>> that's any help.
>>>
>>> Thanks very much,
>>>
>>> Michael
>>>
>>> NotImplementedError: getppid unsupported or native support failed to load
>>> org/jruby/RubyProcess.java:752:in `ppid'
>>> org/jruby/RubyProcess.java:749:in `ppid'
>>> /tmp/jruby8149531281028435272extract/gems/gems/systemu-2.6.4/lib/systemu.rb:28:in
>>> `SystemUniversal'
>>> /tmp/jruby8149531281028435272extract/gems/gems/systemu-2.6.4/lib/systemu.rb:13:in
>>> `(root)'
>>> org/jruby/RubyKernel.java:1071:in `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in
>>> `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:236:in
>>> `load_dependency'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in
>>> `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/macaddr-1.7.1/lib/macaddr.rb:1:in
>>> `(root)'
>>> org/jruby/RubyKernel.java:1071:in `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in
>>> `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:236:in
>>> `load_dependency'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in
>>> `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/macaddr-1.7.1/lib/macaddr.rb:23:in
>>> `(root)'
>>> org/jruby/RubyKernel.java:1071:in `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in
>>> `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:236:in
>>> `load_dependency'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in
>>> `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/uuid-2.3.7/lib/uuid.rb:1:in
>>> `(root)'
>>> org/jruby/RubyKernel.java:1071:in `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in
>>> `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:236:in
>>> `load_dependency'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in
>>> `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/uuid-2.3.7/lib/uuid.rb:14:in
>>> `(root)'
>>> org/jruby/RubyKernel.java:1071:in `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in
>>> `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:236:in
>>> `load_dependency'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in
>>> `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/savon-2.8.0/lib/savon/header.rb:1:in
>>> `(root)'
>>> org/jruby/RubyKernel.java:1071:in `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in
>>> `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:236:in
>>> `load_dependency'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in
>>> `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/savon-2.8.0/lib/savon/header.rb:3:in
>>> `(root)'
>>> org/jruby/RubyKernel.java:1071:in `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in
>>> `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:236:in
>>> `load_dependency'
>>> /tmp/jruby8149531281028435272extract/gems/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in
>>> `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/savon-2.8.0/lib/savon/builder.rb:1:in
>>> `(root)'
>>> org/jruby/RubyKernel.java:1071:in `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/savon-2.8.0/lib/savon/builder.rb:1:in
>>> `(root)'
>>> org/jruby/RubyArray.java:1613:in `each'
>>> /tmp/jruby8149531281028435272extract/gems/gems/savon-2.8.0/lib/savon/operation.rb:1:in
>>> `(root)'
>>> org/jruby/RubyArray.java:1613:in `each'
>>> /tmp/jruby8149531281028435272extract/gems/gems/savon-2.8.0/lib/savon/operation.rb:4:in
>>> `(root)'
>>> /tmp/jruby8149531281028435272extract/gems/gems/savon-2.8.0/lib/savon/client.rb:1:in
>>> `(root)'
>>> /tmp/jruby8149531281028435272extract/gems/gems/savon-2.8.0/lib/savon/client.rb:1:in
>>> `(root)'
>>> org/jruby/RubyKernel.java:1071:in `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/savon-2.8.0/lib/savon.rb:1:in
>>> `(root)'
>>> org/jruby/RubyKernel.java:1087:in `load'
>>> /tmp/jruby8149531281028435272extract/gems/gems/savon-2.8.0/lib/savon.rb:26:in
>>> `(root)'
>>> /tmp/jruby8149531281028435272extract/gems/gems/bundler-1.7.8/lib/bundler/runtime.rb:1:in
>>> `(root)'
>>> /tmp/jruby8149531281028435272extract/gems/gems/bundler-1.7.8/lib/bundler/runtime.rb:76:in
>>> `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/bundler-1.7.8/lib/bundler/runtime.rb:72:in
>>> `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/bundler-1.7.8/lib/bundler/runtime.rb:61:in
>>> `require'
>>> /tmp/jruby8149531281028435272extract/gems/gems/bundler-1.7.8/lib/bundler.rb:134:in
>>> `require'
>>> /tmp/jruby8149531281028435272extract/config/application.rb:13:in `(root)'
>>> /tmp/jruby8149531281028435272extract/Rakefile:1:in `(root)'
>>> /tmp/jruby8149531281028435272extract/gems/gems/rake-10.4.2/bin/rake:36:in
>>> `(root)'
>>> error: org.jruby.exceptions.RaiseException: (SystemExit) exit
>>>
>>>
>>>
>>>
>>>
>>> > ldd `which java`
>>> linux-vdso.so.1 =>  (0x00007fffa53fe000)
>>> libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
>>> (0x00007fb13ca13000)
>>> libjli.so => not found
>>> libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fb13c80e000)
>>> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb13c44f000)
>>> /lib64/ld-linux-x86-64.so.2 (0x00007fb13cc36000)
>>>
>>> /lib/x86_64-linux-gnu/libpthread.so.0 -> libpthread-2.15.so
>>> /lib/x86_64-linux-gnu/libdl.so.2 -> libdl-2.15.so
>>> /lib/x86_64-linux-gnu/libc.so.6 -> libc-2.15.so
>>> /lib64/ld-linux-x86-64.so.2 -> /lib/x86_64-linux-gnu/ld-2.15.so
>>>
>>>
>>>
>>
>> --
>> blog: http://blog.enebo.com       twitter: tom_enebo
>> mail: [email protected]
>>
>