Skip to content

Dialyzing "checklist" #581

Closed
Closed
@yrashk

Description

@yrashk

I am trying to get elixir built into a PLT and I am running into various issues. Let me list them here so we can go through them and fix'em.

I can't quite spot what's happening there. The only thing that gets my attention in this module is ladders of "orelse"s and such (try running rp(beam_lib:chunks(Elixir-Macro, [abstract_code])) in erlang shell and you'll see what I mean)

  • A good bunch of modules (at least Node, Protocol, Record, Regex, RuntimeError, String, elixir, elixir_aliases, elixir_compiler, elixir_dispatch, elixir_errors, elixir_glob, elixir_import, elixir_macros, elixir_module, elixir_quote, elixir_scope, elixir_sup, elixir_translator, elixir_tree_helpers,elixir_try) seem to make dialyzer [soft]-crash with this warning:
  Adding information to /Users/yrashk/.dialyzer_plt...{"init terminating in do_boot",{function_clause,[{dialyzer,format_warning,
[{warn_callgraph,{<<55 bytes>>,92},{call_to_missing,[erlang,spawn,5]}},basename],[{file,"dialyzer.erl"},{line,292}]},
{dialyzer_cl,'-print_warnings/1-lc$^0/1-0-',2,[{file,"dialyzer_cl.erl"},{line,781}]},{dialyzer_cl,print_warnings,1,
[{file,"dialyzer_cl.erl"},{line,781}]},{dialyzer_cl,return_value,2,[{file,"dialyzer_cl.erl"},{line,667}]},{dialyzer_cl,do_analysis,4,
[{file,"dialyzer_cl.erl"},{line,405}]},{dialyzer,'-cl/1-fun-0-',1,[{file,"dialyzer.erl"},{line,152}]},{dialyzer,doit,1,[{file,"dialyzer.erl"},
{line,243}]},{dialyzer,plain_cl,0,[{file,"dialyzer.erl"},{line,83}]}]}}

Seemingly (according to --plt_info) these modules still make it into PLT. Here's an email I sent to Kostis (@kostis) with the explanation of this problem:

I found an issue that is seemingly preventing me from adding a bunch
of modules to plt. The issue that one of the dialyzer aux functions
crashes with function_clause:

{"init terminating in
do_boot",{function_clause,[{dialyzer,format_warning,[{warn_callgraph,{<<55
bytes>>,92},{call_to_missing,[erlang,spawn,5]}},basename],[{file,"dialyzer.erl"},{line,292}]}

When I started investigating I matched that <<55 bytes>> piece with
the File variable below:

format_warning({_Tag, {File, Line}, Msg}, FOpt) when is_list(File),
                                                     is_integer(Line) ->

However, according to format_warning's spec, the first argument is
dial_warning(), and according to dialyzer.hrl, this is
{dial_warn_tag(), file_line(), {atom(), [term()]}} and file_line() is
-type file_line() :: {file:filename(), non_neg_integer()}.

Which means, the filename accepted should be file:filename(), which is
currently (according to file.erl) is string() | binary()

Therefore, format_warning requiring the list there is in the wrong, if
I am not mistaken.

I wonder, however, why that bit got binarized even in pure .erl files? Something about our compilation process?

So far these seem to be the only obstacle. #1 is trivially fixable (I have a patch if necessary), #3 is seemingly minor as well (but we better figure out why it gets to that warning in the first place (spawn/5?!) and why File gets binarized there). #2 is a completely mystery to me so far.

I'd love if @kostis could help us but I know he is a busy man :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions