Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Java HotSpot(TM) 64-Bit Server VM warning libjffi-1.2.so #899

Closed
giggothebest opened this Issue Jul 22, 2013 · 14 comments

Comments

Projects
None yet
9 participants

Hi,

i bought a new notebook(64-bit) and i need for a project jruby. On my old notebook it worked without a warning. My question is how can i solve this problem? Or isn't it that important?

Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /home/giggo/.rbenv/versions/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 ', or link it with '-z noexecstack'.

Owner

headius commented Jul 23, 2013

Can you compare the old and new Java versions? Others have been seeing this warning too and I'd like to get rid of it...but we need more information

docent commented Sep 15, 2013

Might be a slightly different issue, but I'm able to reproduce this in JRuby 1.7.4 on fresh Ubuntu 13.04 64-bit installation and the following Java:
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode).

The message is:
You have loaded library /home/docent/dev/projects/gifaday/jruby/lib/native/arm-Linux/libjffi-1.2.so which might have disabled stack guard. The VM will try to fix the stack guard now.

Notice JRuby is trying to load the library from lib/native/arm-Linux. (I'm on x64). After copying lib/x86_64-Linux/libjffi-1.2.so to arm-Linux the problem disappears.

twiz718 commented Sep 16, 2013

this is happening to me as well... it's also preventing my trinidad from serving up my jruby app. it only started on java 7u40. worked fine on 7u25 with jruby 1.7.4

@ghost

ghost commented Sep 17, 2013

Can someone test this with jruby master and jruby-launcher master? jffi.boot.path should no longer have each individual cpu+os subdir in it, and the jffi loader will only try to load ${cpu}-${os}/libjffi-1.2.so.

I think this is due to a change in the way hotspot loads libs via System.loadLibrary() - previously it would fail on incorrect arch/os combinations (e.g. trying to load arm on x86_64), but now just ignores the ELF header and tries to blindly load it.

docent commented Sep 17, 2013

Still happens with jruby from master
docent@docent-pc:/dev/projects/jruby-1.7.5.dev$ jruby -v
jruby 1.7.5.dev (1.9.3p392) 2013-09-16 815f778 on Java HotSpot(TM) 64-Bit
Server VM 1.7.0_40-b43 +indy [linux-amd64]
docent@docent-pc:
/dev/projects/jruby-1.7.5.dev$ gem install rails
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library
/home/docent/dev/projects/jruby-1.7.5.dev/lib/jni/arm-Linux/libjffi-1.2.sowhich
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'.

On Mon, Sep 16, 2013 at 4:52 PM, Alex Khanin notifications@github.comwrote:

this is happening to me as well... it's also preventing my trinidad from
serving up my jruby app. it only started on java 7u40. worked fine on 7u25
with jruby 1.7.4


Reply to this email directly or view it on GitHubhttps://github.com/jruby/jruby/issues/899#issuecomment-24515720
.

@ghost

ghost commented Sep 17, 2013

@docent Can you try again? I just pushed a fix to jruby.bash. Also, make sure rvm is using the latest jruby-launcher gem (or install it after rvm installing jruby-head)

Owner

headius commented Sep 17, 2013

@wmeissner That was my theory as well. There was no other good explanation
for why the ARM binary would be seen by an x86 JDK. It also did not show up
in lsof afterwards, so it's just loading it, reporting errors, and then
rejecting it anyway because it's the wrong platform.

Could be a JDK JNI bug.

On Tue, Sep 17, 2013 at 2:38 AM, Wayne Meissner notifications@github.comwrote:

Can someone test this with jruby master and jruby-launcher master?
jffi.boot.path should no longer have each individual cpu+os subdir in it,
and the jffi loader will only try to load ${cpu}-${os}/libjffi-1.2.so.

I think this is due to a change in the way hotspot loads libs via
System.loadLibrary() - previously it would fail on incorrect arch/os
combinations (e.g. trying to load arm on x86_64), but now just ignores the
ELF header and tries to blindly load it.


Reply to this email directly or view it on GitHubhttps://github.com/jruby/jruby/issues/899#issuecomment-24556312
.

I have also run into this problem on JRuby 1.7.4 using JDK 7u40. We need to migrate to Java 7, and on our dev environment I simply did what docent suggested and copied the x86_64 Linux library in the arm directory. No more warning.

The problem, however, is how do I deal with this when I go to test and production because we package up our applications to use the JRuby complete jar given that we can't directly install JRuby on those target systems. I am assuming the problem still exists in the complete jar, only now it's outside my control unless a fix is published in JRuby 1.7.5?

cbachich commented Oct 3, 2013

So starting my first week on a new job, our servers went down after upgrading our packages. One of those packages included JDK 7u40. After which, I'm seeing the same problems as others have described. The HotSpot warning and whole lot of PageGen errors. We weren't having the issues before the upgrade.

After reverting back to 7u25, the problems disappeared.

msp23 commented Oct 16, 2013

On Ubuntu 12.04 LTS I removed all unneeded plattforms from jruby/lib/native and the warning disappeared.
It was save to keep all the x86_64* directories (in this case: x86_64-FreeBSD x86_64-Linux x86_64-SunOS x86_64-Windows)

Owner

headius commented Oct 22, 2013

Can those of you who have seen this please re-test with JRuby 1.7.5?

I just had this issue with 1.7.4. Upgraded to 1.7.5 and was unable to reproduce. I think its safe to mark it as closed.

It happens to me too while trying to setting up jruby in my raspberrypi:

pi@rasputin ~ $ ruby -ve 'puts "it works"'
jruby 1.7.6 (1.9.3p392) 2013-10-22 6004147 on Java HotSpot(TM) Client VM 1.8.0-ea-b113 +indy [linux-arm]
it works
pi@rasputin ~ $ which gem
/home/pi/.rbenv/shims/gem
pi@rasputin ~ $ gem install bundler
Java HotSpot(TM) Client VM warning: You have loaded library /home/pi/.rbenv/versions/jruby-1.7.6/lib/jni/x86_64-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'.
Killed
Owner

headius commented Nov 9, 2013

@brutuscat Can you file a new issue for your case? It's a bit different because you're on ARM and it's picking up the x86_64 library. The original issue was fixed here, and yours may be the same or new.

@headius Done. But why this issue is still Open?

Owner

headius commented Nov 11, 2013

@brutuscat An oversight. Will continue investigation on your new issue.

@headius headius closed this Nov 11, 2013

@gbenedict gbenedict added a commit to RedFunnel/heroku-buildpack-ruby that referenced this issue Jan 9, 2014

@hone @gbenedict hone + gbenedict Fix warning warning libjffi-1.2.so on < JRuby 1.7.3
[JRuby Issue](jruby/jruby#899). We need to use
an older JDK for JRuby 1.7.3 and lower.
a6841c6

@squeedee squeedee added a commit to cloudfoundry/ruby-buildpack that referenced this issue Apr 10, 2014

@hone @squeedee hone + squeedee Fix warning warning libjffi-1.2.so on < JRuby 1.7.3
[JRuby Issue](jruby/jruby#899). We need to use
an older JDK for JRuby 1.7.3 and lower.
4ecc83f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment