Crash dumps

Logsift explains two kinds of crash files:

Open one with File → Open Crash Dump…, JVM → Open Java Crash Report (hs_err)…, or by dropping it on the window. Files with those names open in a crash tab. A crash report that has another name opens as a log, with a bar that offers Explain the Crash.

A .dmp or .mdmp that Logsift can’t read still opens in a crash tab, which says why:

Open as Text there opens the file as it is.

A Java crash in a JPEG library called through JNI, on one of four thumbnail workers

The top

What Happened

The findings, most important first. Each has a coloured bar: red for the cause, amber for things that may have caused it, gray for information. What to try says what to do. Below the findings is the stack of the crashed thread.

Windows dumps

Java crash reports

How the JVM crashed, from where the problem was and which thread it was on:

Crash What it means
In a native library (not the JDK’s) That library crashed. It is named, with the Java method that called it. Update it; run with -Xcheck:jni
In the system’s code (libc, memmove), called by a native library That library passed a bad pointer or size. It is named
Through Unsafe Code read or wrote memory at a bad address (often a freed off-heap buffer)
In the garbage collector The heap was damaged earlier, usually by native code or Unsafe, sometimes a JVM bug. The thread that did the damage isn’t the one that crashed
In the JIT compiler A JVM bug, set off by one method: Logsift gives the -XX:CompileCommand=exclude,… that works around it
In JIT-compiled Java code A compiler bug, or data damaged by native code: excluding the method tells which
In the JVM itself A JVM bug or damaged data. A JNI call means native code passed a bad reference
A mapped file or a jar (SIGBUS) The file got shorter or was replaced while the program had it open
Out of native memory Why: the machine’s free memory and swap, the container’s limit next to the heap’s, too many threads
An internal error (guarantee, assert) A check in the JVM failed: search the JDK’s bug tracker for the message

Then the clues to which other threads may have caused it:

Threads

The threads of a Windows dump, with the same stack together

On the left, every thread. Threads with the same state and stack are one row (4 threads … idle), and the crashed thread comes first, in red. Doing says what each was doing:

Doing Seen in the stack
crashed The thread of the exception
waiting for a lock (critical section, SRW lock) RtlEnterCriticalSection, AcquireSRWLock…
waiting on a condition variable, on an address SleepConditionVariable…, WaitOnAddress
idle (a thread-pool thread waiting for work) NtWaitForWorkViaWorkerFactory
waiting for window messages (idle) GetMessage, MsgWaitForMultipleObjects
sleeping Sleep, NtDelayExecution
waiting for another process (RPC or COM) NtAlpcSendWaitReceivePort
waiting for the network or a device; reading or writing a file or pipe NtDeviceIoControlFile; NtReadFile, NtWriteFile
waiting for an event or handle; for several WaitForSingleObject; WaitForMultipleObjects
running None of these

A Java crash report gives the state of each Java thread: running Java code, running native code, in the JVM, blocked or waiting. It also names the JVM’s own threads (garbage collector, JIT compiler, VM Thread). Only the crashed thread has a stack in that file.

At is the first frame of the program’s own code. Type in the filter to keep the threads whose name, state or frames contain it.

On the right, the stack of the selected thread, top first:

How stacks and names are found (Windows)

Logsift rebuilds each stack from the dump alone:

Function names come from:

  1. PDB files (names, source files and lines). Logsift looks:
    • next to the dump
    • where the build put them
    • in the folders under Settings → Crash Dumps
    • in the symbol caches named by _NT_SYMBOL_PATH
    • in ~/.logsift/symbols
  2. Names the program exports. Logsift uses one only when it starts the very function the address is in.
  3. Otherwise module+0x1a2b.

When Windows’ own files have no names, a bar offers Download Windows’ Names: Logsift asks Microsoft’s symbol server for the PDBs of Windows’ files in this dump, once. It asks only for files under \Windows, by name and build id, never for your program’s. Add PDB Folder… adds a folder with your program’s PDBs. Both are also under Settings → Crash Dumps, where downloading can be turned on for every dump.

Modules

Every DLL or shared library: version, a note (the crash is here, the program, unloaded, not the JDK’s or the system’s), which names Logsift has for it (PDB: …, exported names only), and its path. Filter by name or path.

Details

The facts:

Then the extra sections: the registers of the crashed thread, how the JVM was started, its event logs (compilations, GC, deoptimizations, classes, internal exceptions, libraries loaded) and environment variables.

Getting a good dump

What it doesn’t do

Asking a coding agent

A coding agent can ask Logsift about a crash file with analyze_crash, crash_threads and crash_modules. It gets the same explanation, with secrets masked.