"NotImplementedError: waitpid unsupported or native support failed to load" with 9.0.0.0 on Ubuntu if build tools not installed #3285

Closed
npryce opened this Issue Aug 26, 2015 · 9 comments

Comments

Projects
None yet
4 participants
@npryce

npryce commented Aug 26, 2015

Installing JRuby 9.0.0.0 with rbenv and ruby-build in a Docker container running Ubuntu 14.04 and Oracle Java JDK 1.8.0_60.

If we do not install the build-essential package with apt-get first, installing JRuby fails, with the error message:

"NotImplementedError: waitpid unsupported or native support failed to load"

JRuby appears to depend on a library installed as a dependency of build-essentials, but it's not clear which one.

We would prefer not to install build-essentials on a production box, so this is currently a problem for us.

As a workaround, could you specify which .so(s) are required by JRuby to implement its POSIX runtime API?

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Aug 26, 2015

Member

On Linux systems I believe all we try to load is libc and licrypt. Perhaps you could trace the startup of the JVM + JRuby and see which library is failing to load? You can also try passing -Xnative.verbose=true to JRuby.

There are some systems where /tmp is not allowed to contain executable code, breaking our unpack+load of FFI libraries. I don't think that's the case here, though.

Member

headius commented Aug 26, 2015

On Linux systems I believe all we try to load is libc and licrypt. Perhaps you could trace the startup of the JVM + JRuby and see which library is failing to load? You can also try passing -Xnative.verbose=true to JRuby.

There are some systems where /tmp is not allowed to contain executable code, breaking our unpack+load of FFI libraries. I don't think that's the case here, though.

@mkristian

This comment has been minimized.

Show comment
Hide comment
@mkristian

mkristian Aug 26, 2015

Member
Member

mkristian commented Aug 26, 2015

@mkristian

This comment has been minimized.

Show comment
Hide comment
@mkristian

mkristian Aug 26, 2015

Member

it was jvm tar.gz installed from orable (no apt or dpkg) no build-essentials, etc does fail to find libcrypt

Member

mkristian commented Aug 26, 2015

it was jvm tar.gz installed from orable (no apt or dpkg) no build-essentials, etc does fail to find libcrypt

@npryce

This comment has been minimized.

Show comment
Hide comment
@npryce

npryce Aug 26, 2015

It appears that on Ubuntu, libcrypt is installed as libcrypt.so.1, not as libcrypt.so. For example:

# ldconfig -p | grep libcrypt
    libcrypto.so.1.0.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
    libcrypt.so.1 (libc6,x86-64, OS ABI: Linux 2.6.24) => /lib/x86_64-linux-gnu/libcrypt.so.1

Installing libc6-dev creates a symlink for libcrypt.so under /usr/lib. For example:

# ls -l /usr/lib/x86_64-linux-gnu/libcrypt.so 
lrwxrwxrwx 1 root root 35 Feb 25 16:57 /usr/lib/x86_64-linux-gnu/libcrypt.so -> /lib/x86_64-linux-gnu/libcrypt.so.1

After that, the library can be loaded by the name libcrypt.so:

root@5e34dcccdeb1:/lib/x86_64-linux-gnu# ldconfig -p | grep libcrypt
    libcrypto.so.1.0.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
    libcrypt.so.1 (libc6,x86-64, OS ABI: Linux 2.6.24) => /lib/x86_64-linux-gnu/libcrypt.so.1
    libcrypt.so (libc6,x86-64, OS ABI: Linux 2.6.24) => /usr/lib/x86_64-linux-gnu/libcrypt.so

Not sure what the solution is, but JRuby should be able to run on production machines that do not have development tools installed.

npryce commented Aug 26, 2015

It appears that on Ubuntu, libcrypt is installed as libcrypt.so.1, not as libcrypt.so. For example:

# ldconfig -p | grep libcrypt
    libcrypto.so.1.0.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
    libcrypt.so.1 (libc6,x86-64, OS ABI: Linux 2.6.24) => /lib/x86_64-linux-gnu/libcrypt.so.1

Installing libc6-dev creates a symlink for libcrypt.so under /usr/lib. For example:

# ls -l /usr/lib/x86_64-linux-gnu/libcrypt.so 
lrwxrwxrwx 1 root root 35 Feb 25 16:57 /usr/lib/x86_64-linux-gnu/libcrypt.so -> /lib/x86_64-linux-gnu/libcrypt.so.1

After that, the library can be loaded by the name libcrypt.so:

root@5e34dcccdeb1:/lib/x86_64-linux-gnu# ldconfig -p | grep libcrypt
    libcrypto.so.1.0.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
    libcrypt.so.1 (libc6,x86-64, OS ABI: Linux 2.6.24) => /lib/x86_64-linux-gnu/libcrypt.so.1
    libcrypt.so (libc6,x86-64, OS ABI: Linux 2.6.24) => /usr/lib/x86_64-linux-gnu/libcrypt.so

Not sure what the solution is, but JRuby should be able to run on production machines that do not have development tools installed.

@mkristian

This comment has been minimized.

Show comment
Hide comment
@mkristian

mkristian Aug 26, 2015

Member

my patch for jnr/ffi will solve this issue by using /etc/ld.conf.d/* to find the library paths.

Member

mkristian commented Aug 26, 2015

my patch for jnr/ffi will solve this issue by using /etc/ld.conf.d/* to find the library paths.

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Sep 3, 2015

Member

@mkristian Ahh, very nice. I will merge that and push a snapshot dependency for JRuby. We'll see how it looks and let it bake for a while.

Member

headius commented Sep 3, 2015

@mkristian Ahh, very nice. I will merge that and push a snapshot dependency for JRuby. We'll see how it looks and let it bake for a while.

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Sep 3, 2015

Member

I have merged jnr/jnr-ffi#50 plus some tweaks and will update 1.7 and master to use jnr-ffi 2.0.4-SNAPSHOT. We'll need to release it before 1.7.23 and 9.0.2.0.

Member

headius commented Sep 3, 2015

I have merged jnr/jnr-ffi#50 plus some tweaks and will update 1.7 and master to use jnr-ffi 2.0.4-SNAPSHOT. We'll need to release it before 1.7.23 and 9.0.2.0.

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Sep 3, 2015

Member

1.7 update is in 4bee414.

Member

headius commented Sep 3, 2015

1.7 update is in 4bee414.

@stefanhorning

This comment has been minimized.

Show comment
Hide comment
@stefanhorning

stefanhorning Sep 30, 2015

For me jruby-9.0.1.0 installs just fine (without build essentials). But in order to be able to use it's gem command (to install bundler) I also had to resolve the libcrypy issue first with an apt-get intsall libc6-dev.

The error I had:

ubuntu@ip-10-0-3-36:~$ /opt/rubies/jruby-9.0.1.0/bin/gem install bundler
Fetching: bundler-1.10.6.gem (100%)
NotImplementedError: waitpid unsupported or native support failed to load
                       flock at org/jruby/RubyFile.java:298
  block in cache_update_path at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/remote_fetcher.rb:316
                        open at org/jruby/RubyIO.java:1126
                        open at org/jruby/RubyKernel.java:310
           cache_update_path at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/remote_fetcher.rb:315
                    download at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/remote_fetcher.rb:174
                    download at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/source.rb:210
                    download at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/resolver/activation_request.rb:60
            block in install at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/request_set.rb:160
                        each at org/jruby/RubyArray.java:1560
                     install at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/request_set.rb:150
                 install_gem at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/commands/install_command.rb:249
       block in install_gems at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/commands/install_command.rb:299
                        each at org/jruby/RubyArray.java:1560
                install_gems at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/commands/install_command.rb:295
                     execute at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/commands/install_command.rb:202
      invoke_with_build_args at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/command.rb:307
                process_args at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/command_manager.rb:168
                         run at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/command_manager.rb:138
                         run at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/gem_runner.rb:54
                       <top> at /opt/rubies/jruby-9.0.1.0/bin/jgem:21
                        load at org/jruby/RubyKernel.java:957
                       <top> at /opt/rubies/jruby-9.0.1.0/bin/gem:4

And after an apt-get install libc6-dev (and cleaning the gem cache), it just worked:

/opt/rubies/jruby-9.0.1.0/bin/gem install bundler
Fetching: bundler-1.10.6.gem (100%)
Successfully installed bundler-1.10.6
1 gem installed

For me jruby-9.0.1.0 installs just fine (without build essentials). But in order to be able to use it's gem command (to install bundler) I also had to resolve the libcrypy issue first with an apt-get intsall libc6-dev.

The error I had:

ubuntu@ip-10-0-3-36:~$ /opt/rubies/jruby-9.0.1.0/bin/gem install bundler
Fetching: bundler-1.10.6.gem (100%)
NotImplementedError: waitpid unsupported or native support failed to load
                       flock at org/jruby/RubyFile.java:298
  block in cache_update_path at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/remote_fetcher.rb:316
                        open at org/jruby/RubyIO.java:1126
                        open at org/jruby/RubyKernel.java:310
           cache_update_path at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/remote_fetcher.rb:315
                    download at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/remote_fetcher.rb:174
                    download at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/source.rb:210
                    download at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/resolver/activation_request.rb:60
            block in install at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/request_set.rb:160
                        each at org/jruby/RubyArray.java:1560
                     install at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/request_set.rb:150
                 install_gem at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/commands/install_command.rb:249
       block in install_gems at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/commands/install_command.rb:299
                        each at org/jruby/RubyArray.java:1560
                install_gems at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/commands/install_command.rb:295
                     execute at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/commands/install_command.rb:202
      invoke_with_build_args at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/command.rb:307
                process_args at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/command_manager.rb:168
                         run at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/command_manager.rb:138
                         run at /opt/rubies/jruby-9.0.1.0/lib/ruby/stdlib/rubygems/gem_runner.rb:54
                       <top> at /opt/rubies/jruby-9.0.1.0/bin/jgem:21
                        load at org/jruby/RubyKernel.java:957
                       <top> at /opt/rubies/jruby-9.0.1.0/bin/gem:4

And after an apt-get install libc6-dev (and cleaning the gem cache), it just worked:

/opt/rubies/jruby-9.0.1.0/bin/gem install bundler
Fetching: bundler-1.10.6.gem (100%)
Successfully installed bundler-1.10.6
1 gem installed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment