[erlang-bugs] internal error in v3_life

Björn Gustavsson bgustavsson@REDACTED
Tue Dec 20 13:52:17 CET 2011


Thanks for the bug report and for the minimized test case.

/Bjorn


On 12/20/11, Erik Søe Sørensen <ess@REDACTED> wrote:
> And simpler still:
>
>     split_cases(A) ->
>          case A of
>              x -> Z = dummy1;
>              _ -> Z = dummy2,
>               a=b
>          end,
>          Z.
>
>
>
> On 20-12-2011 10:56, Erik Søe Sørensen wrote:
>> A simplified version:
>>
>>     -module(comperr).
>>     -compile([export_all]).
>>
>>     split_cases(A) ->
>>         case A of
>>             x -> Z = dummy1;
>>             _ -> Z = dummy2,
>>              a=b
>>         end,
>>         case Z of
>>             _ -> ok
>>         end.
>>
>> This fails with erts-5.8.4.
>>
>> On 20-12-2011 10:01, Håkan Mattsson wrote:
>>> -module(foo).
>>> -compile([export_all]).
>>>
>>> split_cases(IsRecursive, [Case | Cases], Acc) ->
>>>      case binary:split(Case,<<":">>) of
>>>          [<<"qmt file", _/binary>>  |_] ->
>>>              Qmt = Case,
>>>              case Cases of
>>>                  [Case2 | Cases2] ->
>>>                      Sections = binary:split(Case2,<<"\n">>, [global]);
>>>                  [] ->
>>>                      Sections = binary:split(Case,<<"\n">>, []),
>>>                      Cases2 = []
>>>              end;
>>>          [<<"test case", _/binary>>  |_] ->
>>>              Qmt =<<>>,
>>>              Sections = binary:split(Case,<<"\n">>, [global]),
>>>              Cases2 = Cases;
>>>          [<<>>] ->
>>>
>>>              io:format("DEBUG: ~p ~p\n", [Case, Cases]),
>>>              Qmt =<<>>,
>>>              Sections = [],
>>>              Cases2 = [],
>>>              a=b
>>>      end,
>>>      case Sections of
>>>          [Reason] ->
>>>              case binary:split(Qmt,<<":">>) of
>>>                  [_, QmtFile] ->  ok;
>>>                  []           ->  QmtFile = Qmt
>>>              end,
>>>              Res = {result_case, QmtFile,<<"ERROR">>, Reason},
>>>              split_cases(IsRecursive, Cases2, [Res | Acc]);
>>>          [QmtCase, Reason] ->
>>>              [_, QmtFile] = binary:split(QmtCase,<<":">>),
>>>              Res =
>>>                  case binary:split(Reason,<<":">>) of
>>>                      [<<"result", _/binary>>, Reason2] ->
>>>                          {result_case, QmtFile, Reason2, Reason};
>>>                      [<<"error", _/binary>>, Reason2] ->
>>>                          {result_case, QmtFile,<<"ERROR">>, Reason2}
>>>                  end,
>>>              split_cases(IsRecursive, Cases2, [Res | Acc]);
>>>          [QmtCase, ScriptCase, EventCase | DocAndResult] ->
>>>              [_, QmtFile]    = binary:split(QmtCase,<<":">>),
>>>              [_, ScriptFile] = binary:split(ScriptCase,<<":">>),
>>>              [_, EventFile]  = binary:split(EventCase,<<":">>),
>>>              EventLog = binary_to_list(EventFile),
>>>              case IsRecursive of
>>>                  true ->
>>>                      case annotate_log(EventLog) of
>>>                          ok ->
>>>                              ok;
>>>                          {error, _, Reason} ->
>>>                              io:format("ERROR in ~s\n\~p\n", [EventLog,
>>> Reason])
>>>                      end;
>>>                  false ->
>>>                      ignore
>>>              end,
>>>              {Doc, ResultCase} = split_doc(DocAndResult, []),
>>>              Result = parse_result(ResultCase),
>>>              HtmlLog = EventLog ++ ".html",
>>>              Res = {test_case, QmtFile, Qmt, ScriptFile, EventLog, Doc,
>>>                     HtmlLog, Result},
>>>              split_cases(IsRecursive, Cases2, [Res | Acc])
>>>      end;
>>> split_cases(_IsRecursive, [], Acc) ->
>>>      lists:reverse(Acc).
>>>
>>> annotate_log(_EventLog) ->
>>>      dummy.
>>>
>>> split_doc(_DocAndResult, _Acc) ->
>>>      {dummy, dummy}.
>>>
>>> parse_result(_ResultCase) ->
>>>      dummy.
>>
>
>


-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-bugs mailing list