jruby dies with fatal error on jdk8-ea-b83 on ubuntu #626

Closed
edubkendo opened this Issue Apr 4, 2013 · 15 comments

Projects

None yet

6 participants

@edubkendo
Member

I have previously used jruby with jdk8 ea build's, up to build 80, without problem. However, with build 83, any attempt to run any script with jruby, or to run jirb, it dies immediately with the error attached below. I can get jirb to run if I disable native with jruby -Xnative.enabled=false -S jirb, but otherwise it does this also.

Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /home/eric/installs/jruby-1.7.3/lib/native/arm-Linux/libjffi-1.2.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f6ad31614c4, pid=6325, tid=140096765916928
#
# JRE version: Java(TM) SE Runtime Environment (8.0-b83) (build 1.8.0-ea-b83)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.0-b24 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libc.so.6+0x964c4]  envz_strip+0x214
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/eric/hs_err_pid6325.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Aborted (core dumped)

Logfile:

https://gist.github.com/edubkendo/5469502#file-logfile

(Replaced some of the text with link to a gist at the suggestion of github support staff, after no longer being able to comment here)

@ghost
ghost commented Apr 4, 2013

This is a problem with the jruby.sh laucher script.

The clue is this:

/home/eric/installs/jruby-1.7.3/lib/native/arm-Linux/libjffi-1.2.so

When the arch of your jvm is amd64.

I think this can be fixed in jffi - it should search in arch-specific subdirs for the stub lib to load, instead of just blindly load libjffi-1.2.so from each of the dirs in jffi.boot.library.path.

Of course ... the jvm shouldn't be crashing when trying to load a shared lib from an incorrect arch - it should raise an error.

@ghost Unknown added a commit that referenced this issue Apr 4, 2013
Wayne Meissner Upgrade to jffi-1.2.7 for issue #626 c6cb101
@ghost
ghost commented Apr 4, 2013

@edubkendo Please re-test with jruby-master

@ghost ghost closed this Apr 4, 2013
@edubkendo
Member

I cloned master, ran ant, but still get this same error.

@edubkendo
Member

@wmeissner Ok, I've recloned and rebuilt master several times now, thinking that perhaps I was doing something wrong, but no matter what, if I run it with the jdk8-ea-b83 then I continue to get the error from above. Since you mentioned that the issue was in jruby.sh, and it looked like your fix was made there, I tried running directly from jruby.sh like so: jruby.sh -S jirb and jruby.sh myScript.rb but then I get the error:

/home/eric/installs/jruby-1.7.4.dev/bin/jruby.sh: 61: /home/eric/installs/jruby-1.7.4.dev/bin/jruby.sh: Bad substitution

(That's after running ant, then ant dist to build a tarball and installing it. If I just run ant and then run from bin/jruby.sh I get the same error with a different path of course)

So, at a bit of a loss. I'm maybe missing some crucial step or doing something obviously wrong but just unsure what else to try. Thanks.

@ghost Unknown added a commit to jruby/jruby-launcher that referenced this issue Apr 9, 2013
Wayne Meissner Prefix jffi boot path with lib/native for jruby/jruby#626 72841ed
@edubkendo
Member
@headius
Member
headius commented May 1, 2013

Ok, let's get to the bottom of this. If you can give me an exact Ubuntu version, I will attempt to reproduce and figure out what's going on.

@edubkendo
Member

12.04

@nurettin
nurettin commented May 2, 2013

$ jruby --version
jruby 1.7.2 (1.9.3p327) 2013-01-04 302c706 on Java HotSpot(TM) 64-Bit Server VM 1.8.0-ea-b87 +indy [linux-amd64]

I'm getting the same warning, but jruby runs fine afterwards. (ubuntu 13.04 raring)

@CootCraig

Getting warning on Ubuntu 13.04 raring. JRuby 1.7.4
https://gist.github.com/CootCraig/5618061

craig@craigs:/opt/ruby/jruby/bin$ jruby -v
jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on Java HotSpot(TM) 64-Bit Server VM 1.8.0-ea-b90 +indy [linux-amd64]
craig@craigs:/opt/ruby/jruby/bin$ bash /opt/ruby/jruby/bin/jruby.sh -S gem list

*** LOCAL GEMS ***

rake (10.0.3)

craig@craigs:$ which gem
/opt/ruby/jruby/bin/gem
craig@craigs:
$ gem list
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /opt/ruby/jruby-1.7.4/lib/native/arm-Linux/libjffi-1.2.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c ', or link it with '-z noexecstack'.

*** LOCAL GEMS ***

rake (10.0.3)

@ghost
ghost commented May 21, 2013

It looks like problem is that jruby-launcher hasn't been re-released and (re-)installed.
Can you guys try something like this:

git clone git@github.com:jruby/jruby-launcher.git
cd jruby-launcher
make
/path/to/bin/jruby.sh -S rake package
/path/to/bin/jruby.sh -S gem install pkg/jruby-launcher-1.0.17.dev-java.gem

If that works, then @headius or @enebo need to spin a new release of the jruby-launcher gem.

@hone
hone commented Jul 25, 2013

We're running into this on Heroku as well. We updated our JDK to OpenJDK 64-Bit Server VM 1.7.0_40-b20 to better support invoke dynamic. I upgraded jruby-launcher to 1.0.17 on all the jrubies, but I'm still seeing the libffi warnings on JRuby 1.7.3 and lower. It's not present in 1.7.4 with the latest jruby-launcher.

OpenJDK 64-Bit Server VM warning: You have loaded library /tmp/build_2yc9uanzqvhes/vendor/ruby-1.8.7-jruby-1.7.3/lib/native/i386-Linux/libjffi-1.2.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
@BanzaiMan
Member

@hone Is it possible to upgrade JRuby to 1.7.4, or are you stuck for whatever reason on 1.7.3?

@hone
hone commented Jul 25, 2013

@BanzaiMan this is for supporting JRuby 1.7.3 and lower on Heroku, so it's not really in my control if the customer chooses to upgrade their app or not.

@BanzaiMan
Member

@hone Is there a way for me to look at a failing case? Your JVM is 64-bit, but JRuby is looking for the shared object file in the 32-bit directory.

@gbenedict gbenedict added a commit to RedFunnel/heroku-buildpack-ruby that referenced this issue Jan 9, 2014
@hone @gbenedict hone + gbenedict special case JRuby 1.7.3 to older JDKs due to jffi bug 711ec71
@squeedee squeedee added a commit to cloudfoundry/ruby-buildpack that referenced this issue Apr 10, 2014
@hone @squeedee hone + squeedee special case JRuby 1.7.3 to older JDKs due to jffi bug 3e71fce
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment