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

TypEr -T not working #5657

Open
elbrujohalcon opened this issue Jan 27, 2022 · 1 comment
Open

TypEr -T not working #5657

elbrujohalcon opened this issue Jan 27, 2022 · 1 comment
Assignees
Labels
bug Issue is reported as a bug help wanted Issue not worked on by OTP; help wanted from the community team:VM Assigned to OTP team VM

Comments

@elbrujohalcon
Copy link
Contributor

Describe the bug
typer reports an error and blocks when trying to use the -T option.

To Reproduce

  1. Create these two files:
  • trusted.erl
-module(trusted).

-export([trusted/0]).

-spec trusted() -> trusted.
trusted() -> trusted.
  • untrusted.erl
-module(untrusted).

-export([untrusted/0]).

untrusted() ->
    trusted:trusted().
  1. Generate a PLT using dialyzer.
  2. Run the following command…
typer --plt /path/to/your/plt -T untrusted.erl -T trusted.erl

You'll see an error similar to…

=ERROR REPORT==== 27-Jan-2022::12:06:24.499883 ===
Error in process <0.84.0> with exit value:
{{case_clause,
     {value,
         {{"trusted.erl",{5,2}},
          {contract,
              [{{c,function,
                   [{c,product,[],unknown},{c,atom,[trusted],unknown}],
                   unknown},
                []}],
              [],
              [{{type,
                    {5,14},
                    'fun',
                    [{type,{5,14},product,[]},{atom,{5,20},trusted}]},
                []}]},
          []}}},
 [{dialyzer_typesig,get_plt_constr,4,
      [{file,"dialyzer_typesig.erl"},{line,821}]},
  {dialyzer_typesig,handle_call,3,[{file,"dialyzer_typesig.erl"},{line,795}]},
  {dialyzer_typesig,handle_clauses_1,7,
      [{file,"dialyzer_typesig.erl"},{line,929}]},
  {dialyzer_typesig,handle_clauses,6,
      [{file,"dialyzer_typesig.erl"},{line,871}]},
  {dialyzer_typesig,traverse,3,[{file,"dialyzer_typesig.erl"},{line,357}]},
  {dialyzer_typesig,traverse_list,4,
      [{file,"dialyzer_typesig.erl"},{line,656}]},
  {dialyzer_typesig,traverse,3,[{file,"dialyzer_typesig.erl"},{line,389}]},
  {dialyzer_typesig,traverse_scc,4,
      [{file,"dialyzer_typesig.erl"},{line,206}]}]}

…and the process will be blocked forever.

Expected behavior
This result:

%% File: "untrusted.erl"
%% ---------------------
-spec untrusted() -> 'trusted'.

Affected versions
I've experienced this issue in OTP 23.3.2 and OTP 24.0.2.

Additional context
Running TypEr without -T works fine:

/tmp/annotate$ typer --plt $PLT untrusted.erl trusted.erl

%% File: "untrusted.erl"
%% ---------------------
-spec untrusted() -> 'trusted'.

%% File: "trusted.erl"
%% -------------------
-spec trusted() -> 'trusted'.
@elbrujohalcon elbrujohalcon added the bug Issue is reported as a bug label Jan 27, 2022
@jhogberg jhogberg added the team:VM Assigned to OTP team VM label Jan 28, 2022
@jhogberg jhogberg added the help wanted Issue not worked on by OTP; help wanted from the community label Jan 31, 2022
@jhogberg
Copy link
Contributor

Thanks for your report! As with #5653, I don't think we have the time to fix this in the near future. Feel free to open a PR.

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 help wanted Issue not worked on by OTP; help wanted from the community team:VM Assigned to OTP team VM
Projects
None yet
Development

No branches or pull requests

2 participants