在Java 7上使用JNI运行Java 5/6会给出堆栈保护警告 [英] running java 5/6 with JNI on java 7 gives stack guard warning

查看:103
本文介绍了在Java 7上使用JNI运行Java 5/6会给出堆栈保护警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用1.5(或1.6启用1.5比较模式)构建的Java程序会发出以下警告:

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

Java HotSpot(TM)服务器VM警告:您已加载库 mynativelib.so可能已禁用堆栈保护.
VM将立即尝试修复堆栈保护.强烈建议您修复 具有'execstack -c'的库,或将其与'-z链接 noexecstack".

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

这似乎没有问题,但显然对我们的客户来说有点吓人. 我认为在7中构建Java位不会解决此问题,但是我正在努力查看文档在何处说明如何为Java 7构建JNI库,这就是警告所暗示的,我应该做不同的事情.

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.

那我应该去哪里找

推荐答案

在这里找到答案 已禁用堆栈保护警告(ACF9,JVM 1.7,Linux)

他说

这是Linux上Java 7的HotSpot编译器中的一项功能,该功能试图阻止用C编写并链接到Java的代码(所谓的Java本机接口-JNI)在整个VM被不良或恶意编写时停止整个VM.

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.

这篇关于在Java 7上使用JNI运行Java 5/6会给出堆栈保护警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆