0

I am not able to understand the reason why Erlang crashes and restarts. I am running Ejabberd server and its log folder is always full of erl_crash_xxxx.dump files. How can I debug this problem.

Here is a small part of erlang.log file:

=CRASH REPORT==== 4-Sep-2013::19:44:51 ===
  crasher:
    initial call: ejabberd_http:init/2
    pid: <0.15614.15>
    registered_name: []
    exception exit: {normal,
                        {gen_fsm,sync_send_all_state_event,
                            [<0.15454.15>,
                             {http_put,2020093061,
                                 [{"xmlns",
                                   "http://jabber.org/protocol/httpbind"},
                                  {"rid","2020093061"},
                                  {"sid",
                                   "26820e4cd7d331de864b857d1ef3351caf7dbac5"}],
                                 [],115,1,[],
                                 {{49,205,148,16},56132}},
                             30000]}}
      in function  gen_fsm:sync_send_all_state_event/3
      in call from ejabberd_http_bind:http_put/7
      in call from ejabberd_http_bind:handle_http_put/7
      in call from ejabberd_http:process/2
      in call from ejabberd_http:process_request/1
      in call from ejabberd_http:process_header/2
      in call from ejabberd_http:receive_headers/1
    ancestors: [ejabberd_http_sup,ejabberd_sup,<0.37.0>]
    messages: []
    links: [<0.274.0>,#Port<0.1519795>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 2584
    stack_size: 24
    reductions: 1082
  neighbours:

These are the top few lines of a typical crash dump file:

=erl_crash_dump:0.1
Tue Sep  3 16:31:47 2013
Slogan: Kernel pid terminated (application_controller) ({application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}})
System version: Erlang R14B04 (erts-5.8.5) [source] [64-bit] [rq:1] [async-threads:0] [hipe] [kernel-poll:false]
Compiled: Wed Oct  5 17:25:18 2011
Taints:
Atoms: 4699
=memory
total: 21498768
processes: 556368
processes_used: 541208
system: 20942400
atom: 322177
atom_used: 302233
binary: 18216
code: 2165726
ets: 53736
=hash_table:atom_tab
size: 3203
used: 2471
legoscia
  • 39,593
  • 22
  • 116
  • 167
Saurabh Kumar
  • 195
  • 3
  • 12
  • [Here](http://stackoverflow.com/a/18641265/720999) I tried to explain to someone else how to interpret a crash dump -- consider following the guide and refine your question with a useful stack trace. – kostix Sep 06 '13 at 10:11

1 Answers1

0

Those 'crashes' are probably totally unrelated. What you see as '=CRASH REPORT=' in your log files are sort of 'normal' or expected crashes and as such handled by a supervisor. The one you posted is a crash inside a handler for a HTTP call while creating or sending the a response that might ended up in some unforseen condition (like when the sending process does not exist anymore - not sure about that though). Erlang is built and designed to handle such crashes gracefully. In other words, your ejabberd is still running and serving requests happily.

The other one is a crash dump which results from a real crash of the Erlang runtime. This might happen if for example the machine hosting the runtime runs out of memory. In your case it seems like a configuration error, the node could not boot correctly at all. See http://www.ejabberd.im/node/872.

  • But even the secnd crash keeps the ejabberd node up all the time. It keeps working just that there are a lot of crash dump files in the logs directory. – Saurabh Kumar Sep 06 '13 at 11:42
  • Also I see very high CU consumption by ejabberd beam. – Saurabh Kumar Sep 06 '13 at 16:56
  • Those crash files may very likely be created by some other instances of ejabberd trying to be started. – Stefan Strigler Sep 10 '13 at 10:35
  • Any idea, why would that happen? I don't start another instance manually and there are a LOT of crash dump files and no. of such files keeps increasing with the up time of ejabberd. – Saurabh Kumar Sep 10 '13 at 22:45