erlang 100% 使用其中一个 CPU
我的项目被冻结时遇到过这种情况。 我看到其中一个 CPU 仅使用 100%(其余为 0%,但我使用的是 SMP)。
我的管理控制台显示:
=ERROR REPORT==== 11-Feb-2011::00:45:00 ===
** Node '[email protected]' not responding **
** Removing (timedout) connection **
此后我无法连接到该节点。
如果我使用 C++ 进行编程,我可以进行调试构建,当发生这种情况时,我可以附加到我的进程并查看其循环的代码。
但我怎样才能在 Erlang 中做到这一点呢?我怎样才能获得调用堆栈或其他东西来帮助我了解真正的错误是什么?
感谢您的帮助。
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 '[email protected]' not responding **
** Removing (timedout) connection **
After that I cannot connect to the node.
If I'm programming 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在命令行中使用调试信息来编译模块:
或者在 Erlang shell 中:
当您已经启动进程时,您可以选择附加到工作进程。在 erlang shell 中启动调试器:
将出现调试器窗口。从菜单中选择模块 ->解释并选择要在解释对话框窗口中附加的适当模块。完成后,您将在调试器的右侧窗口中看到您的模块。
现在选择处理->附加,应该会出现附加进程窗口。
You can compile your module with debug information in the command line:
Or in Erlang shell:
When you have already started your process, you have an option to attach to the working process. Start the debugger in your erlang shell:
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.
如果 erlang 发行版已关闭,则无法使用任何远程调试,因为无法连接到节点。如果配置为这样做,您将必须连接到虚拟机在启动时创建的管道。请参阅http://www.erlang.org/doc/man/run_erl.html 关于如何做到这一点。
您可能还想查看此线程,了解系统运行方式的原因:http://www.erlang.org/cgi-bin/ezmlm-cgi?4:mss:55859:201101:jconogbffcaogeijbdkl
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