A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.erlang.org/doc/apps/erts/crash_dump below:

How to Interpret the Erlang Crash Dumps — erts v16.0.1

This section describes the erl_crash.dump file generated upon abnormal exit of the Erlang runtime system.

Note

The Erlang crash dump had a major facelift in Erlang/OTP R9C. The information in this section is therefore not directly applicable for older dumps. However, if you use crashdump_viewer on older dumps, the crash dumps are translated into a format similar to this.

The system writes the crash dump in the current directory of the emulator or in the file pointed out by the environment variable (whatever that means on the current operating system) ERL_CRASH_DUMP. For a crash dump to be written, a writable file system must be mounted.

Crash dumps are written mainly for one of two reasons: either the built-in function erlang:halt/1 is called explicitly with a string argument from running Erlang code, or the runtime system has detected an error that cannot be handled. The most usual reason that the system cannot handle the error is that the cause is external limitations, such as running out of memory. A crash dump caused by an internal error can be caused by the system reaching limits in the emulator itself (like the number of atoms in the system, or too many simultaneous ETS tables). Usually the emulator or the operating system can be reconfigured to avoid the crash, which is why interpreting the crash dump correctly is important.

On systems that support OS signals, it is also possible to stop the runtime system and generate a crash dump by sending the SIGUSR1 signal.

The Erlang crash dump is a readable text file, but it can be difficult to read. Using the Crashdump Viewer tool in the Observer application simplifies the task. This is a wx-widget-based tool for browsing Erlang crash dumps.

General Information

The first part of the crash dump shows the following:

Reasons for Crash Dumps (Slogan)

The reason for the dump is shown in the beginning of the file as:

Slogan: <reason>

If the system is halted by the BIF erlang:halt/1, the slogan is the string parameter passed to the BIF, otherwise it is a description generated by the emulator or the (Erlang) kernel. Normally the message is enough to understand the problem, but some messages are described here. Notice that the suggested reasons for the crash are only suggestions. The exact reasons for the errors can vary depending on the local applications and the underlying operating system.

Other errors than these can occur, as the erlang:halt/1 BIF can generate any message. If the message is not generated by the BIF and does not occur in the list above, it can be because of an error in the emulator. There can however be unusual messages, not mentioned here, which are still connected to an application failure. There is much more information available, so a thorough reading of the crash dump can reveal the crash reason. The size of processes, the number of ETS tables, and the Erlang data on each process stack can be useful to find the problem.

Number of Atoms

The number of atoms in the system at the time of the crash is shown as Atoms: <number>. Some ten thousands atoms is perfectly normal, but more can indicate that the BIF erlang:list_to_atom/1 is used to generate many different atoms dynamically, which is never a good idea.

Scheduler Information

Under the tag =scheduler is shown information about the current state and statistics of the schedulers in the runtime system. On operating systems that allow suspension of other threads, the data within this section reflects what the runtime system looks like when a crash occurs.

The following fields can exist for a process:

Memory Information

Under the tag =memory is shown information similar to what can be obtained on a living node with erlang:memory().

Internal Table Information

Under the tags =hash_table:<table_name> and =index_table:<table_name> is shown internal tables. These are mostly of interest for runtime system developers.

Allocated Areas

Under the tag =allocated_areas is shown information similar to what can be obtained on a living node with erlang:system_info(allocated_areas).

Allocator

Under the tag =allocator:<A> is shown various information about allocator <A>. The information is similar to what can be obtained on a living node with erlang:system_info({allocator, <A>}). For more information, see also erts_alloc(3).

Process Information

The Erlang crashdump contains a listing of each living Erlang process in the system. The following fields can exist for a process:

See also section Process Data.

Port Information

This section lists the open ports, their owners, any linked processes, and the name of their driver or external process.

ETS Tables

This section contains information about all the ETS tables in the system. The following fields are of interest for each table:

Timers

This section contains information about all the timers started with the BIFs erlang:start_timer/3 and erlang:send_after/3. The following fields exist for each timer:

Distribution Information

If the Erlang node was alive, that is, set up for communicating with other nodes, this section lists the connections that were active. The following fields can exist:

Loaded Module Information

This section contains information about all loaded modules.

First, the memory use by the loaded code is summarized:

Then, all loaded modules are listed. The following fields exist:

Fun Information

This section lists all funs. The following fields exist for each fun:

Process Data

For each process there is at least one =proc_stack and one =proc_heap tag, followed by the raw memory information for the stack and heap of the process.

For each process there is also a =proc_messages tag if the process message queue is non-empty, and a =proc_dictionary tag if the process dictionary (the put/2 and get/1 thing) is non-empty.

The raw memory information can be decoded by the Crashdump Viewer tool. You can then see the stack dump, the message queue (if any), and the dictionary (if any).

The stack dump is a dump of the Erlang process stack. Most of the live data (that is, variables currently in use) are placed on the stack; thus this can be interesting. One has to "guess" what is what, but as the information is symbolic, thorough reading of this information can be useful. As an example, we can find the state variable of the Erlang primitive loader online (5) and (6) in the following example:

(1)  3cac44   Return addr 0x13BF58 (<terminate process normally>)
(2)  y(0)     ["/view/siri_r10_dev/clearcase/otp/erts/lib/kernel/ebin",
(3)            "/view/siri_r10_dev/clearcase/otp/erts/lib/stdlib/ebin"]
(4)  y(1)     <0.1.0>
(5)  y(2)     {state,[],none,#Fun<erl_prim_loader.6.7085890>,undefined,#Fun<erl_prim_loader.7.9000327>,
(6)            #Fun<erl_prim_loader.8.116480692>,#Port<0.2>,infinity,#Fun<erl_prim_loader.9.10708760>}
(7)  y(3)     infinity

When interpreting the data for a process, it is helpful to know that anonymous function objects (funs) are given the following:

Atoms

This section presents all the atoms in the system. This is only of interest if one suspects that dynamic generation of atoms can be a problem, otherwise this section can be ignored.

Notice that the last created atom is shown first.

Disclaimer

The format of the crash dump evolves between OTP releases. Some information described here may not apply to your version. A description like this will never be complete; it is meant as an explanation of the crash dump in general and as a help when trying to find application errors, not as a complete specification.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4