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

beam_except error when compiling module in Erlang/OTP 22

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 22.0
    • Fix Version/s: 22.0.2
    • Component/s: compiler
    • Labels:
      None

      Description

      The following module:

      -module(beam_error).
      -export([bar/1]).
      
      bar(Req) ->
        ok = case Req of
          "POST" -> {error, <<"BAD METHOD ", Req/binary>>, Req};
          _ -> ok
        end.
      
      

      Fails to compile with:

      Function: bar/1
      beam_error.erl: internal error in beam_except;
      crash reason: {case_clause,
          {'EXIT',
              {function_clause,
                  [{beam_except,fix_block_1,
                       [[],3],
                       [{file,"beam_except.erl"},{line,134}]},
                   {beam_except,fix_block_1,2,[{file,"beam_except.erl"},{line,143}]},
                   {beam_except,translate_exception,4,
                       [{file,"beam_except.erl"},{line,132}]},
                   {beam_except,dig_out,1,[{file,"beam_except.erl"},{line,104}]},
                   {beam_except,translate_1,5,[{file,"beam_except.erl"},{line,78}]},
                   {beam_except,function,1,[{file,"beam_except.erl"},{line,45}]},
                   {beam_except,'-module/2-lc$^0/1-0-',1,
                       [{file,"beam_except.erl"},{line,40}]},
                   {beam_except,module,2,[{file,"beam_except.erl"},{line,40}]}]}}}
      
        in function  compile:'-select_passes/2-anonymous-2-'/3 (compile.erl, line 672)
        in call from compile:'-internal_comp/5-anonymous-1-'/3 (compile.erl, line 396)
        in call from compile:fold_comp/4 (compile.erl, line 423)
        in call from compile:internal_comp/5 (compile.erl, line 407)
        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)
      

      I noticed `beam_except` no longer exists on the master branch in GitHub but I decided to do a bug report anyway in case the OTP team decides to backport the removal of beam_except to the maint/maint-22 branches too.

        Attachments

          Activity

            People

            Assignee:
            bjorn Björn Gustavsson
            Reporter:
            josevalim José Valim
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: