8000 [erlc] internal consistency check failed: "bad_arg_type" · Issue #6602 · erlang/otp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[erlc] internal consistency check failed: "bad_arg_type" #6602
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
RobinMorisset opened this issue Dec 30, 2022 · 1 comment · Fixed by #6621
Closed

[erlc] internal consistency check failed: "bad_arg_type" #6602

RobinMorisset opened this issue Dec 30, 2022 · 1 comment · Fixed by #6621
Assignees
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM

Comments

@RobinMorisset
Copy link
Contributor

On master,

f(<<X:((ok > {<<(true andalso ok)>>}) orelse 1)>>) ->
    try
        f0()
    after
        -(X + f1(not ok)),
        try
            ok
        catch
            _ ->
                ok;
            _ ->
                ok;
            _ ->
                ok;
            _ ->
                ok;
            _ ->
                ok;
            _ ->
                ok
        end
    end.

f0() ->
    ok.

f1(_) ->
    ok.

crashes erlc with the following error message:

bad_arg_type:1: function f/1+30:
  Internal consistency check failed - please report this bug.
  Instruction: {call_last,1,{f,18},2}
  Error:       {bad_arg_type,{x,0},{t_integer,any},{t_integer,{0,1}}}:

Interestingly, all 6 of the seemingly redundant branches in the catch are required for the bug to reproduce.

@RobinMorisset RobinMorisset added the bug Issue is reported as a bug label Dec 30, 2022
@rickard-green rickard-green added the team:VM Assigned to OTP team VM label Jan 2, 2023
@RobinMorisset
Copy link
Contributor Author

An alternate testcase for the same bug:

f() ->
    [
        ok
     || <<X:(is_number(<<(<<(0 bxor 0)>>)>>) orelse 1)>> <= <<>>,
        #{X := _} <- ok
    ].
< 9401 div class="d-flex">

jhogberg added a commit that referenced this issue Jan 3, 2023
…-none/GH-6602

beam_validator: Bail on impossible sizes in bs_get_integer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
0