Java 堆栈保护可能已禁用?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22345891/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 15:05:00  来源:igfitidea点击:

Stack guard might have disabled?

javaubuntunullpointerexceptiongpurootbeer

提问by Lemon Juice

I am trying to run the first example in rootbeerlibrary, which you can find from here.

我正在尝试运行rootbeer库中的第一个示例,您可以从这里找到。

The issue is, even though I followed all of their instructions, I am getting the following message when I am trying to run the Jar

问题是,即使我遵循了他们的所有说明,当我尝试运行 Jar 时还是收到以下消息

root@ubuserver3:/home/ubuadmin/JavaJars/HelloWordGPU# java -jar HelloWorldGPU.jar
OpenJDK Client VM warning: You have loaded library /usr/lib/libcuda.so.319.37 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'.
Exception in thread "main" java.lang.NullPointerException
        at org.trifort.rootbeer.runtime.Rootbeer.run(Rootbeer.java:104)
        at ScalarMult.test(ScalarMult.java:13)
        at Main.main(Main.java:17)

I am not a Linux person, so I do not understand how to execute this command properly. I also don't understand what they mean by that message, because this is the first time I am on GPU programming. But I know messing with GPU with wrong commands would be a problem.

我不是 Linux 人,所以我不明白如何正确执行这个命令。我也不明白他们所说的消息是什么意思,因为这是我第一次进行 GPU 编程。但我知道用错误​​的命令弄乱 GPU 会是一个问题。

回答by absenthecon

Type: execstack --versionto check if you already have execstack installed.

键入:execstack --version检查您是否已经安装了 execstack。

If you get command not found type: sudo apt-get install execstack -y --force-yes

如果找不到命令,请键入: sudo apt-get install execstack -y --force-yes

Type sudo execstack -c <file>e.g sudo execstack -c /usr/lib/libcuda.so

输入sudo execstack -c <file>例如sudo execstack -c /usr/lib/libcuda.so

回答by Pranav V R

1: Check execstack version using following command to find execstack installed or not

1:使用以下命令检查 execstack 版本以查找 execstack 安装与否

execstack --version

2: If execstack not installed then install using following command

2:如果没有安装execstack,则使用以下命令安装

sudo apt-get install execstack -y --force-yes

3: After successful installation execute following command

3:安装成功后执行以下命令

sudo execstack -c <filepath>

eg:sudo execstack -c /usr/lib/libjpcap.so

例如:sudo execstack -c /usr/lib/libjpcap.so

回答by andrej

make sure you are not running 32-bit jar on 64-bit jvm first

确保您没有先在 64 位 jvm 上运行 32 位 jar

回答by dhuie

Make sure you are not running 32-bit Java. If you run java -d64, the 32-bit version will print an error.

确保您运行的不是 32 位 Java。如果您运行 java -d64,32 位版本将打印错误。