Describe the bug
I'd like help debugging this; all pointers are welcome! I think the crash is triggered by elixir tooling, but the stack trace and crash is in the erlang compiler. I'm using elixir iex to run the code, but the file that triggers this is written in erlang.
I've copied the otp supervisor.erl module to make some trial modifications. The file lives in ./erlang/supervisor.erl.
To Reproduce
I don't yet know how to reproduce it, or where it should be fixed.
Building the erl file with erlc works fine
The first compilation of the file using iex works fine
Recompiling the file using iex triggers this error:
Compiling 1 file (.erl)
erlang/supervisor2.erl: internal error in pass beam_ssa_recv:
exception error: no match of right hand side value false
in function beam_ssa_recv:pu_is_ref_used_is/2 (beam_ssa_recv.erl, line 632)
in call from beam_ssa_recv:pu_is_ref_used_in_1/3 (beam_ssa_recv.erl, line 596)
in call from beam_ssa_recv:pu_ref_used_in/2 (beam_ssa_recv.erl, line 580)
in call from beam_ssa_recv:pu_is_ref_used/4 (beam_ssa_recv.erl, line 556)
in call from lists:search_1/2 (lists.erl, line 1776)
in call from beam_ssa_recv:plan_uses_1/4 (beam_ssa_recv.erl, line 520)
in call from beam_ssa_recv:'-plan_uses/3-anonymous-0-'/5 (beam_ssa_recv.erl, line 511)
in call from maps:fold_1/4 (maps.erl, line 416)
in call from beam_ssa_recv:plan/1 (beam_ssa_recv.erl, line 430)
in call from beam_ssa_recv:module/2 (beam_ssa_recv.erl, line 136)
in call from compile:'-select_passes/2-anonymous-0-'/3 (compile.erl, line 683)
in call from compile:fold_comp/4 (compile.erl, line 410)
in call from compile:internal_comp/5 (compile.erl, line 394)
in call from compile:'-internal_fun/2-anonymous-0-'/2 (compile.erl, line 227)
in call from compile:'-do_compile/2-anonymous-0-'/1 (compile.erl, line 217)
I'm not including the file itself, because I cannot really reproduce the issue reliably yet. I'm not fully convinced that the problem is in this file at all. Compling the file by itself seems to work no problem, and I can't upload the entire project. All pointers are welcome!
Expected behavior
I don't expect the assertion to fail.
Additional context
Add any other context about the problem here. If you wish to attach Erlang code you can either write it directly in the post using code tags, create a gist, or attach it as a zip file to this post.
Thanks for your report! This is definitely a bug. One thing you can do is add a try/catch in beam_ssa_recv:module/2 that dumps the #b_module{} record, that'll give us the offending file as seen by the pass.
Describe the bug I'd like help debugging this; all pointers are welcome! I think the crash is triggered by elixir tooling, but the stack trace and crash is in the erlang compiler. I'm using elixir
iex
to run the code, but the file that triggers this is written in erlang.I've copied the otp supervisor.erl module to make some trial modifications. The file lives in
./erlang/supervisor.erl
.I've managed to sometimes fail an assertion in beam_ssa_recv. It seems to be this line: https://github.com/erlang/otp/blob/0b33c5a4c0a647cf7df6d50c8768b574c48752fd/lib/compiler/src/beam_ssa_recv.erl#L633
To Reproduce I don't yet know how to reproduce it, or where it should be fixed.
erlc
works fineiex
works fineiex
triggers this error:which seems to be this line: https://github.com/erlang/otp/blob/0b33c5a4c0a647cf7df6d50c8768b574c48752fd/lib/compiler/src/beam_ssa_recv.erl#L633
Expected behavior I don't expect the assertion to fail.
Affected versions
Erlang/OTP 26 [erts-14.2.5] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit] [dtrace]
, seemingly26.2.5
?Additional context Add any other context about the problem here. If you wish to attach Erlang code you can either write it directly in the post using code tags, create a gist, or attach it as a zip file to this post.