erlang using 100% one of CPUs
I have situation when my project is frozen. I see only 100% usage one of the CPUs (the rest is 0%, but I'm using SMP).
And my admin console says:
=ERROR REPORT==== 11-Feb-2011::00:45:00 ===
** Node 'node@example.com' not responding **
** Removing (timedout) connection **
After that I cannot connect to the node.
If I'm progr开发者_如何学编程amming with C++ I can make a debug build and when such situation happens I can attach to my process and see the code where it is looping.
But how can I do it in Erlang? How can I get the call stack or something to help me understand what is really wrong?
Thank you for any help.
You can compile your module with debug information in the command line:
$ erlc +debug_info module.erl
Or in Erlang shell:
1> c(module, debug_info).
ok
When you have already started your process, you have an option to attach to the working process. Start the debugger in your erlang shell:
2> debugger:start().
The debugger window will appear. From menu select Module -> Interpret and select the appropriate module, to which you want attach in the Interpret Dialog window. When you did, you will see your module in the right window of debugger.
Now select Process -> Attach, Attach Process window should appear.
if the erlang distribution has shutdown you cannot use any remote debugging as you cannot connect to the node. You would have to connect to the pipes created by the VM at startup if configured to do so. See the http://www.erlang.org/doc/man/run_erl.html about how to do that.
You also might want to checkout this thread for a reason why your system is behaving the way it is: http://www.erlang.org/cgi-bin/ezmlm-cgi?4:mss:55859:201101:jconogbffcaogeijbdkl
精彩评论