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

Kostis Sagonas <>
Tue Jan 21 20:30:45 CET 2014


On 01/16/2014 05:09 PM, Jesper Louis Andersen wrote:
> 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

Thanks for the bug report. It's caused by a call in msgpack_term with 
options defined by

-define(TERM_OPTION, [{enable_str,true},{ext,?MODULE},{allow_atom,none}]).

but the msgpack:options() type does not include an {ext,module()} type 
in its specification.  So this should be fixed in the code.

However, dialyzer should of course not crash, even (especially?) on 
erroneous code.

> 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,...}]},

A preliminary patch which fixes this problem and avoids the crash is 
attached below. A more complete patch will hopefully make it in R17B.

Thanks again for reporting the bug,

Kostis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: erl_types.patch
Type: text/x-patch
Size: 1131 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20140121/6972e342/attachment.bin>


More information about the erlang-bugs mailing list