nocatch error in dialyzer, R14A

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

nocatch error in dialyzer, R14A

Nico Kruber
While I was trying to make a minimal example for another strange behaviour of
the dialyzer I found the following bug calling

> dialyzer -Werror_handling -Wrace_conditions --src -c rec*.erl --no_native

with the attached files in the current directory:

  Checking whether the PLT /home/nico/.dialyzer_plt is up-to-date... yes
  Proceeding with analysis...
=ERROR REPORT==== 31-Aug-2010::14:53:04 ===
Error in process <0.29.0> with exit value: {{nocatch,{error,
[73,108,108,101,103,97,108,32,100,101,99,108,97,114,97,116,105,111,110,32,111,102,32,"rec2",35,123,"id",125,10]}},
[{erl_types,record_from_form,5},{erl_types,t_from_form,3},{erl_types,'-
t_opaque_from_records/1-anonymous-2-',3},{dict,map_bucket,2},
{dict,map_bkt_list,2},{dict...


dialyzer: Analysis failed with error: {{nocatch,{error,
[73,108,108,101,103,97|...]}},
 [{erl_types,record_from_form,5},
  {erl_types,t_from_form,3},
  {erl_types,'-t_opaque_from_records/1-anonymous-2-',3},
  {dict,map_bucket,2},
  {dict,map_bkt_list,2},
  {dict,map_bkt_list,2},
  {dict,map_seg_list,...},
  {dict,...}]}
Last messages in the log cache:
  Reading files and computing callgraph... done in 0.06 secs
  Removing edges... done in 0.01 secs
  Typesig analysis for SCC: [{rec2,module_info,1}]

rec1.erl (86 bytes) Download Attachment
rec2.erl (101 bytes) Download Attachment
signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: nocatch error in dialyzer, R14A

Nico Kruber
On Tuesday 31 August 2010 14:59:02 Nico Kruber wrote:

> While I was trying to make a minimal example for another strange behaviour
> of the dialyzer I found the following bug calling
>
> > dialyzer -Werror_handling -Wrace_conditions --src -c rec*.erl --no_native
>
> with the attached files in the current directory:
>
>   Checking whether the PLT /home/nico/.dialyzer_plt is up-to-date... yes
>   Proceeding with analysis...
> =ERROR REPORT==== 31-Aug-2010::14:53:04 ===
> Error in process <0.29.0> with exit value: {{nocatch,{error,
> [73,108,108,101,103,97,108,32,100,101,99,108,97,114,97,116,105,111,110,32,1
> 11,102,32,"rec2",35,123,"id",125,10]}},
> [{erl_types,record_from_form,5},{erl_types,t_from_form,3},{erl_types,'-
> t_opaque_from_records/1-anonymous-2-',3},{dict,map_bucket,2},
> {dict,map_bkt_list,2},{dict...
>
>
> dialyzer: Analysis failed with error: {{nocatch,{error,
> [73,108,108,101,103,97|...]}},
>  [{erl_types,record_from_form,5},
>   {erl_types,t_from_form,3},
>   {erl_types,'-t_opaque_from_records/1-anonymous-2-',3},
>   {dict,map_bucket,2},
>   {dict,map_bkt_list,2},
>   {dict,map_bkt_list,2},
>   {dict,map_seg_list,...},
>   {dict,...}]}
> Last messages in the log cache:
>   Reading files and computing callgraph... done in 0.06 secs
>   Removing edges... done in 0.01 secs
>   Typesig analysis for SCC: [{rec2,module_info,1}]
I forgot to mention that if you replace opaque with type in rec2.erl, it works

Regards,
Nico Kruber

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: nocatch error in dialyzer, R14A

Kostis Sagonas-2
Nico Kruber wrote:

> On Tuesday 31 August 2010 14:59:02 Nico Kruber wrote:
>> While I was trying to make a minimal example for another strange behaviour
>> of the dialyzer I found the following bug calling
>>
>>> dialyzer -Werror_handling -Wrace_conditions --src -c rec*.erl --no_native
>> with the attached files in the current directory:
>>
>>   Checking whether the PLT /home/nico/.dialyzer_plt is up-to-date... yes
>>   Proceeding with analysis...
>> =ERROR REPORT==== 31-Aug-2010::14:53:04 ===
>> Error in process <0.29.0> with exit value: {{nocatch,{error,
>> [73,108,108,101,103,97,108,32,100,101,99,108,97,114,97,116,105,111,110,32,1
>> 11,102,32,"rec2",35,123,"id",125,10]}},
>> [{erl_types,record_from_form,5},{erl_types,t_from_form,3},{erl_types,'-
>> t_opaque_from_records/1-anonymous-2-',3},{dict,map_bucket,2},
>> {dict,map_bkt_list,2},{dict...
>>
>>
>> dialyzer: Analysis failed with error: {{nocatch,{error,
>> [73,108,108,101,103,97|...]}},
>>  [{erl_types,record_from_form,5},
>>   {erl_types,t_from_form,3},
>>   {erl_types,'-t_opaque_from_records/1-anonymous-2-',3},
>>   {dict,map_bucket,2},
>>   {dict,map_bkt_list,2},
>>   {dict,map_bkt_list,2},
>>   {dict,map_seg_list,...},
>>   {dict,...}]}
>> Last messages in the log cache:
>>   Reading files and computing callgraph... done in 0.06 secs
>>   Removing edges... done in 0.01 secs
>>   Typesig analysis for SCC: [{rec2,module_info,1}]
>
> I forgot to mention that if you replace opaque with type in rec2.erl, it works

Same issue here with the other one.  Simply change the declaration:

-record(rec2, {id :: rec1:rec1()}).
-opaque(rec2() :: #rec2{id :: rec1:rec1()}).

to the equivalent ones:

-record(rec2, {id :: rec1:rec1()}).
-opaque(rec2() :: #rec2{}).

and the crash will go away.

Kostis

________________________________________________________________
erlang-bugs (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: nocatch error in dialyzer, R14A

Nico Kruber
On Tuesday 31 August 2010 16:00:28 Kostis Sagonas wrote:

> Nico Kruber wrote:
> > On Tuesday 31 August 2010 14:59:02 Nico Kruber wrote:
> >> While I was trying to make a minimal example for another strange
> >> behaviour of the dialyzer I found the following bug calling
> >>
> >>> dialyzer -Werror_handling -Wrace_conditions --src -c rec*.erl
> >>> --no_native
> >>
> >> with the attached files in the current directory:
> >>   Checking whether the PLT /home/nico/.dialyzer_plt is up-to-date... yes
> >>   Proceeding with analysis...
> >>
> >> =ERROR REPORT==== 31-Aug-2010::14:53:04 ===
> >> Error in process <0.29.0> with exit value: {{nocatch,{error,
> >> [73,108,108,101,103,97,108,32,100,101,99,108,97,114,97,116,105,111,110,3
> >> 2,1 11,102,32,"rec2",35,123,"id",125,10]}},
> >> [{erl_types,record_from_form,5},{erl_types,t_from_form,3},{erl_types,'-
> >> t_opaque_from_records/1-anonymous-2-',3},{dict,map_bucket,2},
> >> {dict,map_bkt_list,2},{dict...
> >>
> >>
> >> dialyzer: Analysis failed with error: {{nocatch,{error,
> >> [73,108,108,101,103,97|...]}},
> >>
> >>  [{erl_types,record_from_form,5},
> >>  
> >>   {erl_types,t_from_form,3},
> >>   {erl_types,'-t_opaque_from_records/1-anonymous-2-',3},
> >>   {dict,map_bucket,2},
> >>   {dict,map_bkt_list,2},
> >>   {dict,map_bkt_list,2},
> >>   {dict,map_seg_list,...},
> >>   {dict,...}]}
> >>
> >> Last messages in the log cache:
> >>   Reading files and computing callgraph... done in 0.06 secs
> >>   Removing edges... done in 0.01 secs
> >>   Typesig analysis for SCC: [{rec2,module_info,1}]
> >
> > I forgot to mention that if you replace opaque with type in rec2.erl, it
> > works
>
> Same issue here with the other one.  Simply change the declaration:
>
> -record(rec2, {id :: rec1:rec1()}).
> -opaque(rec2() :: #rec2{id :: rec1:rec1()}).
>
> to the equivalent ones:
>
> -record(rec2, {id :: rec1:rec1()}).
> -opaque(rec2() :: #rec2{}).
same here: those are not equivalent since
-opaque(rec2() :: #rec2{}).
will be silently expanded to
-opaque(rec2() :: #rec2{id :: 'undefined' | rec1:rec1()}).
since there is no initialiser in the record's field definition.
The definition I provided yields to the expected behaviour, i.e. without the
'undefined' atom.
see http://www.erlang.org/doc/reference_manual/typespec.html#id2272601


Nico

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: nocatch error in dialyzer, R14A

Kostis Sagonas-2
In reply to this post by Nico Kruber
Nico Kruber wrote:

> On Tuesday 31 August 2010 14:59:02 Nico Kruber wrote:
>> While I was trying to make a minimal example for another strange behaviour
>> of the dialyzer I found the following bug calling
>>
>> ....
>> dialyzer: Analysis failed with error: {{nocatch,{error,
>> [73,108,108,101,103,97|...]}},
>>  [{erl_types,record_from_form,5},
>>   {erl_types,t_from_form,3},
>>   {erl_types,'-t_opaque_from_records/1-anonymous-2-',3},
>>   {dict,map_bucket,2},
>>   {dict,map_bkt_list,2},
>>   {dict,map_bkt_list,2},
>>   {dict,map_seg_list,...},
>>   {dict,...}]}
>> Last messages in the log cache:
>>   Reading files and computing callgraph... done in 0.06 secs
>>   Removing edges... done in 0.01 secs
>>   Typesig analysis for SCC: [{rec2,module_info,1}]


This problem has now been fixed (thanks to Maria Christakis).  The fix
appears here:

http://github.com/kostis/otp/commit/544b05dc65606fcbfb46c2df69026c28f4ab2117

and will hopefully be included in OTP at some point.

Kostis

________________________________________________________________
erlang-bugs (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]