-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
CaseClauseError running with --force-check #301
Comments
Making the error readable: path =
{{
:nocatch,
{
:dialyzer_error,
[78, 111, 116, 32, 97, 32, 114, 101, 103, 117, 108, 97, 114, 32, 102, 105, 108, 101, 58, 32, '/home/user/.project/_build/dev/lib/things/ebin/Elixir.AAA.beam', 10]
}
}, [
{:dialyzer_plt, :compute_md5_from_file, 1, [file: 'dialyzer_plt.erl', line: 543]},
{:dialyzer_plt, :compute_new_md5_1, 3, [file: 'dialyzer_plt.erl', line: 509]},
{:dialyzer_plt, :check_plt1, 3, [file: 'dialyzer_plt.erl', line: 479]},
{:dialyzer_plt, :"-subproc/1-fun-0-", 1, [file: 'dialyzer_plt.erl', line: 603]}
]}
|> elem(0)
|> elem(1)
|> elem(1)
:io.format("~ts", [path])
|
The error is thrown within this function in compute_md5_from_file(File) ->
case beam_lib:all_chunks(File) of
{ok, _, Chunks} ->
%% We cannot use beam_lib:md5 because it does not consider
%% the debug_info chunk, where typespecs are likely stored.
%% So we consider almost all chunks except the useless ones.
Filtered = [[ID, Chunk] || {ID, Chunk} <- Chunks, ID =/= "CInf", ID =/= "Docs"],
erlang:md5(lists:sort(Filtered));
{error, beam_lib, {file_error, _, enoent}} ->
Msg = io_lib:format("Not a regular file: ~ts\n", [File]),
throw({dialyzer_error, Msg}); % <-------------------------------- Here.
{error, beam_lib, _} ->
Msg = io_lib:format("Could not compute MD5 for .beam: ~ts\n", [File]),
throw({dialyzer_error, Msg})
end. Apparently, [
{:dialyzer_plt, :compute_md5_from_file, 1, [file: 'dialyzer_plt.erl', line: 543]},
{:dialyzer_plt, :compute_new_md5_1, 3, [file: 'dialyzer_plt.erl', line: 509]},
{:dialyzer_plt, :check_plt1, 3, [file: 'dialyzer_plt.erl', line: 479]},
{:dialyzer_plt, :"-subproc/1-fun-0-", 1, [file: 'dialyzer_plt.erl', line: 603]}
] |
Thanks for investigating! I think we need to handle any |
Yes, that would make sense. I still wonder what triggered that exception in the first place. I tried to "fuzz" this behaviour by corrupting and removing a |
I just came across this error too. I removed the
{{:nocatch,
{:dialyzer_error,
[
70,
105,
108,
101,
32,
110,
111,
116,
32,
102,
111,
117,
110,
100,
58,
32,
'/opt/homebrew/Cellar/erlang/24.0.4_1/lib/erlang/lib/dialyzer-4.4.1/ebin/erl_bif_types.beam',
10
]}},
[
{:dialyzer_plt, :compute_md5_from_file, 1, [file: 'dialyzer_plt.erl', line: 543]},
{:dialyzer_plt, :compute_new_md5_1, 3, [file: 'dialyzer_plt.erl', line: 509]},
{:dialyzer_plt, :check_version, 1, [file: 'dialyzer_plt.erl', line: 328]},
{:dialyzer_plt, :check_plt1, 3, [file: 'dialyzer_plt.erl', line: 477]},
{:dialyzer_plt, :"-subproc/1-fun-0-", 1, [file: 'dialyzer_plt.erl', line: 603]}
]} |
Don't know if this is the same issue but I get this:
Deleting all EDIT: Oh, the fix from #335 (delete old plt files) worked for me. |
Environment
Current behavior
Running with
--force-check
causes the following problem:Expected behavior
It should check the PLT, instead of giving this error.
The text was updated successfully, but these errors were encountered: