Java VM EXCEPTION_ACCESS_VIOLATION 的可能原因?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/140030/
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-11 08:47:43  来源:igfitidea点击:

Possible causes of Java VM EXCEPTION_ACCESS_VIOLATION?

javanulljvmcrashswt

提问by sk.

When a Java VM crashes with an EXCEPTION_ACCESS_VIOLATION and produces an hs_err_pidXXX.log file, what does that indicate? The error itself is basically a null pointer exception. Is it always caused by a bug in the JVM, or are there other causes like malfunctioning hardware or software conflicts?

当 Java VM 因 EXCEPTION_ACCESS_VIOLATION 崩溃并生成 hs_err_pidXXX.log 文件时,这表示什么?错误本身基本上是一个空指针异常。它是否总是由 JVM 中的错误引起,还是有其他原因,例如硬件故障或软件冲突?

Edit: there is a native component, this is an SWT application on win32.

编辑:有一个本机组件,这是一个在 win32 上的 SWT 应用程序。

采纳答案by jiriki

Most of the times this is a bug in the VM. But it can be caused by any native code (e.g. JNI calls).

大多数情况下,这是 VM 中的错误。但它可能由任何本机代码(例如 JNI 调用)引起。

The hs_err_pidXXX.log file should contain some information about where the problem happened.

hs_err_pidXXX.log 文件应包含有关问题发生位置的一些信息。

You can also check the "Heap" section inside the file. Many of the VM bugs are caused by the garbage collection (expecially in older VMs). This section should show you if the garbage was running at the time of the crash. Also this section shows, if some sections of the heap are filled (the percentage numbers).

您还可以检查文件中的“堆”部分。许多 VM 错误是由垃圾收集引起的(尤其是在较旧的 VM 中)。此部分应显示崩溃时垃圾是否正在运行。此部分还显示,是否填充了堆的某些部分(百分比数字)。

The VM is also much more likely to crash in a low memory situation than otherwise.

VM 在内存不足的情况下也更有可能崩溃。

回答by Jeremy

First thing you should do is upgrade your JVM to the latest you can.

您应该做的第一件事是将您的 JVM 升级到最新版本。

Can you repeat the issue? Or does it seem to happen randomly? We recently had a problem where our JVM was crashing all over the place, at random times. Turns out it was a hardware problem. We put the drives in a new server and it completely went away.

你能重复这个问题吗?或者它似乎是随机发生的?我们最近遇到了一个问题,即我们的 JVM 随机崩溃到处都是。结果发现是硬件问题。我们将驱动器放在新服务器中,它完全消失了。

Bottom line, the JVM should never crash, as the poster above mentioned if your not doing any JNI then my gut is that you have a hardware problem.

最重要的是,JVM 永远不应该崩溃,正如上面提到的海报,如果你没有做任何 JNI,那么我的直觉是你有硬件问题。

回答by Kevin Day

The cause of the problem will be documented in the hs_err* file, if you know what to look for. Take a look, and if it still isn't clear, consider posting the first 5 or 10 lines of the stack trace and other pertinent info (don't post the whole thing, there's tons of info in there that won't help - but you have to figure out which 1% isimportant :-) )

如果您知道要查找什么,问题的原因将记录在 hs_err* 文件中。看一看,如果仍然不清楚,请考虑发布堆栈跟踪的前 5 或 10 行和其他相关信息(不要发布整个内容,其中有大量信息无济于事-但你必须弄清楚哪 1%重要的 :-) )

回答by Eddie

Are you using a Browser widget and executing javascript in the Browser widget? If so, then there are bugs in some versions of SWT that causes the JVM to crash in native code, in various Windows libraries.

您是否使用浏览器小部件并在浏览器小部件中执行 javascript?如果是这样,那么在某些版本的 SWT 中存在导致 JVM 在本机代码中崩溃的错误,在各种 Windows 库中。

Two examples (that I opened) are bug 217306and bug 127960. These two bug reports are not the only bug reports of the JVM crashing in SWT, however.

两个示例(我打开的)是错误 217306错误 127960。然而,这两个错误报告并不是 SWT 中 JVM 崩溃的唯一错误报告。

If you aren't using the Browser widget then these suggestions won't help you. In that case, you can search for a list of SWT bugs causing a JVM crash. If none of those are your issue, then I highly recommend that you open a bug report with SWT.

如果您不使用浏览器小部件,那么这些建议对您没有帮助。在这种情况下,您可以搜索导致 JVM 崩溃SWT 错误列表。如果这些都不是您的问题,那么我强烈建议您使用 SWT 打开错误报告。

回答by user2988439

Answer found!

找到答案了!

I had the same error and noticed that others who provided the contents of the pid log file were running 64 bit Windows. Just like me. At the end log file, it included the PATH statement. There I could see C:\Windows\SysWOW64 was incorrectly listed ahead of: %SystemRoot%\system32. Once I corrected it, the exception disappeared.

我遇到了同样的错误,并注意到提供 pid 日志文件内容的其他人正在运行 64 位 Windows。就像我。在最后的日志文件中,它包含了 PATH 语句。在那里我可以看到 C:\Windows\SysWOW64 被错误地列在了:%SystemRoot%\system32 之前。一旦我纠正了它,异常就消失了。

回答by TomS

I have the same problem with a JNLP application that I have been using for a long time and is pretty reliable. The problem started immediately after I upgraded from Windows 7 to Windows 10. According to my investigation, it is most likely a bug in Win 10.

我已经使用了很长时间并且非常可靠的 JNLP 应用程序也有同样的问题。我从Windows 7升级到Windows 10后立即出现这个问题。根据我的调查,这很可能是Win 10中的一个错误。

The following is not a solution, but an ugly workaround. In jre/bin directory, there is javaws.exe. If I right-clicked/Properties/Compatibilityand ticked Run this program as an administrator, the JNLP app started to work.

以下不是解决方案,而是一种丑陋的解决方法。在 jre/bin 目录中,有javaws.exe。如果我右键单击/Properties/Compatibility并勾选Run this program as an administrator,JNLP 应用程序开始工作。

Please, be aware that this approach could cause security issues and use it only if you have no other option and 100% know what you are doing.

请注意,这种方法可能会导致安全问题,只有在您别无选择并且 100% 知道您在做什么时才使用它。