running java 5/6 with JNI on java 7 gives stack guard warning

為{幸葍}努か 提交于 2019-12-10 13:18:48

问题


A java program built with 1.5 (or 1.6 with 1.5 comparability mode on) gives this warning:

Java HotSpot(TM) Server VM warning: You have loaded library mynativelib.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'.

It doesn't seem to cause a problem but obviously would look a bit scary to our customers. I don't think building the java bits in 7 would fix this issue but I'm struggling to see where the docs say how to build JNI libs for Java 7, which is what the warning implies I should be doing differently.

So where should I be looking?


回答1:


Found the answer here disabled stack guard warning (ACF9, JVM 1.7, Linux)

He said

This is a feature in Java 7’s HotSpot compiler on Linux which tries to stop code written in C and linked into Java (the so-called Java Native Interface - JNI) from halting the whole VM if it’s written badly or maliciously.




回答2:


Another possibility is that the Java+JNI application that you are trying to run was compiled for Linux 32bit.

In such a case, two solutions:

  • If you have the source code of the application, port it to Linux 64bit
  • If not, download the Linux 64bit version of the application.


来源:https://stackoverflow.com/questions/18889113/running-java-5-6-with-jni-on-java-7-gives-stack-guard-warning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!