【发布时间】:2011-01-06 00:19:48
【问题描述】:
当我在 erl shell 中启动一个函数时,它工作正常。当我尝试使用 erl ... -s 模块函数调用相同的函数时,它失败了。
最终失败的代码行是:
start(Port) ->
mochiweb_http:start([{port, Port}, {loop, fun dispatch_requests/1}]).
我确信端口设置正确。我的错误信息是:
=CRASH REPORT==== 17-Jan-2010::00:21:09 ===
crasher:
initial call: mochiweb_socket_server:acceptor_loop/1
pid: <0.65.0>
registered_name: []
exception exit: {error,closed}
in function mochiweb_socket_server:acceptor_loop/1
ancestors: [mochiweb_http,<0.1.0>]
messages: []
links: []
dictionary: []
trap_exit: false
status: running
heap_size: 377
stack_size: 24
reductions: 93
neighbours:
我尝试了调试器,它让我可以单步执行,直到给出上面的代码行。在我通过之后,它会给我这个崩溃报告。
非常感谢任何帮助。
【问题讨论】:
-
你能粘贴一个最小的代码来重现这个错误吗?
-
我意识到我粘贴的内容无法编译。这甚至对我不起作用:pastie.org/782752 你在什么系统上运行?我在 OS X 上使用 Erlang R13B02。