[erlang-bugs] Dialyzer can't compile map correctly

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Tue Dec 16 01:07:52 CET 2014


Hi OTP team and other interested parties.

While I was building up the enacl application, I have discovered a problem
where I can crash the dialyzer. Attached are two minimized files which
exposes the problem. To compile this I did:

erlc +debug_info *.erl
dialyzer --build_plt --apps kernel stdlib
dialyzer *.beam

and it produces the following IDE (Internal Dialyzer Error):

erlc +debug_info *.erl
dialyzer *.beam
  Checking whether the PLT /home/jlouis/.dialyzer_plt is up-to-date... yes
  Proceeding with analysis...
=ERROR REPORT==== 16-Dec-2014::01:00:27 ===
Error in process <0.48.0> with exit value:
{{case_clause,map},[{dialyzer_dataflow,find_terminals,1,[{file,"dialyzer_dataflow.erl"},{line,3451}]},{dialyzer_dataflow,find_terminals_list,3,[{file,"dialyzer_dataflow.erl"},{line,3504}]},{dialyzer_dataflow,classify_returns...


dialyzer: Analysis failed with error:
{{case_clause,map},
 [{dialyzer_dataflow,find_terminals,1,
                     [{file,"dialyzer_dataflow.erl"},{line,3451}]},
  {dialyzer_dataflow,find_terminals_list,3,
                     [{file,"dialyzer_dataflow.erl"},{line,3504}]},
  {dialyzer_dataflow,classify_returns,1,
                     [{file,"dialyzer_dataflow.erl"},{line,3443}]},
  {dialyzer_dataflow,'-state__get_warnings/2-fun-0-',7,
                     [{file,"dialyzer_dataflow.erl"},{line,2908}]},
  {lists,foldl,3,[{file,"lists.erl"},{line,1261}]},
  {dialyzer_dataflow,state__get_warnings,2,
                     [{file,"dialyzer_dataflow.erl"},{line,2934}]},
  {dialyzer_dataflow,get_warnings,5,
                     [{file,"dialyzer_dataflow.erl"},{line,142}]},
  {dialyzer_succ_typings,collect_warnings,2,
                         [{file,"dialyzer_succ_typings.erl"},{line,182}]}]}
Last messages in the log cache:
  Reading files and computing callgraph... done in 0.06 secs
  Removing edges... done in 0.01 secs
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 1

I have attached the two culprit files. They have the following sizes:

jlouis@REDACTED:~/tmp/problem$ wc *.erl
 12  29 211 enacl.erl
 23  36 460 enacl_nif.erl
 35  65 671 total

and I think it may be possible to shrink further down, but I think it is
already small enough to be workable. Do note: while one part is a NIF, you
don't need the underlying C code to break the dialyzer.

The full repository is at:

https://github.com/jlouis/enacl

and the commit ID 23e535fcc23c1 should have the error if you want to look
at the full repository. It does require a properly installed libsodium,
which is not in Debian/Ubuntu for instance, which is why I have tried to
narrow down the problem before reporting it.

I hope this is enough to track down the error, perhaps by looking at the
backtrace and error case alone. Otherwise, please come back to me.

-- 
J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20141216/3b9fc146/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: enacl.erl
Type: text/x-erlang
Size: 211 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20141216/3b9fc146/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: enacl_nif.erl
Type: text/x-erlang
Size: 460 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20141216/3b9fc146/attachment-0001.bin>


More information about the erlang-bugs mailing list