Skip to content
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

[dialyzer] crash when a bitstring segment size is 'undefined' (in an expression) #7325

Closed
RobinMorisset opened this issue May 30, 2023 · 0 comments
Assignees
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM

Comments

@RobinMorisset
Copy link
Contributor

Describe the bug
Running dialyzer on the following:

f() ->
    <<0:(undefined)>>.

crashes it with

dialyzer: Analysis failed with error:
{{badmatch,"integer"},
 [{cerl,bitstr_bitsize,1,[{file,"cerl.erl"},{line,2396}]},
  {dialyzer_dataflow,handle_bitstr,3,
                     [{file,"dialyzer_dataflow.erl"},{line,779}]},
  {dialyzer_dataflow,traverse_list,4,
                     [{file,"dialyzer_dataflow.erl"},{line,293}]},
  {dialyzer_dataflow,traverse,3,[{file,"dialyzer_dataflow.erl"},{line,211}]},
  {dialyzer_dataflow,do_clause,7,[{file,"dialyzer_dataflow.erl"},{line,1276}]},
  {dialyzer_dataflow,handle_clauses,9,
                     [{file,"dialyzer_dataflow.erl"},{line,1199}]},
  {dialyzer_dataflow,handle_case,3,
                     [{file,"dialyzer_dataflow.erl"},{line,932}]},
  {dialyzer_dataflow,analyze_loop,1,
                     [{file,"dialyzer_dataflow.erl"},{line,186}]}]}

Affected versions
master

Additional context
The bug disappears if I replace undefined by another atom.
This seems related to #7138 that was fixed in #7160.

@RobinMorisset RobinMorisset added the bug Issue is reported as a bug label May 30, 2023
@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label Jun 1, 2023
@jhogberg jhogberg self-assigned this Jun 5, 2023
jhogberg added a commit to jhogberg/otp that referenced this issue Jun 5, 2023
jhogberg added a commit that referenced this issue Jun 8, 2023
…OTP-18629' into maint

* john/dialyzer/fix-crash-undefined-segment-size/GH-7325/OTP-18629:
  cerl: Fix crash on 'undefined' segment size
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

No branches or pull requests

3 participants