调试在Erlang中挂起的函数调用

时间:2014-01-26 19:27:16

标签: debugging erlang hang

似乎我在我的代码或我正在使用的代码中某处导致死锁,但我不确定如何调试它。由于我不知道问题在哪里,我可以使系统几乎完全空闲,我认为看到所有功能和消息的痕迹导致挂起是有用的。看起来dbg在跟踪方面提供了一些帮助,但我没有看到如何为这么宽的跟踪配置它。使用dbg是否可以进行这样的跟踪,或者是否有其他方法可以更好地调试Erlang中的挂起?

2 个答案:

答案 0 :(得分:1)

我建议使用dbg。虽然在另一个答案中提到了传统的调试器,但它对于并发程序的用处非常有限,因为它通常会导致大量的超时。

要克服使用dbg的障碍,我建议使用以下资源:

All answers are interesting here but especially the user_default in the linked one helps also

Example what can be done by handling the trace messages yourself这对于难以调试的情况非常有用。

Continuously updated links and nodes about Erlangs dbg

如果您需要在制作中使用dbg,我建议您使用redbug,这样可以帮助您避免崩溃节点。 Blogpost about using redbug

答案 1 :(得分:0)

您是否尝试过Erlang Debugger