Erlang因sasl应用程序启动失败而中止

goucqfw6  于 2022-12-08  发布在  Erlang
关注(0)|答案(1)|浏览(180)

我横编二郎为臂制。
后来,杨二郎装成靶子,如下图:

./Install -sasl <ERL_ROOT>

当我检查目标上的Erlang时,出现以下错误:

$ erl
Erlang:
=INFO REPORT==== 1-Jan-2015::19:30:44 ===
    application: sasl
    exited: {bad_return,
                {{sasl,start,[normal,[]]},
                 {'EXIT',
                     {undef,
                         [{sasl,start,[normal,[]],[]},
                          {application_master,start_it_old,4,
                              [{file,"application_master.erl"},
                               {line,273}]}]}}}}
    type: permanent
Eshell V8.0  (abort with ^G)
1> {"Kernel pid terminated",application_controller,
"{application_start_failure,sasl,{bad_return,{{sasl,start,[normal,[]]},
{'EXIT',{undef,[{sasl,start,[normal,[]],[]},
{application_master,start_it_old,4,[{file,\"application_master.erl\"},
{line,273}]}]}}}}}"}

Crash dump is being written to: erl_crash.dump...done

Kernel pid terminated (application_controller)
 ({application_start_failure,sasl,
  {bad_return,
   {{sasl,start,[normal,[]]},{'EXIT',{undef,[{sasl,start,[normal,[]],[]},{application_master,start_it_old,4,[{f

有人知道这个错误吗?
先谢谢你。

xytpbqjk

xytpbqjk1#

错误消息的这一部分:

{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,273}]}

显示了发现错误的位置。如果您查看application_master. erl的代码,您会发现:

start_it_old(Tag, From, Type, ApplData) ->
    {M,A} = ApplData#appl_data.mod,
  • ---〉生成错误消息的行
case catch M:start(Type, A) of
    {ok, Pid} ->
        link(Pid),
        From ! {Tag, {ok, self()}},
        loop_it(From, Pid, M, []);
    {ok, Pid, AppState} ->
        link(Pid),
        From ! {Tag, {ok, self()}},
        loop_it(From, Pid, M, AppState);
    {'EXIT', normal} ->
        From ! {Tag, {error, {{'EXIT',normal},{M,start,[Type,A]}}}};
    {error, Reason} ->
        From ! {Tag, {error, {Reason, {M,start,[Type,A]}}}};
  • ---〉管理结果的case语句
Other ->
        From ! {Tag, {error, {bad_return,{{M,start,[Type,A]},Other}}}}
    end.

因此,您知道M:start(Type,A)的求值结果返回{'EXIT',{undef,[{sasl,start,[normal,[]],[]}。这意味着VM无法找到文件sasl.beam。因此,要么该文件不存在(未完成Erlang库编译),要么路径中存在错误(该文件应位于 "Installation_Path/../lib/sasl-x. y/ebin/sasl.beam"

相关问题