How do I analyze a Java fatal error log?

Solution Verified - Updated

Environment

  • OpenJDK derivative
    • Red Hat build of OpenJDK
    • Oracle JDK
    • Azul
    • Adoptium
    • Microsoft Build of OpenJDK

Issue

  • How do I analyze a fatal error log?

Resolution

Use Content from github.com is not included.krashpad, a command line tool to parse Java fatal error logs.

Diagnostic Steps

A fatal error log is a file that is typically named something like hs_err_<pid>.log or java_error<pid>.log. It is automatically created by the JVM when a crash happens.

It will be located either in the process current directory (user.dir) or at the location specified with the -XX:ErrorFile JVM option. For example:

-XX:ErrorFile=/path/to/hs_err_%p.log

jinfo can be used to determine user.dir:

jinfo <pid> | grep "user.dir"
user.dir=/path/to/dir

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.