Uploaded image for project: 'Erlang/OTP'
  1. Erlang/OTP
  2. ERL-1050

internal error in beam_ssa_bsm amb_get_alias

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 22.1
    • Fix Version/s: OTP 22.1.1
    • Component/s: compiler
    • Labels:
      None

      Description

      fails to compile file that was ok in 21.3

      -module (file_processor_SUITE).
      
      -record(video_frame,{
        content,
        duration,
        track_id
      }).
      
      -compile(export_all).
      
      
      
      create_small_mp4(File) ->
        {ok, F} = file:open(File, [binary,write]),
        BinWriter = fun(Offset, Bin) -> file:pwrite(F, Offset, Bin) end,
        FrameWriter = fun(Frame, MP4Writer0) -> {ok, MP4Writer1} = mp4_writer:handle_frame(Frame, MP4Writer0), MP4Writer1 end,
        {ok, MP4Writer} = mp4_writer:init(BinWriter, [{method, one_pass}, {header, fun mp4_writer:noop/1}]),
        Frames = flu_test:gop(1) ++ flu_test:gop(2),
        lists:foldl(FrameWriter, MP4Writer, [flu_test:media_info()] ++ Frames ++ [eof]),
        file:close(F),
        Dur_ = lists:sum([D || #video_frame{duration = D, track_id = 1, content = video} <- Frames]),
        Dur = round(Dur_),
        ct:log("src dur:~p", [Dur]),
        true = Dur > 7500 andalso Dur < 8500, % Ms
        Dur.
      
      
      
      
      q(Url) ->q(Url, get).
      q(Url, Method) -> q(Url, Method, <<>>).
      q(Url, Method, Body) -> q(Url, Method, [], Body).
      q(Url, Method, Headers, B0) ->
        B = case B0 of
          <<_/binary>> -> B0;
          #{} -> jsx:encode(B0)
        end,
        case lhttpc:request(iolist_to_binary(["http://localhost:18081/videoeditor/", Url]), Method, Headers, B, 300) of
          {ok, {{200,_}, _, <<"[",_/binary>>=Body}} -> jsx:decode(Body, [return_maps,{labels,atom}]);
          {ok, {{200,_}, _, <<"{",_/binary>>=Body}} -> jsx:decode(Body, [return_maps,{labels,atom}]);
          {ok, {{200,_}, _, Body}} -> Body;
          Other -> Other
        end.
      

      this is a minified test file (it should not work, but should compile).

      this is what I get when try to compile it.

      MacBook-Pro:flussonic max$ erlc -v file_processor_SUITE.erl 
      Sub pass accept_context_args
      file_processor_SUITE.erl: internal error in beam_ssa_bsm;
      crash reason: {case_clause,{'EXIT',{{badkey,6},
                            [{maps,get,
                                   [6,
                                    #{12 => [12,3,5,0],
                                      4 => [4,5,0],
                                      53 => [53,52,51,50,49,48,47,44,0],
                                      46 => [46,44,0],
                                      28 => [28,30,32,34,37,39,41,3,5,0],
                                      23 => [23,15,25,26,28,30,32,34,37,39,41,3,5,0],
                                      59 =>
                                          [59,58,57,56,55,54,53,52,51,50,49,48,47,
                                           44,0],
                                      58 =>
                                          [58,57,56,55,54,53,52,51,50,49,48,47,44,0],
                                      30 => [30,32,34,37,39,41,3,5,0],
                                      47 => [47,44,0],
                                      22 => [22,15,25,26,28,30,32,34,37,39,41,3,5,0],
                                      61 =>
                                          [61,60,57,56,55,54,53,52,51,50,49,48,47,
                                           44,0],
                                      54 => [54,53,52,51,50,49,48,47,44,0],
                                      5 => [5,0],
                                      51 => [51,50,49,48,47,44,0],
                                      57 => [57,56,55,54,53,52,51,50,49,48,47,44,0],
                                      56 => [56,55,54,53,52,51,50,49,48,47,44,0],
                                      10 => [10,5,0],
                                      60 =>
                                          [60,57,56,55,54,53,52,51,50,49,48,47,44,0],
                                      41 => [41,3,5,0],
                                      49 => [49,48,47,44,0],
                                      55 => [55,54,53,52,51,50,49,48,47,44,0],
                                      45 => [45,44,0],
                                      3 => [3,5,0],
                                      37 => [37,39,41,3,5,0],
                                      32 => [32,34,37,39,41,3,5,0],
                                      44 => [44,0],
                                      0 => [0],
                                      13 => [13,26,28,30,32,34,37,39,41,3,5,0],
                                      25 => [25,26,28,30,32,34,37,39,41,3,5,0],
                                      17 =>
                                          [17,23,15,25,26,28,30,32,34,37,39,41,3,5,
                                           0],
                                      50 => [50,49,48,47,44,0],
                                      20 =>
                                          [20,22,15,25,26,28,30,32,34,37,39,41,3,5,
                                           0],
                                      15 => [15,25,26,28,30,32,34,37,39,41,3,5,0],
                                      52 => [52,51,50,49,48,47,44,0],
                                      26 => [26,28,30,32,34,37,39,41,3,5,0],
                                      34 => [34,37,39,41,3,5,0],
                                      63 => [63,47,44,0],
                                      39 => [39,41,3,5,0],
                                      62 => [62,55,54,53,52,51,50,49,48,47,44,0],
                                      48 => [48,47,44,0]}],
                                   []},
                             {beam_ssa_bsm,amb_get_alias,3,
                                           [{file,"beam_ssa_bsm.erl"},{line,350}]},
                             {beam_ssa_bsm,'-amb_assign_set/3-anonymous-0-',2,
                                           [{file,"beam_ssa_bsm.erl"},{line,325}]},
                             {lists,mapfoldl,3,[{file,"lists.erl"},{line,1354}]},
                             {lists,mapfoldl,3,[{file,"lists.erl"},{line,1355}]},
                             {beam_ssa_bsm,amb_assign_set,3,
                                           [{file,"beam_ssa_bsm.erl"},{line,324}]},
                             {lists,mapfoldl,3,[{file,"lists.erl"},{line,1354}]},
                             {beam_ssa_bsm,amb_1,3,
                                           [{file,"beam_ssa_bsm.erl"},
                                            {line,314}]}]}}}
      
        in function  compile:'-select_passes/2-anonymous-2-'/3 (compile.erl, line 675)
        in call from compile:'-internal_comp/5-anonymous-1-'/3 (compile.erl, line 399)
        in call from compile:fold_comp/4 (compile.erl, line 426)
        in call from compile:internal_comp/5 (compile.erl, line 410)
        in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 207)
        in call from compile:'-do_compile/2-anonymous-1-'/1 (compile.erl, line 223)
      file_processor_SUITE.erl:9: Warning: export_all flag enabled - all functions will be exported
      MacBook-Pro:flussonic max$ 
      

        Attachments

          Activity

            People

            Assignee:
            john John Högberg
            Reporter:
            maxlapshin Maksim Lapshin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: