[erlang-bugs] Possible Dialyzer bug (reproducible test case)

Jesper Louis Andersen <>
Thu Jan 16 16:09:07 CET 2014


I may be totally off here, but I have a strange bug which I have seen twice
now on R16B03, OSX for the Dialyzer. To reproduce it, execute the following
steps:

# Clone repository and force a specific version
; git clone https://github.com/jlouis/msgpack-erlang.git
; cd msgpack-erlang
; git checkout origin/dialyzer-failure
; make
; make build_plt # Takes about 2 minutes
; make dialyzer

Gives the following:

=ERROR REPORT==== 16-Jan-2014::15:52:18 ===
Error in process <0.67.0> with exit value:
{function_clause,[{erl_types,unify_lists,[[{c,tuple,[{c,atom,[ext],unknown},{c,atom,[msgpack_term],unknown}],{2,{c,atom,[ext],unknown}}}],[],[],[{c,tuple,[{c,atom,[enable_str],unknown},{c,atom,[true],unknown}],{2,{c,atom...


dialyzer: Analysis failed with error:
{function_clause,[{erl_types,unify_lists,
                             [[{c,tuple,[...],...}],[],[],[{...}|...],[]],
                             [{file,"erl_types.erl"},{line,2695}]},
                  {erl_types,t_unify,4,[{file,[...]},{line,...}]},
                  {erl_types,t_unify,4,[{file,...},{...}]},
                  {erl_types,t_unify,3,[{...}|...]},
                  {dialyzer_typesig,solve_subtype,4,[...]},
                  {dialyzer_typesig,mk_constraint,3,...},
                  {dialyzer_typesig,state__store_conj,...},
                  {dialyzer_typesig,...}]}
Last messages in the log cache:
  Reading files and computing callgraph... done in 0.27 secs
  Removing edges... done in 0.04 secs

=ERROR REPORT==== 16-Jan-2014::15:52:18 ===
Error in process <0.69.0> with exit value:
{badarg,[{ets,insert,[790562,[{{msgpack,pack,1},{{c,binary,[8,8],unknown},[{c,union,[none,{c,binary,[8,0],unknown},none,none,{c,list,[{c,union,[none,{c,binary,[8,0],unknown},none,none,{c,list,[any,{c,nil,[],unknown}],unknown...

make: *** [dialyzer] Error 1

If you run `git show origin/dialyzer-failure` you have the following patch
chunk:

diff --git a/include/msgpack.hrl b/include/msgpack.hrl
index 6ef046d..4796492 100644
--- a/include/msgpack.hrl
+++ b/include/msgpack.hrl
@@ -63,8 +63,8 @@
           impl = erlang      :: erlang | nif,
           allow_atom = none  :: none | pack, %% allows atom when packing
           enable_str = false :: boolean(), %% true for new spec
-          ext_packer = undefined :: msgpack_ext_packer(),
-          ext_unpacker = undefined :: msgpack_ext_unpacker(),
+          ext_packer = undefined :: undefined | msgpack_ext_packer(),
+          ext_unpacker = undefined :: undefined | msgpack_ext_unpacker(),
           original_list = []       :: msgpack_list_options()
          }).

Undoing this patch chunk makes the dialyzer report a slew of warnings, but
not fail.

Is it possible that someone can try doing the same on another setup to
verify the presence/absence of the error? Also preferable on older releases
to make a target for bisection.


-- 
J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20140116/b8e14a4d/attachment.html>


More information about the erlang-bugs mailing list