How handle Error in Dialyzer

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How handle Error in Dialyzer

Lutz Behnke
Hi there,

I am experiencing a bug in Dialyzer (see log trace below), I have
checked https://github.com/erlang/otp/wiki/Bug-reports, which tells me,
I should prepare a minimal programm to show the error. Unfortunately I
see the error only on a fairly large package. I have no idea how to
start trimming my code without changing/removing the cause of the bug.

Could anybody give me some ideas what is causing the error, so that I
can trimm only the blubber and not the meat?

Side note: The dialyzer is executing in a Docker environment running the
curated erlang:latest image from Docker Hub (currently 20.1.1). I have
tried with erlang:19, but got the same result.

TIA

mfg lutz

---------------------------log-----------------------------------------

===> Dialyzer starting, this may take a while...
===> Updating plt...
===> Resolving files...
===> Updating base plt...
===> Resolving files...
===> Building with 166 files in "/root/.cache/rebar3/rebar3_20.1.1_plt"...
===> Copying "/root/.cache/rebar3/rebar3_20.1.1_plt" to
"/sage/LoadBalancingServer/_build/test/rebar3_20.1.1_plt"...
===> Checking 166 files in
"/sage/LoadBalancingServer/_build/test/rebar3_20.1.1_plt"...
===> Adding 11 files to
"/sage/LoadBalancingServer/_build/test/rebar3_20.1.1_plt"...
===> Doing success typing analysis...
===> Resolving files...
===> Analyzing 33 files with
"/sage/LoadBalancingServer/_build/test/rebar3_20.1.1_plt"...

=ERROR REPORT==== 9-Oct-2017::07:34:49 ===
Error in process <0.25464.0> with exit value:
{{nocatch,{error,["dim_3_tree_map.erl",58,"14",58,32,
 
[73,108,108,101,103,97,108,32,100,101,99,108,97,114,97,116,
                    105,111,110,32,111,102,32,35,"dim_3_map",123,"map",125,
                    10]]}},
  [{dialyzer_utils,msg_with_position,2,
                   [{file,"dialyzer_utils.erl"},{line,451}]},
   {lists,foldl,3,[{file,"lists.erl"},{line,1263}]},
   {lists,foreach,2,[{file,"lists.erl"},{line,1338}]},
   {dialyzer_utils,process_record_remote_types,1,
                   [{file,"dialyzer_utils.erl"},{line,365}]},
   {dialyzer_analysis_callgraph,'-remote_type_postproc/2-fun-1-',4,
                                [{file,"dialyzer_analysis_callgraph.erl"},
                                 {line,206}]},
   {dialyzer_analysis_callgraph,'-remote_type_postprocessing/2-fun-0-',2,
                                [{file,"dialyzer_analysis_callgraph.erl"},
                                 {line,168}]}]}

=ERROR REPORT==== 9-Oct-2017::07:34:49 ===
Error in process <0.25428.0> with exit value:
{function_clause,
     [{dialyzer_codeserver,get_callbacks,
          [{{nocatch,
                {error,
                    ["dim_3_tree_map.erl",58,"14",58,32,
                     [73,108,108,101,103,97,108,32,100,101,99,108,97,114,97,
 
116,105,111,110,32,111,102,32,35,"dim_3_map",123,"map",
                      125,10]]}},
            [{dialyzer_utils,msg_with_position,2,
                 [{file,"dialyzer_utils.erl"},{line,451}]},
             {lists,foldl,3,[{file,"lists.erl"},{line,1263}]},
             {lists,foreach,2,[{file,"lists.erl"},{line,1338}]},
             {dialyzer_utils,process_record_remote_types,1,
                 [{file,"dialyzer_utils.erl"},{line,365}]},
 
{dialyzer_analysis_callgraph,'-remote_type_postproc/2-fun-1-',4,
                 [{file,"dialyzer_analysis_callgraph.erl"},{line,206}]},
             {dialyzer_analysis_callgraph,
                 '-remote_type_postprocessing/2-fun-0-',2,
                 [{file,"dialyzer_analysis_callgraph.erl"},{line,168}]}]}],
          [{file,"dialyzer_codeserver.erl"},{line,368}]},
 
{dialyzer_plt,insert_callbacks,2,[{file,"dialyzer_plt.erl"},{line,149}]},
      {dialyzer_analysis_callgraph,analysis_start,3,
          [{file,"dialyzer_analysis_callgraph.erl"},{line,143}]}]}
===> Error in dialyzing apps: Analysis failed with error:
{function_clause,
     [{dialyzer_codeserver,get_callbacks,
          [{{nocatch,
                {error,
                    ["dim_3_tree_map.erl",58,"14",58,32,
                     [73,108,108,101,103,97,108,32,100,101,99,108,97,114,97,
 
116,105,111,110,32,111,102,32,35,"dim_3_map",123,"map",
                      125,10]]}},
            [{dialyzer_utils,msg_with_position,2,
                 [{file,"dialyzer_utils.erl"},{line,451}]},
             {lists,foldl,3,[{file,"lists.erl"},{line,1263}]},
             {lists,foreach,2,[{file,"lists.erl"},{line,1338}]},
             {dialyzer_utils,process_record_remote_types,1,
                 [{file,"dialyzer_utils.erl"},{line,365}]},
 
{dialyzer_analysis_callgraph,'-remote_type_postproc/2-fun-1-',4,
                 [{file,"dialyzer_analysis_callgraph.erl"},{line,206}]},
             {dialyzer_analysis_callgraph,
                 '-remote_type_postprocessing/2-fun-0-',2,
                 [{file,"dialyzer_analysis_callgraph.erl"},{line,168}]}]}],
          [{file,"dialyzer_codeserver.erl"},{line,368}]},
 
{dialyzer_plt,insert_callbacks,2,[{file,"dialyzer_plt.erl"},{line,149}]},
      {dialyzer_analysis_callgraph,analysis_start,3,
          [{file,"dialyzer_analysis_callgraph.erl"},{line,143}]}]}
Last messages in the log cache:
   Reading files and computing callgraph... done in 0.14 secs
   Removing edges... done in 0.01 secs




--
Lutz Behnke
Hochschule für Angewandte Wissenschaften Hamburg,
Labor für Allgemeine Informatik,

phone: +49 40 42875-8156    mailto:[hidden email]
fax  : +49 40 2803770       http://users.informatik.haw-hamburg.de/~sage
Berliner Tor 7, 20099 Hamburg, Germany


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How handle Error in Dialyzer

Kostis Sagonas-2
On 10/09/2017 10:24 AM, Lutz Behnke wrote:

> Hi there,
>
> I am experiencing a bug in Dialyzer (see log trace below), I have
> checked https://github.com/erlang/otp/wiki/Bug-reports, which tells me,
> I should prepare a minimal programm to show the error. Unfortunately I
> see the error only on a fairly large package. I have no idea how to
> start trimming my code without changing/removing the cause of the bug.
>
> Could anybody give me some ideas what is causing the error, so that I
> can trimm only the blubber and not the meat?

As it's pretty clear from the line below, the crash happens when
analyzing one of these 33 modules:

> ===> Analyzing 33 files with
> "/sage/LoadBalancingServer/_build/test/rebar3_20.1.1_plt"...

It's not a very small number, but it's not a very big one either.  I
would start with "some educated guess" on a subset of them.

Also, the lines below refer to a file "dim_3_tree_map.erl", which is
most likely involved in the problem (if not the culprit) and to a module
that is supposed to contain -- if not actually contains -- callbacks.

So, I think you have a starting point.

Hope this helps,

Kostis

> =ERROR REPORT==== 9-Oct-2017::07:34:49 ===
> Error in process <0.25464.0> with exit value:
> {{nocatch,{error,["dim_3_tree_map.erl",58,"14",58,32,
>
> [73,108,108,101,103,97,108,32,100,101,99,108,97,114,97,116,
>                     105,111,110,32,111,102,32,35,"dim_3_map",123,"map",125,
>                     10]]}},
> ===> Error in dialyzing apps: Analysis failed with error:
> {function_clause,
>      [{dialyzer_codeserver,get_callbacks,
>           [{{nocatch,
>                 {error,
>                     ["dim_3_tree_map.erl",58,"14",58,32,
>                      
> [73,108,108,101,103,97,108,32,100,101,99,108,97,114,97,

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: How handle Error in Dialyzer

Hans Bolinder-2
In reply to this post by Lutz Behnke

Hi,

The reason is

"dim_3_tree_map.erl:14: Illegal declaration of #dim_3_map{map}\n"

This is possibly due to the 'map' field having a type that is not
a subtype of the field's declared type.

I'm not sure why the error is reported in such a harsh way, or if it's
indented to be that way. It may take a while before I have the
opportunity to check the details, though.

Best regards,

Hans Bolinder, Erlang/OTP team, Ericsson


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: How handle Error in Dialyzer

Lutz Behnke
In reply to this post by Kostis Sagonas-2
Hi,

I meant 'large' when compared to a piece of code of maybe 1-3 modules
that would be ideal to provoke the error for further analysis.

You are right regarding the module dim_3_tree_map. I had not identified
it as the culprit, as it does not follow the naming convention of the
application and did not recognized it as one of ours.

And due to the unfamiliar form of the error messages, I did not
initially consider the code under test to be the culprit.

mfg lutz

Am 09.10.2017 um 10:57 schrieb Kostis Sagonas:

> On 10/09/2017 10:24 AM, Lutz Behnke wrote:
>> Hi there,
>>
>> I am experiencing a bug in Dialyzer (see log trace below), I have
>> checked https://github.com/erlang/otp/wiki/Bug-reports, which tells
>> me, I should prepare a minimal programm to show the error.
>> Unfortunately I see the error only on a fairly large package. I have
>> no idea how to start trimming my code without changing/removing the
>> cause of the bug.
>>
>> Could anybody give me some ideas what is causing the error, so that I
>> can trimm only the blubber and not the meat?
>
> As it's pretty clear from the line below, the crash happens when
> analyzing one of these 33 modules:
>
>> ===> Analyzing 33 files with
>> "/sage/LoadBalancingServer/_build/test/rebar3_20.1.1_plt"...
>
> It's not a very small number, but it's not a very big one either.  I
> would start with "some educated guess" on a subset of them.
>
> Also, the lines below refer to a file "dim_3_tree_map.erl", which is
> most likely involved in the problem (if not the culprit) and to a module
> that is supposed to contain -- if not actually contains -- callbacks.
>
> So, I think you have a starting point.
>
> Hope this helps,
>
> Kostis
>
>> =ERROR REPORT==== 9-Oct-2017::07:34:49 ===
>> Error in process <0.25464.0> with exit value:
>> {{nocatch,{error,["dim_3_tree_map.erl",58,"14",58,32,
>>
>> [73,108,108,101,103,97,108,32,100,101,99,108,97,114,97,116,
>>                    
>> 105,111,110,32,111,102,32,35,"dim_3_map",123,"map",125,
>>                     10]]}},
>> ===> Error in dialyzing apps: Analysis failed with error:
>> {function_clause,
>>      [{dialyzer_codeserver,get_callbacks,
>>           [{{nocatch,
>>                 {error,
>>                     ["dim_3_tree_map.erl",58,"14",58,32,
>> [73,108,108,101,103,97,108,32,100,101,99,108,97,114,97,
>

--
Lutz Behnke
Hochschule für Angewandte Wissenschaften Hamburg,
Labor für Allgemeine Informatik,

phone: +49 40 42875-8156    mailto:[hidden email]
fax  : +49 40 2803770       http://users.informatik.haw-hamburg.de/~sage
Berliner Tor 7, 20099 Hamburg, Germany


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How handle Error in Dialyzer

Kostis Sagonas-2
On 10/09/2017 12:16 PM, Lutz Behnke wrote:
> You are right regarding the module dim_3_tree_map. I had not identified
> it as the culprit, as it does not follow the naming convention of the
> application and did not recognized it as one of ours.
>
> And due to the unfamiliar form of the error messages, ... <SNIP>

Error messages generally have that property.  They only start to look
mildly familiar only once you have seen them for a number of times
already.  What is more surprising is that you may be using some software
successfully for quite some time before you see the first error being
printed from it.

Based on your experience, I think that Dialyzer's error messages can be
improved -- please do send the offending module.  Somebody thought it's
a good idea to create an io_list() instead of a string() expecting that
the printing routine at the end will always be doing the flattening.
Apparently, this is not always the case when things go wrong...

Kostis
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: How handle Error in Dialyzer

Lutz Behnke
In reply to this post by Hans Bolinder-2
I am confused!

Where did you pull that message from?

Am 09.10.2017 um 11:08 schrieb Hans Bolinder:

> Hi,
>
> The reason is
>
> "dim_3_tree_map.erl:14: Illegal declaration of #dim_3_map{map}\n"
>
> This is possibly due to the 'map' field having a type that is not
> a subtype of the field's declared type.
>
> I'm not sure why the error is reported in such a harsh way, or if it's
> indented to be that way. It may take a while before I have the
> opportunity to check the details, though.
>
> Best regards,
>
> Hans Bolinder, Erlang/OTP team, Ericsson
>
>

--
Lutz Behnke
Hochschule für Angewandte Wissenschaften Hamburg,
Labor für Allgemeine Informatik,

phone: +49 40 42875-8156    mailto:[hidden email]
fax  : +49 40 2803770       http://users.informatik.haw-hamburg.de/~sage
Berliner Tor 7, 20099 Hamburg, Germany


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How handle Error in Dialyzer

Kostis Sagonas-2
On 10/09/2017 04:17 PM, Lutz Behnke wrote:
> I am confused!
>
> Where did you pull that message from?

Eshell V9.1.1  (abort with ^G)
1>
["dim_3_tree_map.erl",58,"14",58,32,[73,108,108,101,103,97,108,32,100,101,99,108,97,114,97,116,105,111,110,32,111,102,32,35,"dim_3_map",123,"map",125,10]].
["dim_3_tree_map.erl",58,"14",58,32,
  [73,108,108,101,103,97,108,32,100,101,99,108,97,114,97,116,
   105,111,110,32,111,102,32|...]]
2> io:format("~s", [v(1)]).
dim_3_tree_map.erl:14: Illegal declaration of #dim_3_map{map}
ok


It was there all along ;)

Kostis


> Am 09.10.2017 um 11:08 schrieb Hans Bolinder:
>> Hi,
>>
>> The reason is
>>
>> "dim_3_tree_map.erl:14: Illegal declaration of #dim_3_map{map}\n"
>>
>> This is possibly due to the 'map' field having a type that is not
>> a subtype of the field's declared type.
>>
>> I'm not sure why the error is reported in such a harsh way, or if it's
>> indented to be that way. It may take a while before I have the
>> opportunity to check the details, though.
>>
>> Best regards,
>>
>> Hans Bolinder, Erlang/OTP team, Ericsson
>>
>>
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions
>

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions