How to understand Java Hotspot Errors
Asked Answered
K

3

8

Guys when the JVM Crashes it writes an Error Log hs_err_pid.log. I want to find out what caused the JVM to crash ? How to understand these Logs, is it documented anywhere on how this Log is arranged. I tried to search on the Net but to no avail :-(

Pointing out to relevant URL's will be appreciated. Thanks.

Kyphosis answered 12/5, 2009 at 5:40 Comment(0)
O
5

Unless you are calling native code (JNI), nothing in your code should ever make JVM crash; so the stack trace information in that log file is probably not meant to be very useful to most developers. That's probably why it might not be documented (at least externally). So the best thing is probably to file a bug report as suggested by the error message.

This presentation contains a detailed explanation of crash files, with a set of samples so you can practice.

Overrefinement answered 12/5, 2009 at 6:9 Comment(4)
Other evil things can happen that can induce a JVM crash. I've seen it with file system maintenance on the same controller but separate mount points. I've seen it when replacing an existing jar file before stopping the tomcat. (Oops.) I was able to deduce these two causes by the information in the hs_err_pid.log with the folks on the Sun Java forum.Benedic
I really feel like I have to -1 this. Not only does it just link to a blog, but the blog does not at all give me any information that benefits me into discovering why my program has crashed. As such, it just doesn't answer the question. :/Munmro
Link is now dead.Margitmargo
found some useful links: 1) github.com/simonis/AnalyzingHotSpotCrashes 2) youtube.com/watch?v=xC8fEeo7izIFerret
C
0

To start with, look for the topmost line that looks something like "ntdll.dll+0x2000".

If the hotspot is occurring in your native code (i.e. the DLL is one of yours), then find out how to persuade your compiler to produce a list of mappings from DLL offset to line number. Obviously, that may mean you need to re-run with the newly compiled DLL and wait for the problem to occur again.

Otherwise, see if searching for that specific line brings up something in Google, bearing in mind that the same error could mean a whole host of things. And see if the DLL name looks like it's something recognisable, e.g. a printer driver name, graphics driver, or some other component that you can track down to a particular call. Whatever that component is, you may be able to upgrade it to a fixed version, or avoid making the call in question. If you're not sure what the component is, it may just be "the JVM" that you need to upgrade-- upgrading at least to the latest update/minor version nubmer of whatever version you're on is probably a good idea.

In the past I've also seen bugs in the JIT compiler that can be temporarily solved by telling it not to attempt to compile the particular method in question-- as I recall vaguely, in these cases, the hotspot error gives some clue as to which method it was (possibly just the dump of the Java stack), but I don't have an example to hand to recall the details.

Cutlass answered 12/5, 2009 at 6:26 Comment(0)
B
0

this is pretty useful: http://weblogs.java.net/blog/kohsuke/archive/2009/02/crash_course_on.html

ok the first anwser already mentions this url, nevermind

Belding answered 12/5, 2009 at 8:46 Comment(1)
Link is now dead.Margitmargo

© 2022 - 2024 — McMap. All rights reserved.