[erlang-bugs] 'dialyzer' fails with function_clause on mongodb-erlang

Sergei Lebedev <>
Mon Mar 12 06:59:16 CET 2012


Hello,

I've been trying to make 'dialyzer' work for mongodb-erlang [*] and found
out that the following line seems to crash 'dialyzer':

   src/mongo_replset.erl:-opaque rs_connection() :: {rs_connection,
rs_name(), mvar:mvar(connections()), timeout()}.

Traceback:

  $ dialyzer ebin/{mongo_replset,mvar}.beam
    Checking whether the PLT /Users/bobry/.dialyzer_plt is up-to-date... yes
    Proceeding with analysis...
  =ERROR REPORT==== 12-Mar-2012::09:51:34 ===
  Error in process <0.29.0> with exit value:
{function_clause,[{erl_types,t_contains_opaque,[{c,remote,[{remote,mvar,mvar,[{c,remote,[{remote,dict,dictionary,[{c,remote,[{remote,mongo_connect,host,[]}],unknown},{c,tuple_set,[{0,[{c,tuple,[],{0,any}}]},{1,[{c...


  dialyzer: Analysis failed with error:
  {function_clause,[{erl_types,t_contains_opaque,
                               [{c,remote,[{...}],unknown}],
                               [{file,"erl_types.erl"},{line,473}]},
                    {lists,all,2,[{file,[...]},{line,...}]},

{dialyzer_dataflow,get_apply_fail_msg,9,[{file,...},{...}]},
                    {dialyzer_dataflow,handle_apply_or_call,8,[{...}|...]},
                    {dialyzer_dataflow,handle_let,3,[...]},
                    {dialyzer_dataflow,do_clause,6,...},
                    {dialyzer_dataflow,handle_clauses,...},
                    {dialyzer_dataflow,...}]}
  Last messages in the log cache:
    Typesig analysis for SCC: [{mongo_replset,close,1}]
    Typesig analysis for SCC: [{mongo_replset,connect,1}]
    Typesig analysis for SCC: [{mongo_replset,connect_member,2}]
    Typesig analysis for SCC: [{mongo_replset,fetch_member_info,1}]
    Typesig analysis for SCC: [{mongo_replset,primary_conn,3}]
    Typesig analysis for SCC: [{mongo_replset,primary,1}]
    Typesig analysis for SCC: [{mongo_replset,secondary_ok_conn,2}]
    Typesig analysis for SCC: [{mongo_replset,secondary_ok,1}]
    Dataflow of one SCC: [mvar]
    Dataflow of one SCC: [mongo_replset]

Simply replacing '-opaque' with '-type' helps, but I'm not sure if it's
invalid typing in mongodb-erlang which causes the issue, or is it a bug in
'dialyzer'?

Sergei

[*] https://github.com/mongodb/mongodb-erlang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20120312/673f9c0f/attachment.html>


More information about the erlang-bugs mailing list