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

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

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

Comments

Projects
None yet
6 participants
@edubkendo
Member

edubkendo commented Apr 4, 2013

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

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost 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 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 pushed a commit that referenced this issue Apr 4, 2013

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Apr 4, 2013

@edubkendo Please re-test with jruby-master

ghost commented Apr 4, 2013

@edubkendo Please re-test with jruby-master

@ghost ghost closed this Apr 4, 2013

@edubkendo

This comment has been minimized.

Show comment
Hide comment
@edubkendo

edubkendo Apr 5, 2013

Member

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

Member

edubkendo commented Apr 5, 2013

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

@edubkendo

This comment has been minimized.

Show comment
Hide comment
@edubkendo

edubkendo Apr 5, 2013

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.

Member

edubkendo commented Apr 5, 2013

@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 pushed a commit to jruby/jruby-launcher that referenced this issue Apr 9, 2013

@edubkendo

This comment has been minimized.

Show comment
Hide comment
@edubkendo
Member

edubkendo commented Apr 26, 2013

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius May 1, 2013

Member

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.

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

This comment has been minimized.

Show comment
Hide comment
@edubkendo

edubkendo May 1, 2013

Member

12.04

Member

edubkendo commented May 1, 2013

12.04

@nurettin

This comment has been minimized.

Show comment
Hide comment
@nurettin

nurettin 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)

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

This comment has been minimized.

Show comment
Hide comment
@CootCraig

CootCraig May 21, 2013

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)

CootCraig commented May 21, 2013

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

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost 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.

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.

@BanzaiMan

This comment has been minimized.

Show comment
Hide comment
@hone

This comment has been minimized.

Show comment
Hide comment
@hone

hone 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'.

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

This comment has been minimized.

Show comment
Hide comment
@BanzaiMan

BanzaiMan Jul 25, 2013

Member

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

Member

BanzaiMan commented Jul 25, 2013

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

@hone

This comment has been minimized.

Show comment
Hide comment
@hone

hone 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.

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

This comment has been minimized.

Show comment
Hide comment
@BanzaiMan

BanzaiMan Jul 26, 2013

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.

Member

BanzaiMan commented Jul 26, 2013

@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.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment