Running java 5/6 with JNI on java 7 gives a stack security warning

A java program built with 1.5 (or 1.6 with 1.5 matching mode enabled) gives the following warning:

HotSpot (TM) Java Virtual Machine Warning: You loaded the mynativelib.so library, which might disable stack protection.

Now the VM will try to fix the stack protection. It is strongly recommended that you fix the libraries with "execstack -c" or associate it with '-z noexecstack ".

This does not seem to pose a problem, but it will obviously look a little scary for our customers. I don't think creating java bits in 7 will fix this problem, but I'm struggling to figure out where the docs say how to create JNI libraries for Java 7, which means the warning implies that I have to do to another.

So where should I look?

+6
source share
2 answers

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

He said

This is the function of the Java 7s HotSpot compiler on Linux, which tries to stop the code written in C and associated with Java (the so-called Java Native Interface (JNI)) from stopping the entire virtual machine if it is spelled poorly or maliciously.

+5
source

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

In this case, two solutions:

  • If you have the source code of the application, put it on Linux 64bit
  • If not, download the 64-bit version of Linux.
+2
source

Source: https://habr.com/ru/post/954145/


All Articles