Possible causes of Java VM EXCEPTION_ACCESS_VIOLATION?
Asked Answered
B

7

38

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?

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

Bassesalpes answered 26/9, 2008 at 14:56 Comment(1)
Are you doing anything involving native code, like Java3D or something?Facelifting
M
20

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

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

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

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

Mosera answered 26/9, 2008 at 15:19 Comment(2)
How to check if garbage collector was running during crash?Actinozoan
It happens randomly in my case: #68809182Osteopathy
C
9

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.

Coadunate answered 13/11, 2013 at 15:48 Comment(1)
Thank you so much! Turns out I had a faulty entry in my PATH variable as well, and correcting it fixed the issue.Theran
L
2

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

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.

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.

Lapierre answered 26/9, 2008 at 16:44 Comment(2)
Could you please describe what exact problem that was? I'm struggling with such error and thinking on how HW problems could be detected.Nitaniter
one way to detect hardware problems, is to view the 'event viewer' of windows. There is a high change that hardware problems will be reported there.Emmen
H
1

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% is important :-) )

Homebrew answered 27/9, 2008 at 3:45 Comment(0)
C
0

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.

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

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.

Campbell answered 27/1, 2009 at 4:46 Comment(0)
B
0

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.

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

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.

Blinny answered 24/8, 2015 at 22:6 Comment(0)
G
0

Ran into this fatal error, EXCEPTION_ACCESS_VIOLATION, on Java build 1.8.0_271-b09. Looking at the hs_err_pidxxx.log, it looked like it was having trouble doing garbage collection. Heap space never came down after GC. Turns out, I just needed to close some unused apps to free up memory. Brought down memory usage to 50% of my 16GB RAM Windows 10 machine, ran the java application again and the error was gone.

Gobelin answered 28/11, 2023 at 14:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.