erlang / otp

Erlang/OTP
http://erlang.org
Apache License 2.0
11.3k stars 2.94k forks source link

Help wanted: beam_ssa_recv failed assertion #8733

Open drathier opened 4 weeks ago

drathier commented 4 weeks ago

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.

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], seemingly 26.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.

jhogberg commented 3 weeks ago

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.