<div dir="ltr">I tried to create a minimal testcase but I unfortunately haven't been able to. I was running dialyzer on a quite large code base and now even the unpatched dialyzer works without any issue after I fixed all the issues reported by dialyzer.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 17, 2015 at 5:38 PM, Björn-Egil Dahlberg <span dir="ltr"><<a href="mailto:egil@erlang.org" target="_blank">egil@erlang.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><span class="">
<div>On 2015-03-13 11:20, Ali Sabil wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Has this been solved for 17.4? I am getting the
same crash on a quite large code base using 17.4.1</div>
</blockquote>
<br></span>
Do you have a minimized testcase that fails on maint? I couldn't
reproduce it with dt or dt2.<br>
<br>
I'll add the missing map type in find_terminals.<span class="HOEnZb"><font color="#888888"><br>
<br>
// Björn-Egil</font></span><div><div class="h5"><br>
<br>
<blockquote type="cite">
<div dir="ltr">
<div><br>
</div>
<div>Thanks,</div>
<div>Ali</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Nov 27, 2014 at 10:05 PM, Ivan
Uemlianin <span dir="ltr"><<a href="mailto:ivan@llaisdy.com" target="_blank">ivan@llaisdy.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="auto">
<div>Dear Björn-Egil</div>
<div><br>
</div>
<div>Thanks very much for your work and for reporting
back. It looks like good news (for me and for 18 at
least).</div>
<div><br>
</div>
<div>Best wishes</div>
<div><br>
</div>
<div>Ivan<br>
<br>
--<br>
festina lente
<div><br>
</div>
</div>
<div>
<div>
<div><br>
On 27 Nov 2014, at 20:52, Björn-Egil Dahlberg <<a href="mailto:wallentin.dahlberg@gmail.com" target="_blank">wallentin.dahlberg@gmail.com</a>>
wrote:<br>
<br>
</div>
<blockquote type="cite">
<div>
<div dir="ltr">Looks like the regression was
introduced in
'hb/dialyzer/fix_recognition_of_records/OTP-11935'
(805f9c89fc01220bc1bb0f27e1b68fd4eca688ba)
included from OTP 17.1
<div><br>
</div>
<div>This becomes a none-issue in the master
branch (for 18) since variables are allowed as
keys there but it needs to be solved for the
17 track.<br>
<div><br>
</div>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2014-11-27 21:13
GMT+01:00 Björn-Egil Dahlberg <span dir="ltr"><<a href="mailto:wallentin.dahlberg@gmail.com" target="_blank">wallentin.dahlberg@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">I managed to reproduce your
errors on dt.erl and dt2.erl using
OTP-17.3.3 tag.
<div><br>
</div>
<div>Seems like I've missed something in
dataflow .. looks like a clause missing
for the map type.</div>
<div>I'm not well versed in dialyzer.
Hopefully I can do a fix for it for
17.4.</div>
<div><br>
</div>
<div>There are a bit more stuff going on
here too. When dialyzer uses the erlang
compiler to compile to core</div>
<div>it does not coalesce things to
literals but keeps them abstract instead
.. </div>
<div>Compound keys such as [1,2,3] and
{4,5,6} will thus become non-literals
(variables) and such keys are not
allowed in maps. </div>
<div><br>
</div>
<div>I need to ponder that a bit before I
try to solve it.</div>
<span><font color="#888888">
<div><br>
</div>
<div>// Björn-Egil</div>
</font></span></div>
<div>
<div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2014-11-27
13:20 GMT+01:00 Ivan Uemlianin <span dir="ltr"><<a href="mailto:ivan@llaisdy.com" target="_blank">ivan@llaisdy.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Dave<br>
<br>
Thanks for your help. Here are
some more details:<br>
<br>
<br>
*** OS: FreeBSD 10.0-RELEASE<br>
<br>
$ uname -a<br>
FreeBSD simba 10.0-RELEASE FreeBSD
10.0-RELEASE #0 r260789: Thu Jan
16 22:34:59 UTC 2014 <a href="mailto:root@snap.freebsd.org" target="_blank">root@snap.freebsd.org</a>:/usr/obj/usr/src/sys/GENERIC
amd64<br>
<br>
Upgrading to 10.1 is on my todo
list.<br>
<br>
<br>
*** Erlang version now 17.3_3,3<br>
<br>
$ pkg info erlang<br>
erlang-17.3_1,3<br>
...<br>
$ sudo pkg upgrade<br>
...<br>
<br>
$ pkg info erlang<br>
erlang-17.3_3,3<br>
...<br>
<br>
<br>
*** Errors persist<br>
<br>
Upgrading erlang has not changed
behaviour.<br>
<br>
A couple more observations:<br>
<br>
1. Running dialyzer on the module
dt below gets the error as noted
previously. However, if I
uncomment the '%% ok' line,
dialyzer will process the module
with no problems.<br>
<br>
-module(dt).<span><br>
-export([get_map/0]).<br>
<br>
-spec get_map() -> map().<br>
get_map() -><br>
#{labels => [one,
two],<br>
number => 27,<br>
</span>
%% [1,2,3] => wer,
%% ok<span><br>
kvok => #{<br>
a => qwe,<br>
2 => asd,<br>
[1,2,3] =>
wer, %% bad<br>
{4,5,6} =>
sdf, %% bad<br>
"abc" => zxc<br>
}<br>
}.<br>
<br>
</span>
$ dialyzer dt.erl<br>
Checking whether the PLT
/home/ivan/.dialyzer_plt is
up-to-date... yes<br>
Proceeding with analysis...<br>
=ERROR REPORT====
27-Nov-2014::12:17:02 ===<span><br>
Error in process
<0.45.0> with exit value:
{{case_clause,map},[{dialyzer_dataflow,find_terminals,1,[{file,"dialyzer_dataflow.erl"},{line,3451}]},{dialyzer_dataflow,find_terminals_list,3,[{file,"dialyzer_dataflow.erl"},{line,3504}]},{dialyzer_dataflow,classify_returns...
<br>
<br>
<br>
</span><span>
dialyzer: Analysis failed
with error:<br>
</span><span>
{{case_clause,map},<br>
[{dialyzer_dataflow,find_terminals,1,<br>
[{file,"dialyzer_dataflow.erl"},{line,3451}]},<br>
{dialyzer_dataflow,find_terminals_list,3,<br>
[{file,"dialyzer_dataflow.erl"},{line,3504}]},<br>
{dialyzer_dataflow,classify_returns,1,<br>
[{file,"dialyzer_dataflow.erl"},{line,3443}]},<br>
{dialyzer_dataflow,'-state__get_warnings/2-fun-0-',7,<br>
[{file,"dialyzer_dataflow.erl"},{line,2908}]},<br>
{lists,foldl,3,[{file,"lists.erl"},{line,1261}]},<br>
{dialyzer_dataflow,state__get_warnings,2,<br>
[{file,"dialyzer_dataflow.erl"},{line,2934}]},<br>
{dialyzer_dataflow,get_warnings,5,<br>
[{file,"dialyzer_dataflow.erl"},{line,142}]},<br>
{dialyzer_succ_typings,collect_warnings,2,<br>
[{file,"dialyzer_succ_typings.erl"},{line,182}]}]}<br>
</span><span>
Last messages in the log
cache:<br>
Reading files and
computing callgraph... done in
0.07 secs<br>
Removing edges... done in
0.00 secs<br>
<br>
<br>
</span>
2. Running dialyzer on the module
dt2 below raises the warning
following. Uncommenting the '%%
ok' line has no effect.<br>
<br>
-module(dt2).<span><br>
-export([get_map/0]).<br>
<br>
-spec get_map() -> map().<br>
get_map() -><br>
</span>
X = #{labels => [one,
two],<br>
number => 27,<br>
%% [1,2,3] => wer,
%% ok<span><br>
kvok => #{<br>
a => qwe,<br>
2 => asd,<br>
[1,2,3] =>
wer, %% bad<br>
{4,5,6} =>
sdf, %% bad<br>
"abc" => zxc<br>
}<br>
</span>
},<br>
X.<br>
<br>
$ dialyzer dt2.erl<br>
Checking whether the PLT
/home/ivan/.dialyzer_plt is
up-to-date... yes<br>
Proceeding with analysis...<br>
dt2.erl:5: Function get_map/0
has no local return<br>
done in 0m0.41s<br>
done (warnings were emitted)<br>
<br>
Best wishes<span><font color="#888888"><br>
<br>
Ivan</font></span>
<div>
<div><br>
<br>
<br>
<br>
On 11/25/14 20:37, Dave
Cottlehuber wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Sorry about that last email
…<br>
<br>
EWORKSFORME.<br>
<br>
FreeBSD 10.1 amd64,
erlang-17.3_2,3 from pkg.<br>
<br>
What FreeBSD & erlang
are you using?<br>
<br>
dch /tmp ❯❯❯ dialyzer
--build_plt --apps erts
kernel stdlib<br>
Creating PLT
/home/dch/.dialyzer_plt ...<br>
Unknown functions:<br>
compile:file/2<br>
compile:forms/2<br>
compile:noenv_forms/2<br>
compile:output_generated/1<br>
crypto:block_decrypt/4<br>
crypto:start/0<br>
Unknown types:<br>
compile:option/0<br>
done in 1m8.53s<br>
done (passed successfully)<br>
<br>
dch /tmp ❯❯❯dialyzer
ltu.erl<br>
Checking whether the PLT
/home/dch/.dialyzer_plt is
up-to-date... yes<br>
Proceeding with
analysis... done in 0m0.41s<br>
done (passed successfully)<br>
<br>
dch /tmp ❯❯❯erl<br>
Erlang/OTP 17 [erts-6.2]
[source] [64-bit] [smp:8:8]
[async-threads:64]
[kernel-poll:true]<br>
<br>
Eshell V6.2 (abort with ^G)<br>
1><br>
<br>
A+, Dave<br>
— sent from my Couch<br>
<br>
<br>
_______________________________________________<br>
erlang-questions mailing
list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote>
<br>
</div>
</div>
-- <br>
============================================================<span><br>
Ivan A. Uemlianin PhD<br>
Llaisdy<br>
Speech Technology Research and
Development<br>
<br>
</span><span>
<a href="mailto:ivan@llaisdy.com" target="_blank">ivan@llaisdy.com</a><br>
@llaisdy<br>
<a href="http://llaisdy.wordpress.com" target="_blank">llaisdy.wordpress.com</a><br>
<a href="http://github.com/llaisdy" target="_blank">github.com/llaisdy</a><br>
<a href="http://www.linkedin.com/in/ivanuemlianin" target="_blank">www.linkedin.com/in/ivanuemlianin</a><br>
<br>
festina
lente<br>
============================================================<br>
<br>
</span>
<div>
<div>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
</div>
</div>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
erlang-questions mailing list
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
</blockquote>
<br>
</div></div></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>