Debugging a Release

Rudolph van Graan rvg@REDACTED
Wed Sep 17 09:10:17 CEST 2003


Hi Eric,

I am not sure if this will help you, but I'll try nevertheless. 
Usually, if something goes wrong during initialization, you'll only get 
the supervisor to show "**shutdown**" without any reasonable error 
messages. It is then very difficult to troubleshoot. After digging 
through the source, I found that the supervisor does actually give out 
detailed info. Our solution has been to write a very simple event 
handler:


-module(errortrace).

-export([init/1,handle_event/2]).

init(Args) ->
   {ok,[]}.

handle_event(What,State) ->
   io:format("Event: ~w\n",[What]),
   {ok,State}.

that you then install into the error_logger:

  error_logger:add_report_handler(errortrace).

It will now dump a lot of extra information onto stdio. The reports we 
were interested in were the "supervisor" ones that you can easily 
filter out. Usually, you'll be able to see a clear error in there 
somewhere.

Does anyone know of a better way of seeing the error reports during 
supervisor initialization?

Regards,

Rudolph


On Wednesday, Sep 17, 2003, at 00:01 Africa/Johannesburg, Eric Newhuis 
wrote:

> Is it possible to use the Erlang graphical debugger to debug a 
> release?  I am confused by the order of initialization.  A boot script 
> is involved.  But I want to set breakpoints in my supervised 
> gen_server init code.
>
> Actually I am not sure what question to ask yet.  But does this ring 
> familiar with anyone?  Can anyone point me toward some docs or 
> previous threads on this subject?
>
> Sincerely,
> Eric Newhuis
>
>




More information about the erlang-questions mailing list